Instructions: Difference between revisions

From Desynced Wiki
No edit summary
(Started Adding explanations for how individual nodes work and possible use cases for them individually)
Line 1: Line 1:
An instruction is a node within behaviour programming. Each instruction is composed of .LUA code.
An instruction is a node within behavior programming. Each instruction is composed of .LUA code.


<blockquote>List of Instructions and how they can be used [Community Member added - May not be accurate or contain all possible use cases] -- WIP</blockquote>
= Unit =
= Move =
= Component =
= Flow =
= Math =
====== Compare Number ======
[[File:Compare Number Node.png|thumb|Comparing a variable against the value of 100. This allows for the node to be used as a conditional statement.]]
The "Compare Number" Component takes in a value and compares that value against another. This can be used to compare two numbers as intended or used as an if statement. To use this node as an if statement you can compare a value of 0/1 against 0 this will allow you to use the "If Larger" and "If Smaller" as true or false to determine a conditional statement.
= Global =
====== Distance ======
[[File:Distance Node.png|thumb|Using the signal register as an input (which is set to a unit world location) and storing the distance value as a variable.]]
The "Distance" component takes a location based input (unit world location) and stores the distance from the that input to the unit your script is being run on in the result. This can be used identify how far one unit is away from another.
====== Get Home ======
[[File:GetHome.png|thumb|Writing the Home value to the Signal Register]]
The "Get Home" component gets the factions Home Unit and writes the result to a Unit Register or a Variable. The result can then be referenced later as the home location.


"Just write the guide"


{{InstructionsNav}}
{{InstructionsNav}}

Revision as of 16:52, 25 August 2023

An instruction is a node within behavior programming. Each instruction is composed of .LUA code.

List of Instructions and how they can be used [Community Member added - May not be accurate or contain all possible use cases] -- WIP

Unit

Move

Component

Flow

Math

Compare Number
Comparing a variable against the value of 100. This allows for the node to be used as a conditional statement.

The "Compare Number" Component takes in a value and compares that value against another. This can be used to compare two numbers as intended or used as an if statement. To use this node as an if statement you can compare a value of 0/1 against 0 this will allow you to use the "If Larger" and "If Smaller" as true or false to determine a conditional statement.



Global

Distance
Using the signal register as an input (which is set to a unit world location) and storing the distance value as a variable.

The "Distance" component takes a location based input (unit world location) and stores the distance from the that input to the unit your script is being run on in the result. This can be used identify how far one unit is away from another.


Get Home
Writing the Home value to the Signal Register

The "Get Home" component gets the factions Home Unit and writes the result to a Unit Register or a Variable. The result can then be referenced later as the home location.