[RMVX ACE] GAME IS IGNORING VARIABLES?
Posts
Pages:
1
So here's what's going on. I've got a dungeon where the team needs to split in two groups to use each member's unique skills to overcome the dungeon. It's pretty complicated but going OK so far.
Right now I'm working on the second room of the dungeon, and something that is working just fine in the first room is working only about 50% of the time in the second room. I have events going to track both the player's X/Y position and the X/Y of an event called 'NPC' representing which party isn't currently under the player control. Pressing SHIFT switches between the two groups, exchanging the X/Y of the group currently under control with the NPC group and altering the members of the party accordingly. Everything is working swimmingly until I tried to move on to the second room.
Now when you press the SHIFT button, more often than not, it returns the player to the same position as the NPC event, and vice versa. I have a debug script console open and I can see that the variables are changing as the player moves, but even though the variables are right, the game seems to be ignoring them and moves the player character back to the same space as the NPC team. This happens really unpredictably, and probably half of the time it works fine, just like it does in the first room.
I sat in the first room and switched characters fifteen or twenty times to be assured it wasn't going to happen in there, and it never did.
Really not sure what could be causing this, so I'm reaching out for help.
Right now I'm working on the second room of the dungeon, and something that is working just fine in the first room is working only about 50% of the time in the second room. I have events going to track both the player's X/Y position and the X/Y of an event called 'NPC' representing which party isn't currently under the player control. Pressing SHIFT switches between the two groups, exchanging the X/Y of the group currently under control with the NPC group and altering the members of the party accordingly. Everything is working swimmingly until I tried to move on to the second room.
Now when you press the SHIFT button, more often than not, it returns the player to the same position as the NPC event, and vice versa. I have a debug script console open and I can see that the variables are changing as the player moves, but even though the variables are right, the game seems to be ignoring them and moves the player character back to the same space as the NPC team. This happens really unpredictably, and probably half of the time it works fine, just like it does in the first room.
I sat in the first room and switched characters fifteen or twenty times to be assured it wasn't going to happen in there, and it never did.
Really not sure what could be causing this, so I'm reaching out for help.
Are you storing map ID of the events as well? Like, I figure both parties would not get to second map at the same time, and, maybe, that's part of what's messing things up?
It would still be useful to know (or see) exactly how this was coded, though.
It would still be useful to know (or see) exactly how this was coded, though.
It's set up so that all the puzzles have to be solved before the door to the next room opens, so both parties are counted as leaving the room if either of them can access the door. The plan was to have an event on each map to serve as the NPC party.
There's a parallel process event running that stores the Map ID into a variable. Before this I did have the problem that switching teams would move the player back to the first room but that isn't happening since adding the Map ID.
I can move the character around and see variables 23 and 24 changing, but it doesn't seem to matter.
There's a parallel process event running that stores the Map ID into a variable. Before this I did have the problem that switching teams would move the player back to the first room but that isn't happening since adding the Map ID.



I can move the character around and see variables 23 and 24 changing, but it doesn't seem to matter.
You need to track 3 variables like Marrend said.
X, Y, Map ID (Have these variables always be tracked as a common event that triggers at the start of the game.) These variables will change even after switching party members and will track you the entire game (Parallel Process with control switch 1.)
Then when you switch parties make new variables X2, Y2, MAPID2. This will store your constantly changing variables for when you switch back. (Make X1 = X2 and so on.) These will not change until you make the switch. I assume you can also use a common event that is called when you press a button. Are you using a script for buttons calling common events? Yanfly has one.
Pages:
1














