VARIABLES DON'T SEEM TO WANT TO WORK IN RMVX ACE FOR ME.

Posts

Pages: 1
I'm trying to create a control variable called "Rooms Visited" that is added when you enter a room for a game, and if a certain number of said control variables is met, the game is supposed to end. But it doesn't seem to work. Can you help me?
pianotm
The TM is for Totally Magical.
32388
Okay...let's start.

Create a common event named "Rooms visited", and set it to parallel process. In this common event, create a conditional branch that looks for that variable. For my example, we'll say 9.

@>Conditional Branch: Variable [0001:Rooms Visited] ==9

@>Game Over
@>
: Else
@>
: Branch End
@>


Simple enough.

Now in one of your rooms, create an event set to parallel process. Activate a control variable that adds one to your "Room Visited" variable. After the variable command, call your "Room Visited" common event. Turn on a self switch (if you don't, the variables will just add up infinitely) that turns the event to the second page. Copypasta this event to every room you want to have this effect in.

So, it should look like:

@>Control Variables: [001:Rooms Visited] +=1

@>Call Common Event: [001:Rooms Visited]
@>Control Self Switch: A=ON


The only problem with this, is that it won't add to the variable if you enter the room a second time.
author=pianotm
Okay...let's start.

Create a common event named "Rooms visited", and set it to parallel process. In this common event, create a conditional branch that looks for that variable. For my example, we'll say 9.

@>Conditional Branch: Variable [0001:Rooms Visited] ==9

@>Game Over
@>
: Else
@>
: Branch End
@>


Simple enough.

Now in one of your rooms, create an event set to parallel process. Activate a control variable that adds one to your "Room Visited" variable. After the variable command, call your "Room Visited" common event. Turn on a self switch (if you don't, the variables will just add up infinitely) that turns the event to the second page. Copypasta this event to every room you want to have this effect in.

So, it should look like:

@>Control Variables: [001:Rooms Visited] +=1

@>Call Common Event: [001:Rooms Visited]
@>Control Self Switch: A=ON


The only problem with this, is that it won't add to the variable if you enter the room a second time.


I tried something similar to that, but I guess I forgot a few things. Thank you. I'll try them.
author=pianotm
Okay...let's start.

Create a common event named "Rooms visited", and set it to parallel process. In this common event, create a conditional branch that looks for that variable. For my example, we'll say 9.

@>Conditional Branch: Variable [0001:Rooms Visited] ==9

@>Game Over
@>
: Else
@>
: Branch End
@>


Simple enough.

Now in one of your rooms, create an event set to parallel process. Activate a control variable that adds one to your "Room Visited" variable. After the variable command, call your "Room Visited" common event. Turn on a self switch (if you don't, the variables will just add up infinitely) that turns the event to the second page. Copypasta this event to every room you want to have this effect in.

So, it should look like:

@>Control Variables: [001:Rooms Visited] +=1

@>Call Common Event: [001:Rooms Visited]
@>Control Self Switch: A=ON


The only problem with this, is that it won't add to the variable if you enter the room a second time.


Do you need the variables switch in the conditions panel of the events window checkedmarked on?
pianotm
The TM is for Totally Magical.
32388
It's automatic for parallel process. Either make a switch for it and turn it on in your map event, or just tie it to a switch that turns on and stays on before exploration begins.

Parallel process needs to be on for both the common event and the map event, because the map event needs to be able to count, and then check the common event to see if it's reached the right number. If the common event isn't set to parallel process, it can't do that. Don't set it to autorun, though, because when your map event checks the common event, it'll stop all processes and wait for the variable to reach the designated number (infinite loop).

Just, whatever switch you put in your common event, make sure it's on.
author=pianotm
It's automatic for parallel process. Either make a switch for it and turn it on in your map event, or just tie it to a switch that turns on and stays on before exploration begins.

Parallel process needs to be on for both the common event and the map event, because the map event needs to be able to count, and then check the common event to see if it's reached the right number. If the common event isn't set to parallel process, it can't do that. Don't set it to autorun, though, because when your map event checks the common event, it'll stop all processes and wait for the variable to reach the designated number (infinite loop).

Just, whatever switch you put in your common event, make sure it's on.


Okay. Just to warn you, I don't quite understand variables yet, but it's needed for my game. So I'm just seeking help to clarify things.
Pianotm, it's not working. And you're being a little too vague, like do I need to set the second page to action button? Do I need to activate the variable checkbox? When I ask for help, I expect someone to be thorough in their tutorial or advice.

I have Autism, and unless I have all the details, I can't process the information properly to do what I need to do.
Marrend
Guardian of the Description Thread
21806
From what I'm understanding, the second page would be activated via Action Button, and would require Self-Switch A to be activated. Maybe screenshots would help? Now, granted, what I'm doing here is slightly different from what piano is suggesting, but, I'm mostly certain that it's essentially the same thing.

Page 1

Page 2


*Edit: Now, I could be wrong on this point, but, I believe it's possible to make the contents of Page 1 a Common Event, rather than just have the variable-check be a Common Event.

*Edit2: Though, I'm beginning to think that "Page 1" is to be called every single time players enter a room, not just the first time? It can be made to work like that, but, maybe, a bit of clarity on this point would be appreciated.
pianotm
The TM is for Totally Magical.
32388
Make a common event and name it whatever you want. I named mine "death". Leave it be for now.

While making your first map event, set it to parallel process. Make a death switch. Turn it on. Then make a variable. Set your variable as follows:



Call your common event. The event on the first map your character enters should look like this.



On every subsequent map, it should look like this.



This second event must be on every single map except the map you turned the switch on at.

Now, go to your common event and create a conditional branch. Set to variable. Select your death variable. Set the number that variable is equal to. In the top portion of the conditional branch, select game over. Set the common event to parallel process. It will ask you check a switch. Select the switch you created earlier. Your common event should look exactly like this.



Now, every time you enter a new room, it will add one to the counter. When it reaches the designated number, the character will die.
author=Marrend
From what I'm understanding, the second page would be activated via Action Button, and would require Self-Switch A to be activated. Maybe screenshots would help? Now, granted, what I'm doing here is slightly different from what piano is suggesting, but, I'm mostly certain that it's essentially the same thing.

Page 1

Page 2

You only have to enter the room once.


*Edit: Now, I could be wrong on this point, but, I believe it's possible to make the contents of Page 1 a Common Event, rather than just have the variable-check be a Common Event.

*Edit2: Though, I'm beginning to think that "Page 1" is to be called every single time players enter a room, not just the first time? It can be made to work like that, but, maybe, a bit of clarity on this point would be appreciated.
Marrend
Guardian of the Description Thread
21806
...Er, did you mean to make a comment after quoting me?

*Edit: Such as "This works, thanks a bunch!" or... something?
author=Marrend
...Er, did you mean to make a comment after quoting me?

*Edit: Such as "This works, thanks a bunch!" or... something?


No, Marrend.

And I'm trying what Piano suggested, even the screen shots, and it still doesn't work...
author=pianotm
Make a common event and name it whatever you want. I named mine "death". Leave it be for now.

While making your first map event, set it to parallel process. Make a death switch. Turn it on. Then make a variable. Set your variable as follows:



Call your common event. The event on the first map your character enters should look like this.



On every subsequent map, it should look like this.



This second event must be on every single map except the map you turned the switch on at.

Now, go to your common event and create a conditional branch. Set to variable. Select your death variable. Set the number that variable is equal to. In the top portion of the conditional branch, select game over. Set the common event to parallel process. It will ask you check a switch. Select the switch you created earlier. Your common event should look exactly like this.



Now, every time you enter a new room, it will add one to the counter. When it reaches the designated number, the character will die.


It's not working.
Marrend I tried the common event thing. It won't fucking work.
Marrend
Guardian of the Description Thread
21806
Still not working at all? That's interesting.

It might be time to do some debugging. What I suggest is to press F9 during a test-play after each time you enter a room. With that, you can view a list of switches and variables. You should be able to check if the variable in question is incrementing (ie: going up). If it is not, keep track of what map it is. You might want to use the map's display name as part of this process.

Though, I'm pretty sure that both of our suggestions thus far concerns going into a room players have yet to visit. Thus, you might want to have some kind of table set up of what rooms exist in the game, and whither or not the variable incremented when it was visited for the first time.

*Edit: This might be an absurdly dumb question, but, there... is a copy of this event in each room players can visit?
pianotm
The TM is for Totally Magical.
32388
Have you set everything to parallel process?

Marrend
*Edit: This might be an absurdly dumb question, but, there... is a copy of this event in each room players can visit?
This thread is now closed due to being solved. A friend of mine on Steam helped.

The map events have to be made Autorun, while the common event must be blank.

Common Event: No Trigger
@> Control Variables += 1
@> Conditional Branch: Variables == 22
@> //Set end dialogue here
@>
@> Else
@>

Map Event:
1st Page: Autorun, (Control Switch, if any) = ON
@> Call Common Event
@> Control Self Switch: A = ON

2nd Page: Action Button, (Control Switch, if any) = ON, Self Switch A = ON
@>
pianotm
The TM is for Totally Magical.
32388
Glad you figured out a method!
author=pianotm
Glad you figured out a method!


But I thank you both for trying to help.
Pages: 1