Mission Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
m (Rich moved page Mission Lua API to Lua Apis/Mission Lua API without leaving a redirect: adding sub-pages)
No edit summary
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- This file is auto generated, please don't edit manually! -->
= Mission =
= Mission =
== Description ==
== Description ==
Line 14: Line 15:
'''Description''': This should be called when the final objective of the mission has been completed
'''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
It will trigger the game to fade to black and return to the main menu
'''Returns''': Nothing
=== MissionFailed ===
<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
'''Returns''': Nothing
Line 21: Line 28:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| characterTable || Lua Table
| characterTable || Lua Table
Line 32: Line 41:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| sender || string
| sender || string
Line 38: Line 49:
|}
|}
'''Description''': Send an SMS with the contents _message_ from ''sender''
'''Description''': Send an SMS with the contents _message_ from ''sender''
'''Returns''': Nothing
=== SendMessageToDevice ===
<syntaxhighlight source lang="lua">Mission.SendMessageToDevice(sender, recipiantName, message)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
| sender || string
|-
| recipiantName || string
|-
| message || string
|}
'''Description''': Sends an abitrary message to a hackable device, this can be used for intercommunication between devices


'''Returns''': Nothing
'''Returns''': Nothing
Line 60: Line 56:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| networkTable || Lua Table
| networkTable || Lua Table
Line 68: Line 66:


=== ConnectToNetwork ===
=== ConnectToNetwork ===
<syntaxhighlight source lang="lua">Mission.ConnectToNetwork(characterTable, networkName, accessKey)</syntaxhighlight>
<syntaxhighlight source lang="lua">Mission.ConnectToNetwork(connector, targetNetwork, accessKey)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
|-
| characterTable || Lua Table
! Name !! Type
|-
| connector || Lua Type
|-
|-
| networkName || string
| targetNetwork || Lua Type
|-
|-
| accessKey || string
| accessKey || string
Line 87: Line 87:
{| class="wikitable"
{| class="wikitable"
|-
|-
| sender || Lua Table
! Name !! Type
|-
|-
| receiver || Lua Table
| sender || Lua Type
|-
| receiver || Lua Type
|-
|-
| dataTable || Lua Table
| dataTable || Lua Table
Line 102: Line 104:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| deviceTable || Lua Table
| deviceTable || Lua Table
Line 115: Line 119:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| deviceTable || Lua Table
| deviceTable || Lua Table
Line 128: Line 134:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| deviceTable || Lua Table
| deviceTable || Lua Table
Line 139: Line 147:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| deviceTable || Lua Table
| deviceTable || Lua Table
Line 145: Line 155:


'''Returns''': Nothing
'''Returns''': Nothing
=== ObjectiveIsActive ===
<syntaxhighlight source lang="lua">Mission.ObjectiveIsActive(objectiveName)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| objectiveName || string
|}
'''Description''': Returns true if objective has been started but not completed yet.
'''Returns''': bool
=== ObjectiveIsCompleted ===
<syntaxhighlight source lang="lua">Mission.ObjectiveIsCompleted(objectiveName)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| objectiveName || string
|}
'''Description''': Returns true if objective has been completed.
'''Returns''': bool


=== StartObjective ===
=== StartObjective ===
<syntaxhighlight source lang="lua">Mission.StartObjective(objective)</syntaxhighlight>
<syntaxhighlight source lang="lua">Mission.StartObjective(objectiveTable)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
|-
| objective || Lua Table
! Name !! Type
|-
| objectiveTable || Lua Table
|}
|}
'''Description''': Start the provided objective
'''Description''': Start the provided objective
Line 158: Line 196:


=== CompleteObjective ===
=== CompleteObjective ===
<syntaxhighlight source lang="lua">Mission.CompleteObjective(objective)</syntaxhighlight>
<syntaxhighlight source lang="lua">Mission.CompleteObjective(objectiveTable)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
|-
| objective || Lua Table
! Name !! Type
|-
| objectiveTable || Lua Table
|}
|}
'''Description''': Complete the provided objective
'''Description''': Complete the provided objective
Line 169: Line 209:


=== SendNextHint ===
=== SendNextHint ===
<syntaxhighlight source lang="lua">Mission.SendNextHint(objective)</syntaxhighlight>
<syntaxhighlight source lang="lua">Mission.SendNextHint(objectiveTable)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
|-
| objective || Lua Table
! Name !! Type
|-
| objectiveTable || Lua Table
|}
|}
'''Description''': Send the next hint in the Objective's hint array
'''Description''': Send the next hint in the Objective's hint array
Line 180: Line 222:


=== SendNextMessage ===
=== SendNextMessage ===
<syntaxhighlight source lang="lua">Mission.SendNextMessage(fromCharacter, objective)</syntaxhighlight>
<syntaxhighlight source lang="lua">Mission.SendNextMessage(fromCharacter, objectiveTable)</syntaxhighlight>
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| fromCharacter || Lua Table
| fromCharacter || Lua Table
|-
|-
| objective || Lua Table
| objectiveTable || Lua Table
|}
|}
'''Description''': Send the next message in the Objective's message array from ''fromCharacter''
'''Description''': Send the next message in the Objective's message array from ''fromCharacter''
Line 197: Line 241:


'''Returns''': string
'''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
=== DevicesConnected ===
<syntaxhighlight source lang="lua">Mission.DevicesConnected()</syntaxhighlight>
'''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'''
{| class="wikitable"
|-
! 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 ===
<syntaxhighlight source lang="lua">Mission.GetBool(key)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! 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 ===
<syntaxhighlight source lang="lua">Mission.SetBool(key, newBool)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| key || string
|-
| newBool || bool
|}
'''Description''': Sets a boolean value of a key in mission Lua script.
'''Returns''': Nothing
=== GetString ===
<syntaxhighlight source lang="lua">Mission.GetString(key)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! 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 ===
<syntaxhighlight source lang="lua">Mission.SetString(key, newString)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| key || string
|-
| newString || string
|}
'''Description''': Sets a string value of a key in mission Lua script.
'''Returns''': Nothing
=== GetNumber ===
<syntaxhighlight source lang="lua">Mission.GetNumber(key)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! 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 ===
<syntaxhighlight source lang="lua">Mission.SetNumber(key, newValue)</syntaxhighlight>
'''Expected parameter types'''
{| class="wikitable"
|-
! Name !! Type
|-
| key || string
|-
| newValue || number
|}
'''Description''': Sets a numeric value of a key in mission Lua script.
'''Returns''': Nothing




This file is auto generated, please don't edit manually!


'''Docs last hacked together on''': 09/05/2017 13:17
'''Docs last hacked together on''': 15/11/2019 14:59
[[Category:Modding]][[Category:LuaAPI]]

Revision as of 18:05, 19 November 2019

Mission

Description

The Mission API controls the flow of the mission, this includes starting and stopping the mission, triggering hints and messages and sending data between varying mission characters

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

AddCharacter

Mission.AddCharacter(characterTable)

Expected parameter types

Name Type
characterTable Lua Table

Description: Register and spawn a chracter in the game

Returns: Nothing

SendMessageToPlayer

Mission.SendMessageToPlayer(sender, message)

Expected parameter types

Name Type
sender string
message string

Description: Send an SMS with the contents _message_ from sender

Returns: Nothing

AddNetwork

Mission.AddNetwork(networkTable)

Expected parameter types

Name Type
networkTable Lua Table

Description: Register a network to the game

Returns: Nothing

ConnectToNetwork

Mission.ConnectToNetwork(connector, targetNetwork, accessKey)

Expected parameter types

Name Type
connector Lua Type
targetNetwork Lua Type
accessKey string

Description: Connect a device to a specified network

Returns: Nothing

SendData

Mission.SendData(sender, receiver, dataTable)

Expected parameter types

Name Type
sender Lua Type
receiver Lua Type
dataTable Lua Table

Description: Send a data file from one device to another

Returns: Nothing

Notes: Much like _ConnectToNetwork_ both _senderName_ and _receiverName_ can be character names (assuming those characters have net devices)

SetNetDeviceNFCData

Mission.SetNetDeviceNFCData(deviceTable, dataTable)

Expected parameter types

Name Type
deviceTable Lua Table
dataTable Lua Table

Description: Sets NFC data on a mission object

Returns: Nothing

SetNetDeviceNFC

Mission.SetNetDeviceNFC(deviceTable, enabled)

Expected parameter types

Name Type
deviceTable Lua Table
enabled bool

Description: Set if a mission object supports NFCAddNetDevice

Returns: Nothing

AddNetDevice

Mission.AddNetDevice(deviceTable)

Expected parameter types

Name Type
deviceTable Lua Table

Description: Add a network device to the mission that's not hackable but can communicate with other devices

Returns: Nothing

AddHackableDevice

Mission.AddHackableDevice(deviceTable)

Expected parameter types

Name Type
deviceTable Lua Table

Description: Add a hackable device to the mission

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(objectiveTable)

Expected parameter types

Name Type
objectiveTable Lua Table

Description: Start the provided objective

Returns: Nothing

CompleteObjective

Mission.CompleteObjective(objectiveTable)

Expected parameter types

Name Type
objectiveTable Lua Table

Description: Complete the provided objective

Returns: Nothing

SendNextHint

Mission.SendNextHint(objectiveTable)

Expected parameter types

Name Type
objectiveTable Lua Table

Description: Send the next hint in the Objective's hint array

Returns: Nothing

SendNextMessage

Mission.SendNextMessage(fromCharacter, objectiveTable)

Expected parameter types

Name Type
fromCharacter Lua Table
objectiveTable Lua Table

Description: Send the next message in the Objective's message array from fromCharacter

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


This file is auto generated, please don't edit manually!

Docs last hacked together on: 15/11/2019 14:59