Are all variables equal to 0 by default?

Status
Not open for further replies.

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Hi everyone,

I wasn't sure where to put this, I hope this is where it belongs.

Anyway, I've noticed that when I write \V[anything] without actually setting the variable to anything I get 0 as text.

Does that mean that all variables are simply equal to 0 by default or is it simply used there to avoid errors?

Thanks!
 

dinhbat3

Veteran
Veteran
Joined
Feb 5, 2014
Messages
184
Reaction score
31
First Language
English
Primarily Uses
Yes all variables start at 0 until assigned. Similarly all switches start in the off position. You can check by pushing F9 during test play. That gives you all switch and variable values
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Thanks, great. This means I don't have to set all the variables to 0 at the start.

I also wish more tutorials mentioned the F9 thing... I'd have saved so much time. I guess I got some practice having to type \V[X] every time though  ;)

Anyway, feel free to close the thread.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
Be warned however, that there are scripts that change the variable value for the variables they're configured to use.


However, if that happens without your knowledge, then you forgot to configure the script causing this, so you'll have to hunt down which script it is and take care of its configuration description...
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
@CrazyCrab

Also, I think if you hold down the Control key, it disables ALL random encounters and lets you walk through walls.  This can be very helpful for debugging.
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Be warned however, that there are scripts that change the variable value for the variables they're configured to use.

However, if that happens without your knowledge, then you forgot to configure the script causing this, so you'll have to hunt down which script it is and take care of its configuration description...
It happened to me already, I didn't notice that Yanfly's message system uses 021 and 022 and I spend quite a while figuring it out - thanks for reminding me though  ;)

@CrazyCrab

Also, I think if you hold down the Control key, it disables ALL random encounters and lets you walk through walls.  This can be very helpful for debugging.
This will also be useful, thanks  :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top