So, i made a plugin for my game to simplify a process. What it does is basically search for specific tags and add commands in those events, depending on the tags. I mainly made it to simplify dialogue handling. I could go into more details but i doubt it would give anyone any more insight.
The plugin works fine and it can handle whatever i throw at it. However, i have to call it every time i enter a map, leave and reenter it, or save and load the game.
I can think of 2 solutions to this but i don't know how to do them:
1. Run my script whenever a new map is loaded automatically. The problem here is that whatever i tried sees the $dataMap.events as null. This would also have the drawback of spending time to check all the events of the map each and every time.
2. Save the changed contents of $dataMap permanently. This would probably be the best solution, since the script would only run once per map.
2b. If i went with 2, then a good question would be if i could alter all maps from the beginning of the game. Although i don't think that's possible since $dataMap doesn't hold the map's ID and $gameMap doesn't hold the events' command list.
PS: The "changed contents" are basically the same as before - no new events were added - just with extra commands in their command list.
The plugin works fine and it can handle whatever i throw at it. However, i have to call it every time i enter a map, leave and reenter it, or save and load the game.
I can think of 2 solutions to this but i don't know how to do them:
1. Run my script whenever a new map is loaded automatically. The problem here is that whatever i tried sees the $dataMap.events as null. This would also have the drawback of spending time to check all the events of the map each and every time.
2. Save the changed contents of $dataMap permanently. This would probably be the best solution, since the script would only run once per map.
2b. If i went with 2, then a good question would be if i could alter all maps from the beginning of the game. Although i don't think that's possible since $dataMap doesn't hold the map's ID and $gameMap doesn't hold the events' command list.
PS: The "changed contents" are basically the same as before - no new events were added - just with extra commands in their command list.