This trigger takes an optional ID number as an argument. If the ID number is omitted, IsHelper returns 1 if the player is a helper character, and 0 otherwise. If the ID number is included, then IsHelper returns 1 if the player is a helper character with the specified ID number, and 0 otherwise.
boolean int (1 or 0)
Returns bottom if exprn evaluates to bottom.
1. trigger1 = !IsHelper
Triggers if the player is not a helper-type character.
2. trigger1 = IsHelper(1234)
Triggers if the player is a helper character with ID number 1234.
The second format's "exprn" argument is equivalent to the ID parameter of the Helper SCTRL, which defaults to 0 if omitted. Thus, when a helper calls this trigger, the "exprn" argument is compared to its internal ID parameter that was assigned to it by the Helper SCTRL. For instance, a helper created with the following Helper controller:
[State 2000, Helper]
type = Helper
ID = 2010
... executes the following lines of code:
trigger1 = ishelper
trigger2 = ishelper(2010)
trigger3 = ishelper(4010)
In these instances;
- Trigger1 will return true, since no argument was to the trigger, it will simply check whether or not the caller is a helper.
- Trigger2 will also return true, since 2010 is passed as an argument to the trigger, which is compared to the ID parameter of 2010 that we assigned in the Helper SCTRL.
- Trigger3 returns false, as 4010 is passed as an argument to the trigger, and is not equal to the ID parameter of 2010 that we assigned earlier.