LazESigma

Veteran
Veteran
Joined
Nov 9, 2013
Messages
50
Reaction score
2
First Language
English
Primarily Uses
Very surprised I haven't see this question yet.
I've mostly seen the answer to how to use SetValue in a script to set a switch to true or false.

I want to check if my switch (ID = 269) is ON.

This doesn't seem to work.

if ($gameSwitches.Value[269])
{
//code if switch 269 is ON
}

What is the correct way write an IF command using the $gameSwitches?
Thanks!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
603
First Language
English
Primarily Uses
RMMV
PHP:
$gameSwitches.value(269)

You'll find that value is a function, not an array/object. Also value needs to be lowercase. Your thing is returning undefined.

I just learned that using the console to auto type it.

Don't worry. It happens to the best of us.
 

LazESigma

Veteran
Veteran
Joined
Nov 9, 2013
Messages
50
Reaction score
2
First Language
English
Primarily Uses
Thanks mogwai, that is indeed the case. :)
//facepalm
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm still undecided weather or not I should add minor swearing to my game. Like I'm going for an all ages demographic... but the idea of a cartoon character saying dammit, hell, or crap in normal conversation is really funny to me.
If we assume an Elf's strong suit is Dexterity (AGI) & Intellect (MAT), I imagine Strength (ATK) & Constitution (DEF) would be among their lowest stats. But I'm having a hard deciding which should be lower, Strength or Constitution?
I'm really sorry to have to do this, but I'm going to have to start blocking those who repeatedly put up sexual content and offer absolutely nothing (that I've seen) related to what this community is supposedly created for.
Don't take it personal. I'm a rape victim with permanent injuries who can never enjoy 'it' ever again, so it's the last thing I want to have put in my face. :(
Check out my side project! It's a survival dungeon crawler! https://voidmoon-studio.itch.io/depths-of-delmora
RushLog wrote on HarlekinLehl's profile.
how do you attach those images to your posts?

Forum statistics

Threads
123,215
Messages
1,154,971
Members
161,596
Latest member
LilCronch
Top