View changes for revision:                                                                                                                                                
Event controller - "IF" (uses zones) (168, rev. 43)
By VGR on 05-18-16, 11:37 pm
Category 'Event controllers', known, fully documented
This event controller can activate a target event ID, if either a player or an enemy touches a predefined location. There are many additional settings for this controller that can tweak its behaviour, for example requiring Mario to have a specific power-up status, or requiring him to be inside a location instead of just touching it. Setting up the controller to deactivate the event ID instead of activating it, will also swap the effect of the controller, requiring Mario to leave a predefined location or to clear a predefined location from all enemies to trigger the event.

Note: some sprites are not counted as being outside the zone or not counted as enemies and cannot be detected as such; for example: the Spike Ball, the Chain Chomp.
Data files: none
Sprite fields:
Target ID: value at nybble 2-3. This event ID will be activated when the specified conditions are met.
Player zone ID: value at nybble 4-5. Set to 255 to make it watch everywhere for Mario to meet the condition.
Enemies zone ID: value at nybble 6-7. Set to 255 to make it watch everywhere for enemies to be defeated.
Player power-up: list at nybble 8: 0=Any,1=No power-up,2=Super Mushroom,3=Fire Flower,4=Mega Mushroom,5=Mini Mushroom,6=Blue Shell,7=Starman. Event will only be triggered if Mario's power-up matches the specified, or this is set to 0.
Zone interaction: list at nybble 9: 0=Inside the zone,1=Touching the ground in the zone,2=In the air in the zone. 0 - event is only triggered if a player is inside the Mario location. 1 - event is only triggered if a player is touching the ground while inside the Mario location. 2 - the event is only triggered if a player is jumping or otherwise not touching the ground inside the Mario location. Measurements always correspond to Mario's feet (lowest pixel).
Usage mode: list at nybble 10: 0=Single use,1=Multiple use,2=Only while both Mario and enemy status are satisfied. 0 - event is only triggered once, when the Mario status and enemy status are satisfied. 1 - event is triggered each time the Mario status and enemy status are satisfied, but does not revert to the opposite state unless forced to by another controller. 2 - event is only triggered while Mario status and enemy status are satisfied.
Switch mode: list at nybble 11: 0=Activates target (switches event state),1=Deactivates target (switches event state). If this option is set to "Deactivates target", the activation modes will be reversed; for example, activation mode 2 will deactivate the event while you're touching the zone, and reactivate it when you leave. Note on locations for enemies that have "Deactivates target" set: The opposite effect of the controller becomes active, when Mario gets close enough to the sprite (to load it into memory). The opposite effect of the controller is always active, though. The event is deactivated while the enemy enemy of the location is alive, and will reactivate when it dies. As stated before, this special behaviour is only valid for enemy-'deactivated' locations.
Event controller - "IF" (uses zones) (168, rev. 44)
By  Hiccup on 07-25-16, 10:17 pm
Category 'Event controllers', known, fully documented
This event controller can activate a target event ID, if either a player touches a predefined location and/or specified enemies are defated. There are many additional settings for this controller that can tweak its behaviour, for example requiring Mario to have a specific power-up status, or requiring him to be inside a location instead of just touching it. Setting up the controller to deactivate the event ID instead of activating it, will also swap the effect of the controller, requiring Mario to leave a predefined location or to clear a predefined location from all enemies to trigger the event. Note that unlike NSMBW, only enemy "life" status is watched, not their position. The zone is used to select sprites placed in the editor that should be watched.
Data files: none
Sprite fields:
Target ID: value at nybble 2-3. This event ID will be activated when the specified conditions are met.
Player zone ID: value at nybble 4-5. Set to 255 to make it watch everywhere for Mario to meet the condition.
Enemies zone ID: value at nybble 6-7. Set to 255 to make it watch everywhere for enemies to be defeated.
Player power-up: list at nybble 8: 0=Any,1=No power-up,2=Super Mushroom,3=Fire Flower,4=Mega Mushroom,5=Mini Mushroom,6=Blue Shell,7=Starman. Event will only be triggered if Mario's power-up matches the specified, or this is set to 0.
Zone interaction: list at nybble 9: 0=Inside the zone,1=Touching the ground in the zone,2=In the air in the zone. 0 - event is only triggered if a player is inside the Mario location. 1 - event is only triggered if a player is touching the ground while inside the Mario location. 2 - the event is only triggered if a player is jumping or otherwise not touching the ground inside the Mario location. Measurements always correspond to Mario's feet (lowest pixel).
Usage mode: list at nybble 10: 0=Single use,1=Multiple use,2=Only while both Mario and enemy status are satisfied. 0 - event is only triggered once, when the Mario status and enemy status are satisfied. 1 - event is triggered each time the Mario status and enemy status are satisfied, but does not revert to the opposite state unless forced to by another controller. 2 - event is only triggered while Mario status and enemy status are satisfied.
Switch mode: list at nybble 11: 0=Activates target (switches event state),1=Deactivates target (switches event state). If this option is set to "Deactivates target", the activation modes will be reversed; for example, activation mode 2 will deactivate the event while you're touching the zone, and reactivate it when you leave. Note on locations for enemies that have "Deactivates target" set: The opposite effect of the controller becomes active, when Mario gets close enough to the sprite (to load it into memory). The opposite effect of the controller is always active, though. The event is deactivated while the enemy enemy of the location is alive, and will reactivate when it dies. As stated before, this special behaviour is only valid for enemy-'deactivated' locations.