|
|
Line 3: |
Line 3: |
| For raw data on instructions: Refer to [[Special:CargoTables/instruction|this data on instructions broken down into a table format.]] | | For raw data on instructions: Refer to [[Special:CargoTables/instruction|this data on instructions broken down into a table format.]] |
|
| |
|
| === Flow ===
| | '''Flow''' |
| Note that every dot of an instruction that is not connected will end the current itteration and will trigger a new itteration.
| |
|
| |
|
| An exeption is a subroutine, which is initiated with the "call" behavior. Unconnected dots will return to the parent routine.
| | Note that every pin of an instruction that is not connected will end the current iteration and will trigger a new iteration. |
|
| |
|
| === Unit ===
| | An exception is a subroutine, which is initiated with the "call" behavior. Unconnected pins will return to the parent routine. |
|
| |
|
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| | === Math === |
| ==== Check Altitude ====
| | {{InstructionsIndex|Math}} |
| {| class="wikitable" | | === Component === |
| !Input
| | {{InstructionsIndex|Component}} |
| !Output
| | === Global === |
| !Dots
| | {{InstructionsIndex|Global}} |
| |-
| |
| |Unit*
| |
| |
| |
| |Valley
| |
| |-
| |
| |
| |
| |
| |
| |Plateau
| |
| |-
| |
| |
| |
| |
| |
| |No Unit
| |
| |}
| |
| <nowiki>*</nowiki>Extra Option
| |
| | |
| ===== Description: =====
| |
| Divert program depending on location of a unit.{{#cargo_query:
| |
| tables=instruction
| |
| |fields=name,description
| |
| |where= category="Unit"
| |
| |format=table | |
| }} | |
| </div>
| |
| === Move === | | === Move === |
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| | {{InstructionsIndex|Move}} |
| {{#cargo_query: | | === Unit === |
| tables=instruction
| | {{InstructionsIndex|Unit}} |
| |fields=name,description
| |
| |where= category="Move" | |
| |format=table
| |
| }} | |
| </div>
| |
| === Component ===
| |
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| |
| {{#cargo_query: | |
| tables=instruction
| |
| |fields=name,description
| |
| |where= category="Component"
| |
| |format=table | |
| }} | |
| </div>
| |
| === Flow === | | === Flow === |
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| | {{InstructionsIndex|Flow}} |
| {{#cargo_query: | |
| tables=instruction
| |
| |fields=name,description | |
| |where= category="Flow"
| |
| |format=table
| |
| }}
| |
| </div>
| |
| === Math ===
| |
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| |
| {{#cargo_query:
| |
| tables=instruction
| |
| |fields=name,description
| |
| |where= category="Math"
| |
| |format=table
| |
| }}
| |
| </div>
| |
| === Global ===
| |
| <div class="mw-collapsible mw-collapsed" style="overflow:auto;">
| |
| {{#cargo_query:
| |
| tables=instruction
| |
| |fields=name,description
| |
| |where= category="Global"
| |
| |format=table
| |
| }} | |
| </div>
| |
|
| |
|
| ====== Compare Number ======
| |
| 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.
| |
| [[File:Compare_Number_Node.png]]<blockquote>Comparing a variable against the value of 100. This allows for the node to be used as a conditional statement.</blockquote>
| |
|
| |
|
| ====== Distance ====== | | ====== Distance ====== |
Line 101: |
Line 35: |
| Writing the Home value to the Signal Register</blockquote> | | Writing the Home value to the Signal Register</blockquote> |
| List of Nodes and how they can be used [Community Member added - May not be accurate or contain all possible use cases] -- WIP | | List of Nodes and how they can be used [Community Member added - May not be accurate or contain all possible use cases] -- WIP |
| | --> |
An instruction is a node within behavior programming. Each instruction is composed of .LUA code.
For raw data on instructions: Refer to this data on instructions broken down into a table format.
Flow
Note that every pin of an instruction that is not connected will end the current iteration and will trigger a new iteration.
An exception is a subroutine, which is initiated with the "call" behavior. Unconnected pins will return to the parent routine.
Math
Add
|
Adds a number or coordinate to another number or coordinate
|
Compare Number
|
Divert program depending on number of Value and Compare
|
Copy
|
Copy a value to a frame register, parameter or variable
|
Divide
|
Divides a number or coordinate from another number or coordinate
|
Get Battery
|
Gets the value of the Battery level as a percent
|
Get Health
|
Gets a unit's health as a percentage, current remaining and max amount
|
Get Self
|
Gets the value of the Unit executing the behavior
|
Get Shield
|
Get a unit's shield as a percentage, current remaining and max amount
|
Get Unit At
|
Gets the best matching unit at a coordinate
|
Is Working
|
Checks whether a particular component is currently working
|
Modulo
|
Get the remainder of a division
|
Multiply
|
Multiplies a number or coordinate from another number or coordinate
|
Random Coordinate
|
Returns a random coordinate from a location within a specified range
|
Random Number
|
Returns a random number between a min and max value
|
Set Number
|
Sets the numerical/coordinate part of a value
|
Subtract
|
Subtracts a number or coordinate from another number or coordinate
|
Component
Mine
|
Mines a single resource
|
Radar
|
Scan for the closest unit that matches the filters
|
Global
Get Trust
|
Gets the trust level of the unit towards you
|
Get Type
|
Gets the type from an item or unit
|
Land
|
Tells a satellite that has been launched to land
|
Launch
|
Launches a satellite if equipped on an AMAC
|
Lookat
|
Turns the unit to look at a unit or a coordinate
|
Notify
|
Triggers a faction notification
|
Percent
|
Gives you the percent that value is of Max Value
|
Pings a Unit
|
Plays the Ping effect and notifies other players
|
Produce Unit
|
Sets a production component to produce a blueprint
|
Read Key
|
Attempts to read the internal key of the unit
|
Remap
|
Remaps a value between two ranges
|
Move
Attack Move
|
Moves towards a location stopping to attack any enemies encountered
|
Move Away (Range)
|
Moves out of range of another unit, the number value of the target specifies the range
|
Move East
|
Moves towards a tile East of the current location at the specified distance
|
Move North
|
Moves towards a tile North of the current location at the specified distance
|
Move South
|
Moves towards a tile South of the current location at the specified distance
|
Move Unit
|
Moves to another unit or within a range of another unit
|
Move West
|
Moves towards a tile West of the current location at the specified distance
|
Scout
|
Moves in a scouting pattern around the factions home location
|
Scout Range
|
Moves in a random direction a specified amount
Optionally pass a coordinate to give some directionality
|
Stop Unit
|
Stop movement and abort what is currently controlling the unit's movement
|
Unit
Check Altitude
|
Divert program depending on location of a unit or coordinate
|
Connect
|
Connects the Unit to the Logistics Network
|
Count Items
|
Counts the number of the passed item contained in the unit's inventory
|
Count Slots
|
Returns the number of slots in this unit of the given type
|
Disconnect
|
Disconnects the Unit from the Logistics Network
|
Get Active Order
|
Gets the source, target and amount data from the current active order
|
Get First Locked Id
|
Gets the first item where the locked slot exists but there is no item in it
|
Is Docked
|
Check if a unit is docked and get its garage
|
Is Equipped
|
Check if a specific component has been equipped
|
Is Fixed
|
Check if a specific item slot index is fixed
|
Is Moving
|
Checks the movement state of a unit
|
Is Same Grid
|
Checks if two units or coordinates are in the same logistics network
|
Lock Itemslot
|
Lock a specific itemslot index, a range of slot index via coord, or all storage slots
|
Match
|
Filters the passed unit
|
Package All
|
Tries to pack all packable units into items
|
Read Radio
|
Reads the Radio signal on a specified band
|
Request Item
|
Requests an item if it doesn't exist in the inventory
|
Request Wait
|
Requests up to a specified amount of an item and waits until that amount exists in inventory
|
Switch
|
Filters the passed unit or item
|
Turn Off
|
Shuts down the power of the Unit
|
Turn On
|
Turns on the power of the Unit
|
Unlock Itemslot
|
Unlock a specific itemslot index, a range of slot index via coord, or all storage slots
|
Flow
Break
|
Break out of a loop
|
Clear Research
|
Clears a research from queue, or entire queue if no tech passed
|
Exit
|
Stops execution of the behavior
|
Have Item
|
Checks if you have at least a specified amount of an item
|
Is a
|
Compares if an item of unit is of a specific type
|
Is Unlocked
|
Checks whether a faction has an id unlocked
|
Jump
|
Jumps execution to label with the same label id
|
Label
|
Labels can be jumped to from anywhere in a behavior
|
Lock
|
Run one instruction at a time
|
Loop Producers
|
Gets all producers for a production with their production time
|
Restart
|
Restart execution of the behavior
|
Select Nearest
|
Branches based on which unit is closer, optional branches for closer unit
|
Unit Type
|
Divert program depending on unit type
|
Unlock
|
Run as many instructions as possible. Use wait instructions to throttle execution.
|
Wait Ticks
|
Pauses execution of the behavior until 1 or more ticks later (5 ticks=1 second)
|
Distance
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.
Using the signal register as an input (which is set to a unit world location) and storing the distance value as a variable.
Get Home
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.
Writing the Home value to the Signal Register
List of Nodes and how they can be used [Community Member added - May not be accurate or contain all possible use cases] -- WIP
-->