Branching Step is to redirect the player to different steps based on the value of a custom variable. It could make the event to have more variations.
The default waiting type of this step type is "Branching". You cannot change the waiting type for this step type.
Unlike other step type, you cannot use the drag and drop method to define the next step ID. You have to fill in a form to provide a list of next step IDs and the conditions.
Branching
To edit a Branching step, click the "Edit" button in the edit panel.A modal window will show up for you to input the details.
(1) Custom Variable Name
Fill in the variable name that this step should be based on.
(2) Variable Type.
You need to provide the data type of the custom variable provided in (1). You can refer to the Evaluate Step or Show Choices Step depends on how your custom variable is set.
(3) Comparative Method.
You can define how the mod should compare the variable and the value list you provided.
If it is String or Boolean data type, only equal match is allowed.
If it is Integer or Floating Point Number type, you can choose "greater than" or "less than" etc.
(4) Number of Branches.
Select the number of branches and the system will add rows in the table below.
(5) Variable Value.
The value that the custom variable (1) should be compared to using the method (3).
Note:
1. The value here need to match to the data type (2).
2. It is case sensitive if you are trying to do a String matching.
3. It is not necessary to put the value in order as the Loader mod will do a sorting according to the comparative method. That said it is still a good idea to put them in order to improve readability.
(6) Next Step ID
Indicate which step the event will go to if the custom variable value fulfill the condition.
Note:
1. The next step ID is case sensitive.
2. While not necessary, it may be a good idea to rename the IDs of all destination step to improve readability.
(7) Update Button.
Make sure you click the "Update" button to save the changes.
Examples
While branching is a basic thing if you have programming knowledge, it could be a bit confusing if you do not. Here are 2 examples to help you understand.
Example 1
The mod will process the above branching step in the following sequence:
1. If the value of "is_sleep" is "true", goes to Step_sleep.
2. If the value of "is_sleep" is "false", goes to step_wake.
Example 2
The above will be processed in the following sequence: 1. If the value of "time_counter" is greater than 0, goes to Step_loop.
2. If the value of "time_counter" is greater than 6, goes to step_wake.
No comments:
Post a Comment