Behavior Programming

From Desynced Wiki
Revision as of 11:48, 19 August 2023 by Johan (talk | contribs)

Taking volunteers to write short guides on putting together a few simple behaviors.

Try not to add layers of complexity - creating a guide for something that can be improved upon will allow the student to reinforce the existing knowledge you have given them.

We need roughly 5 good examples

Good subjects may be:

Utilizing Parameters for passing information into and out of a behavior

Registers, parameters and variables are a key element to the game and especially so for making any good use of behaviors. In short, all three are essentially one and the same: a place to store and recall information.

  • A register is the inputs and outputs of components. When you assign a Fabricator to produce File:Metal Bars.pngMetal Bars, you are interacting with the first register. The Fabricator then assigns the second register to Metal Ore.
    • Another example is the visual register on the unit registers interface below the component registers.
  • A parameter is created from within a behavior - on the top left of the editor, you will see a - and a + sign. You can create as many or as few as you deem necessary. The main benefit of doing so is so that you can pass information into and out of a behavior without using any unit registers.
  • A variable is exclusively for use inside a behavior and it serves as a quicker way of creating information storage that is visually recognizable at a glance. If you have any instruction with an output, you can create a new variable - they are alphanumeric, so the first is A, then B, etc.

Obtaining and utilizing a Signal Reader or Read Signal for item delivery or mining

Using Compare Number to determine outcomes