Mission Lua API: Difference between revisions
No edit summary |
mNo edit summary |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
= Mission = | = Mission = | ||
== Description == | == Description == | ||
The Mission API controls the flow of the mission, this includes starting and stopping the mission, | The Mission API controls the flow of the mission, this includes starting and stopping the mission, and dealing with objectives and other mission-related information | ||
== Functions == | == Functions == | ||
=== MissionStarted === | === MissionStarted === | ||
Line 18: | Line 18: | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === MissionFailed === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.MissionFailed()</syntaxhighlight> | ||
'''Description''': This function will fail the current mission, as if Joe had been tazed (or similar). | |||
'''Returns''': Nothing | |||
=== SpawnCharacter === | |||
<syntaxhighlight source lang="lua">Mission.SpawnCharacter(internalName)</syntaxhighlight> | |||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| internalName || string | |||
|} | |} | ||
'''Description''': | '''Description''': Spawn a registered character in the game | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === ObjectiveIsActive === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.ObjectiveIsActive(objectiveName)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | objectiveName || string | ||
|} | |} | ||
'''Description''': | '''Description''': Returns true if objective has been started but not completed yet. | ||
'''Returns''': | '''Returns''': bool | ||
=== | === ObjectiveIsCompleted === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.ObjectiveIsCompleted(objectiveName)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| objectiveName || string | |||
|} | |} | ||
'''Description''': | '''Description''': Returns true if objective has been completed. | ||
'''Returns''': | '''Returns''': bool | ||
=== | === StartObjective === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.StartObjective(objectiveName)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | objectiveName || string | ||
|} | |} | ||
'''Description''': | '''Description''': Start the provided objective | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === CompleteObjective === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.CompleteObjective(objectiveName)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | objectiveName || string | ||
|} | |} | ||
'''Description''': | '''Description''': Complete the provided objective | ||
'''Returns''': Nothing | |||
=== GetCurrentObjective === | |||
<syntaxhighlight source lang="lua">Mission.GetCurrentObjective()</syntaxhighlight> | |||
'''Description''': Get the name of the current objective | |||
'''Returns''': string | |||
=== TriggerAutoSave === | |||
<syntaxhighlight source lang="lua">Mission.TriggerAutoSave()</syntaxhighlight> | |||
'''Description''': Triggers an autosave, only if the game is current in a mission | |||
'''Returns''': Nothing | '''Returns''': Nothing | ||
''' | === DevicesConnected === | ||
=== | <syntaxhighlight source lang="lua">Mission.DevicesConnected()</syntaxhighlight> | ||
<syntaxhighlight source lang="lua">Mission. | '''Description''': Call this AFTER all Devices have been connected to their networks. This allows DataPoints to be processed correctly. | ||
'''Returns''': Nothing | |||
=== SetPlayerControlled === | |||
<syntaxhighlight source lang="lua">Mission.SetPlayerControlled(tf)</syntaxhighlight> | |||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | tf || bool | ||
|} | |} | ||
'''Description''': | '''Description''': Set whether the player is currently in control (or not). Used for cutscenes, and other things that we haven't thought of yet. | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === GetBool === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.GetBool(key)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | key || string | ||
|} | |} | ||
'''Description''': | '''Description''': Get a boolean value of a key in mission Lua script. Returns false if key doesn't exist. | ||
'''Returns''': | '''Returns''': bool | ||
=== | === SetBool === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.SetBool(key, newBool)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| key || string | |||
|- | |||
| newBool || bool | |||
|} | |} | ||
'''Description''': | '''Description''': Sets a boolean value of a key in mission Lua script. | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === GetString === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.GetString(key)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| key || string | |||
|} | |} | ||
'''Description''': | '''Description''': Get a string value of a key in mission Lua script. Returns empty if key doesn't exist. | ||
'''Returns''': | '''Returns''': string | ||
=== | === SetString === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.SetString(key, newString)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| key || string | |||
|- | |||
| newString || string | |||
|} | |} | ||
'''Description''': | '''Description''': Sets a string value of a key in mission Lua script. | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === GetNumber === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.GetNumber(key)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| key || string | |||
|} | |} | ||
'''Description''': | '''Description''': Get a numeric value of a key in mission Lua script. Returns 0 if key doesn't exist. | ||
'''Returns''': | '''Returns''': number | ||
=== | === SetNumber === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.SetNumber(key, newValue)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| | ! Name !! Type | ||
|- | |||
| key || string | |||
|- | |||
| newValue || number | |||
|} | |} | ||
'''Description''': | '''Description''': Sets a numeric value of a key in mission Lua script. | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === StartVibrationEvent === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.StartVibrationEvent(objectName)</syntaxhighlight> | ||
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Name !! Type | |||
|- | |- | ||
| | | objectName || string | ||
|} | |} | ||
'''Description''': | '''Description''': Start a mission object vibration event | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== | === StopVibrationEvent === | ||
<syntaxhighlight source lang="lua">Mission. | <syntaxhighlight source lang="lua">Mission.StopVibrationEvent(objectName)</syntaxhighlight> | ||
''' | '''Expected parameter types''' | ||
{| class="wikitable" | |||
|- | |||
! Name !! Type | |||
|- | |||
| objectName || string | |||
'''Description''': | |} | ||
'''Description''': Stop a mission object vibration event | |||
'''Returns''': Nothing | '''Returns''': Nothing | ||
Line 194: | Line 234: | ||
This file is auto generated, please don't edit manually! | This file is auto generated, please don't edit manually! | ||
'''Docs last hacked together on''': | '''Docs last hacked together on''': 23/07/2020 11:58 | ||
[[Category:Modding]][[Category:LuaAPI]] | |||
[[Category:Modding]] | |||
[[Category:LuaAPI]] |
Revision as of 12:40, 23 July 2020
Mission
Description
The Mission API controls the flow of the mission, this includes starting and stopping the mission, and dealing with objectives and other mission-related information
Functions
MissionStarted
Mission.MissionStarted()
Description: This should be called once the initial state of the mission has been set It will cause the game to begin gameplay
Returns: Nothing
MissionCompleted
Mission.MissionCompleted()
Description: This should be called when the final objective of the mission has been completed It will trigger the game to fade to black and return to the main menu
Returns: Nothing
MissionFailed
Mission.MissionFailed()
Description: This function will fail the current mission, as if Joe had been tazed (or similar).
Returns: Nothing
SpawnCharacter
Mission.SpawnCharacter(internalName)
Expected parameter types
Name | Type |
---|---|
internalName | string |
Description: Spawn a registered character in the game
Returns: Nothing
ObjectiveIsActive
Mission.ObjectiveIsActive(objectiveName)
Expected parameter types
Name | Type |
---|---|
objectiveName | string |
Description: Returns true if objective has been started but not completed yet.
Returns: bool
ObjectiveIsCompleted
Mission.ObjectiveIsCompleted(objectiveName)
Expected parameter types
Name | Type |
---|---|
objectiveName | string |
Description: Returns true if objective has been completed.
Returns: bool
StartObjective
Mission.StartObjective(objectiveName)
Expected parameter types
Name | Type |
---|---|
objectiveName | string |
Description: Start the provided objective
Returns: Nothing
CompleteObjective
Mission.CompleteObjective(objectiveName)
Expected parameter types
Name | Type |
---|---|
objectiveName | string |
Description: Complete the provided objective
Returns: Nothing
GetCurrentObjective
Mission.GetCurrentObjective()
Description: Get the name of the current objective
Returns: string
TriggerAutoSave
Mission.TriggerAutoSave()
Description: Triggers an autosave, only if the game is current in a mission
Returns: Nothing
DevicesConnected
Mission.DevicesConnected()
Description: Call this AFTER all Devices have been connected to their networks. This allows DataPoints to be processed correctly.
Returns: Nothing
SetPlayerControlled
Mission.SetPlayerControlled(tf)
Expected parameter types
Name | Type |
---|---|
tf | bool |
Description: Set whether the player is currently in control (or not). Used for cutscenes, and other things that we haven't thought of yet.
Returns: Nothing
GetBool
Mission.GetBool(key)
Expected parameter types
Name | Type |
---|---|
key | string |
Description: Get a boolean value of a key in mission Lua script. Returns false if key doesn't exist.
Returns: bool
SetBool
Mission.SetBool(key, newBool)
Expected parameter types
Name | Type |
---|---|
key | string |
newBool | bool |
Description: Sets a boolean value of a key in mission Lua script.
Returns: Nothing
GetString
Mission.GetString(key)
Expected parameter types
Name | Type |
---|---|
key | string |
Description: Get a string value of a key in mission Lua script. Returns empty if key doesn't exist.
Returns: string
SetString
Mission.SetString(key, newString)
Expected parameter types
Name | Type |
---|---|
key | string |
newString | string |
Description: Sets a string value of a key in mission Lua script.
Returns: Nothing
GetNumber
Mission.GetNumber(key)
Expected parameter types
Name | Type |
---|---|
key | string |
Description: Get a numeric value of a key in mission Lua script. Returns 0 if key doesn't exist.
Returns: number
SetNumber
Mission.SetNumber(key, newValue)
Expected parameter types
Name | Type |
---|---|
key | string |
newValue | number |
Description: Sets a numeric value of a key in mission Lua script.
Returns: Nothing
StartVibrationEvent
Mission.StartVibrationEvent(objectName)
Expected parameter types
Name | Type |
---|---|
objectName | string |
Description: Start a mission object vibration event
Returns: Nothing
StopVibrationEvent
Mission.StopVibrationEvent(objectName)
Expected parameter types
Name | Type |
---|---|
objectName | string |
Description: Stop a mission object vibration event
Returns: Nothing
This file is auto generated, please don't edit manually!
Docs last hacked together on: 23/07/2020 11:58