[RM2K3] VARIABLES AND CONDITIONAL BRANCHES

Posts

Pages: 1
I'm trying to create a day/night cycle in rm2k3 and I can't get a conditional branch to work based on a variable. They work based on a switch, I'm not sure why my variables aren't working. I'm probably doing something stupid, I just started trying this but I'm having trouble finding and info on my specific problem online.
Edit: I've been messing with it more and figured out that it's the variables that aren't totalling up. The conditional branches work off a switch but not a variable, and i can't get anything to trigger off a variable.

Does anyone know why the variables either wouldn't add up or wouldn't trigger anything?

I'm pretty new to this and everything I read online makes variables seem very simple. I'm not sure what I'm doing wrong.

I also can't get events to actually be below the characters, if I use any kind of icon they cannot step on it even if it is set to below characters. Any advice would be appreciated.
There's a day/night tutorial for 2k3 on here: https://rpgmaker.net/tutorials/352/
author=narcodis
There's a day/night tutorial for 2k3 on here: https://rpgmaker.net/tutorials/352/


Thank you, that's actually the one I used to make it. I left a comment on there as well explaining the issue I'm having in more detail.
author=Renegade_grenades
Edit: I've been messing with it more and figured out that it's the variables that aren't totalling up. The conditional branches work off a switch but not a variable, and i can't get anything to trigger off a variable.

Does anyone know why the variables either wouldn't add up or wouldn't trigger anything?


hi Renegade_grenades ❤️.

Apologies for the wait. If you can, do a print screen and share your code with us, this might help us figure out where the problem is.
The biggest problem I usually have when using variables, is forgetting to set/record the variable, before plugging them into the right conditions:

So you what you want to do is on the first page:
Insert>Control Variable> Single "Your Variable" Operation "Set" Operand "Constant" The number you want to set it to.

In this example, I set the variable to "0" so that on the next page...




...when the conditional branch looks for "0"
Insert>Conditional Branch>Variable is>Equal to>Fixed "0"
...it will play the next event under those conditions.



If setting your variable to a particular number still doesn't work,
let us know and someone more experienced will hopefully come along and help ya out.

But ya, see if you can post your work to with print screen/imgur etc, and we'll try and fix what's wrong.
author=LordBlueRouge
author=Renegade_grenades
Thank you for your thoughtful response. I'm trying something very simple in a test game to narrow down the problem. Here are some screenshots.




The goal is that once you get the milk from the cow, the milk variable increases from 0 to 1, and this should trigger the option to give the milk to the girl. I know I could do this with a switch, but I need the variables to function properly for a time system I want to set up.

From what I can tell, this simple code should work. But it isn't.
Dyluck
For thousands of years, I laid dormant. Who has disturbed my slumber?
5184
If page 2 of the girl isn't showing up at all, then page 3 is overriding it because page 3's condition has been satisfied.
author=Dyluck
If page 2 of the girl isn't showing up at all, then page 3 is overriding it because page 3's condition has been satisfied.
author=Dyluck
If page 2 of the girl isn't showing up at all, then page 3 is overriding it because page 3's condition has been satisfied.


I took your advice and tried it without page 3.






These are screenshots of absolutely everything that exists in my test game.
I stripped it down even further and removed anything that could have been affecting it, but it still isn't giving me the option to give her the milk after I get the milk from the cow. She just keeps saying hi even after I get the milk and the milk variable should be set to 1, which should trigger page 2, where I can give her the milk.

I've been doing a lot with switches in my main game, but I think that a lot more could be done with fewer lines of code if I could make a variable work.

I appreciate the help from everyone.
Dyluck
For thousands of years, I laid dormant. Who has disturbed my slumber?
5184
Use the text message command and hover over it see text codes you can use. Use the one to display variable to see what value it actually has at each stage. Something like:
/v[1]


-not sure how this was related to a day/night system, but did you maybe copy a system that is already automatically using variable #1? Have you tried using a different variable?
-try starting a new game/save file
-try starting a brand new rm2k3 project
Dyluck
For thousands of years, I laid dormant. Who has disturbed my slumber?
5184
Also, I just checked, and when you set a variable's value, the name should be shown. You have named it milk clearly, but it's not showing up on the red line when you set the variable. Can you show a screenshot of the actual variable being set in window?

Edit: Yeah you need to use "single" instead of "variable"
author=Dyluck
Also, I just checked, and when you set a variable's value, the name should be shown. You have named it milk clearly, but it's not showing up on the red line when you set the variable. Can you show a screenshot of the actual variable being set in window?

Edit: Yeah you need to use "single" instead of "variable"


This worked! Thank you
Pages: 1