Oh, use a conditional branch. Great idea.
I've updated my event extension script to check and evaluate the conditional branch.
It's just basically copying command_111 over from Game_Interpreter and replacing "@param" with "param" and "@event_id" with "event_id" assuming you pass those in as arguments.
Everything should work fine because all it uses are event_id and command.params.
lol you decided to go with the need_refresh = true everywhere.
I'm still looking around to see if there's a way for me to avoid that!
QUOTE
since this script can't be run during battle
I've added battle condition support.
But it's a little rough because of the default code running this check first:
CODE
if !c.turn_ending && !c.turn_valid && !c.enemy_valid && !c.actor_valid && !c.switch_valid
return false # Conditions not set: not executed
end
So I basically copied some code just to take out that particular check.
QUOTE
and second being the direction of the player/event, because it would take too much processing to reset the event's page every time the player turns.
What about the player/event's current position?
Very often do people use things like
CODE
store player X in var 1
store player Y in var 2
if var 1 == n
if var 2 == m
do this
So we should update everytime the player moves.
In order to prevent refreshing too many events, maybe instead of refreshing all events, we just refresh a certain set of events using memoization or some other technique to remember which events should be refreshed at certain points in time.
Anything that doesn't need to be updated all the time should be stored in a separate set that will only be refreshed when an additional flag is set. In the best scenario, everytime you move, you are only refreshing one or two events rather than 10-20 (including all transfers and any parallel events currently running on the map in the background, etc)
This post has been edited by Tsukihime: May 27 2012, 06:28 PM