Group: Local Mod
Type: Event Designer
RM Skill: Masterful
Rev Points: 90
I am having a bit of an issue with a common event I'm working with...several actually but they all do basically the same thing.
What happens is I have different items 'recipes' that each call a unique common event and set a variable to a specific number. This part works fine on it's own.
The problem is that I'm using that variable in an autorun event to determine which recipe you are choosing to cook. In theory this should work, I have the conditional branches set up just fine and they work if I manually change the variable. The problem is that the event is not giving me enough time to allow the variable to change when the item is used.
What I do is have the game call the menu, after telling the player to choose a recipe. At that point the player will go into the menu and use a recipe. All works great so far. Next there is a series of conditional branches depending on which of the six recipes were chosen, also one for a '0' on the variable, if the player exited without choosing anything, which repeats the process.
What I'm running into is that the variable does not change immediately, instead it acts as variable = 0 and repeats, now if you choose not to do anything this time or even if you do it then acts as the choice you made the first time. I.E variable = 1, even if you chose nothing or chose a new recipe like variable = 6.
So basically there seems to be a delay on the common event activating. Now I tried this again on a map without the auto run event and checked the variables, each item worked as intended and changed it immediately, so I assume it's something to do with the autorun event itself, also I have tried to use a 'wait' in a variety of places, all with no results.
Any suggestions, or just a new perspective to look at it would be a great help.
RM Skill: Undisclosed
The "autorun" feature is really buggy, so I'd recommend you use something else to call the event to start (for example, instead of using autorun, you could make it so that the event begins if the character is moved in any direction - just to get the event started right off). As long as it begins when you want it to, it is unnecessary to use the autorun feature (which does work in many cases, but you usually have to debug until you realise what specific thing you are doing that makes it not work).
Either way, it is simpler for me personally when I don't use the autorun feature and instead just use a simple statement like "if player moves in any direction then begin this event". Of course, I used RMXP and I haven't used it in a long while, so... there might be a solution to the problem that is just as easy.