Behavior Programming: Difference between revisions

From Desynced Wiki
(Created page with "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 Obtaining and utilizing a {{IL|Signal Reader}} or Read Signal for item delivery...")
 
No edit summary
Line 7: Line 7:
Good subjects may be:
Good subjects may be:


Utilizing Parameters for passing information into and out of a behavior
====== 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 {{IL|Fabricator}} to produce {{IL|Metal Bars}}, you are interacting with the first register. The {{IL|Fabricator}} then assigns the second register to {{IL|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 {{IL|Signal Reader}} or Read Signal for item delivery or mining
Obtaining and utilizing a {{IL|Signal Reader}} or Read Signal for item delivery or mining


Using Compare Number to determine outcomes
Using Compare Number to determine outcomes

Revision as of 11:48, 19 August 2023

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