Data Scripting

From Off Grid Wiki
Revision as of 16:47, 27 June 2018 by Steve (talk | contribs) (Initial draft of Data Scripting page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:OffGridDocStart

Data Scripting

We saw in Mission Scripting that Data can have a script attached. Let's have a brief look at what can be done with this.

We have the following globals available:

Globals
Name Description
deviceName The name of the device, to be used with Devices Lua API
macAddress The MAC address of the device
RunMissionCommand The function enabling access to mission script functionality

So for instance, let's say we want to set the Device state to Amok when the data is received:

Devices.SetAmok(deviceName, true);

or trigger an objective to be complete?

RunMissionCommand('Mission.CompleteObjective(mission.objectives.ourObjective)')

Remember... Data is your most powerful weapon!