Event Touch and Map Variables
onTouch and onTouchEnd let an event react to any entity that collides with it: a player or another event. They are useful for pressure plates, push blocks, sensors, traps, doors, and shared MMO world state.
Use map variables for state that belongs to the map room and should be shared by every player on that map. Use player variables for state that belongs only to one player.
Touch Context
self: the event running the hookother: the player or event touching itotherType:'player'or'event'player: the player when this is a player/event touchphase:'start'or'end'pairId: stable id for that collision pairmap: the currentRpgMap
onTouch runs before the legacy onPlayerTouch hook. For event/event collisions, both events receive onTouch and onTouchEnd.
Shared Map State
onChanges for visible players and events on that map. Player variables do the same for the player that owns the variable.
Variable writes inside onChanges are guarded against recursive loops. Prefer making onChanges compute display and collision state from existing variables, and write variables from gameplay hooks such as onTouch, onTouchEnd, or onAction.