diff --git a/5.1%29-Lua-Mission-Scripts.md b/5.1%29-Lua-Mission-Scripts.md new file mode 100644 index 0000000..32f13ca --- /dev/null +++ b/5.1%29-Lua-Mission-Scripts.md @@ -0,0 +1,82 @@ +Every mission event command starting with custom Lua syntax: `rem.mission.` +Most Lua commands having a key condition after the initial Lua command. These key conditions are defined in the `()` brackets. + +**Lua Command List:** + +`create("missionname")` + +Game Function: Custom mission name definition . The key `"missionname"` has to be unique , so replace this name with your own defined mission name. + + +`missiontype("type")` + +Game Function: Determines with prefab key conditions the mission type. Usable key conditions are `"flyto"`, `"pve"` or `trade`. + + +`trigger("State")` + +Game Function: One-shot trigger with prefab key conditions. Replacing `"State"` with `"InitState"` will fire the lua entities when started a mission by player, immediately. + + +`startbase("BaseName")` + +Game Function: Set docked base for the mission start. Write the intended base name in the key condition where to start (e.g. Li01_01_Base). + + +`thnconfig("variable", "stringvalue")` + +Game Function: Overwrites a condition in the `config.lua`. This command is necessary to run custom base cutscenes by mission start or Lua event. + A custom`variable` and `stringvalue` have to definied in the used `.thn` file and the `config.lua` to call the function to run a + cutscene script. + + +`thntime(time) ` + +Game Function: Customizable delay timer for the further sequence of the script. Mostly used to avoid executing a command during a cutscene. + + +`showpopup(caption, message)` + +Game Function: Shows internal Freelancer function popupdialogue window with custom content. The Mission Script will continue after pressing the "OK" button. + The key condition `caption` defines the title of the popupdialogue and `message` the actual content of the dialogue. + + +`missionmessage("triggermode", caption)` + +Game Function: Displays message text to your screen. Define one of these Lua Event triggermodes: `"popup"` or `"launch"`. + It will run the message either after pressing "OK" button of popdialog or launch dock and enter space. + + +`thnsave()` + +Game Function: Declares a completed chapter in your script. Before an additional definied `startbase` event there's a need to set this save method with `thnsave()`. + + +`pve_enemyfaction("factionname")` + +Game Function: Set a faction to the spawned enemies in the mission script. Replace `"factionname"` with a faction term in the Freelancer faction list, e.g.`"fc_n_grp"`. + + +`pve_enemycount(amount)` + +Game Function: A spawn-counter with a defined value for enemy NPCs. Change `amount` with a number. + + +`pve_wavecount(value)` + +Game Function: A wave-counter with a defined value for enemy NPC waves. Change `value` with a number. + + +`pve_spawnmethod("method")` + +Game Function: A method for NPC spawn. Needs to be set to `"fixed"` for a specific spawn position or `"dynamic"` for random spawn locations. + + +`pve_spawnpos(X, Y, Z)` + +Game Function: Determine the NPC spawn positions. X = left to right, Y = up to down, Z = back to forth + + +`.save()` + +Game Function: End line for every mission script. Close and saves the mission variables to origin. \ No newline at end of file