Run once

I realize that a make some stupid thing in my code in the past and curently fixing it.


I used self swich where Im not supose to and did't realize it.


On map load, I put paralelle event that automaticly set some parameter specific for this map.


I use that on all map.


My mistake was to use selfswitch on it.


As selfswitch ar persistant, that will not run it again the next time the map was loaded.


What is your suggestion?


I guess the best will be to be able to start common event on map load where I will put the code...


Thanks for your help.
no, if you want an autorun or parallel process repeat once per map load, you don't use switches at all - you use the erase event command.


That will erase the event from memory (preventing it from running twice), but nothing can remove the event from the mapfile so it will be back on map reload when reentering the map


I suggest you work through some eventing tutorials, you can find some of them in my starting point (link in my signature)
You can use Erase Event, which will cause the event to disappear until the next time you load up the map.


EDIT: @Andar totally ninja'd me.
You solve my problem! I did't even thinking about this solution, so thanks!!!

Original thread: https://forums.rpgmakerweb.com/threads/run-once.73952/