[RMMZ] GETTING A COMMON EVENT TO WEAR OFF IF THE MAP CHANGES.
Posts
Pages:
1
So I've got this investigator character. They have a skill which calls a common event; it sets the screen to grayscale, memorizes the current BGS and then plays a suitably noir theme, and opens up new dialogue when examining various events based on if the 'NOIRVISION' switch is on. Triggering the skill again while it's active sets things back to normal - screen hue goes back to the usual balance, the memorized BGS is played, and the optional dialogue doesn't show.
How do I make this effect go away every time the player wanders into a new map without hardcoding it in every teleporter?
How do I make this effect go away every time the player wanders into a new map without hardcoding it in every teleporter?
The thought in my head is that if the skill is currently hard-coded to revert those changes when it's used again, maybe all you do need to do is move that process to it's own Common Event that works in parallel to other events, and have that Common Event require different switch to activate/run than whatever switch the skill uses.
The new Common Event would likely want to deactivate the switch it needs to run so that it's not constantly running. Which likely means turning it's switch on with every map transition. However, that is still 10x more efficient than copy-pasting blocks of code into each map transition!
The new Common Event would likely want to deactivate the switch it needs to run so that it's not constantly running. Which likely means turning it's switch on with every map transition. However, that is still 10x more efficient than copy-pasting blocks of code into each map transition!
A pure event way can work as Marrend suggests - but you can have the skill turn on/off the switch in its associated common event.
In the parallel common event, use the "control variables" command to get the player's map id, and compare with the map id you stored in a variable when the skill was first used.
Alternatively, put a "call common event" in each of your teleport events. More efficient but more work for you.
The script way to do it is to hook Game_Map.prototype.setupEvents or Game_Player.prototype.reserveTransfer and from there call $gameTemp.reserveCommonEvent(id) with the id of a common event you want called on every teleport.
There may be plugins that do this already.
In the parallel common event, use the "control variables" command to get the player's map id, and compare with the map id you stored in a variable when the skill was first used.
Alternatively, put a "call common event" in each of your teleport events. More efficient but more work for you.
The script way to do it is to hook Game_Map.prototype.setupEvents or Game_Player.prototype.reserveTransfer and from there call $gameTemp.reserveCommonEvent(id) with the id of a common event you want called on every teleport.
There may be plugins that do this already.
Pages:
1














