garret95

Pokémon Breeder
Member
Joined
Mar 15, 2017
Messages
17
Reaction score
4
First Language
Spanish
Primarily Uses
RMMV
I'm using Yanfly's Skill Core, and I've created a pretty neat concept for some skills that need a switch to be on to use them.

JavaScript:
<Custom Requirement>
if $gameSwitches.value[122] == true {
  value = true; // enable skill
} else {
  value = false; // disable skill
}
</Custom Requirement>

I though that would work but gives me an error... What am I doing wrong? Is it even possible with switches or should I use variables instead?
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
623
Reaction score
837
First Language
German
Primarily Uses
RMMV
use ( ) instead of [ ]

Like this:

<Custom Requirement>
if ($gameSwitches.value(122) == true) {
value = true; // enable skill
} else {
value = false; // disable skill
}
</Custom Requirement>
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,759
Reaction score
2,108
First Language
EN
Primarily Uses
RMMZ
Also, you need brackets around the entire condition (details here: link), i.e.

<Custom Requirement> if ($gameSwitches.value(122) === true) { value = true; } else { value = false; } </Custom Requirement>
Since $gameSwitches.value should always return true or false, this can be written more concisely:

<Custom Requirement> value = $gameSwitches.value(122); </Custom Requirement>
 

garret95

Pokémon Breeder
Member
Joined
Mar 15, 2017
Messages
17
Reaction score
4
First Language
Spanish
Primarily Uses
RMMV
Well would you look at that, it just works. Looks like someone (me) needs to start learning some javascript. Thank you Scorchedground, and thank you again caethyril!
 

Latest Threads

Latest Profile Posts

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.
finally got footage of my main character running around the main hub world. I've fixed a few things tho even since this video unsurprisingly lol.
 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd

Forum statistics

Threads
115,228
Messages
1,088,246
Members
149,822
Latest member
ddkovi
Top