Syntax for switches in the damage formula

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
16
Reaction score
1
First Language
German
Primarily Uses
RMMV
So i want to make a skill that halves the current HP of an enemy.
However this would be extremly overpowerd in a bossfight, so the formula will check if the battle is a bossfight

I've created a switch that is on when the party is facing a boss
But the formula i've come up with doesn't work

$gameSwitches.value(9) ? a.atk * 2 - b.def : b.hp \ 2

When looking in the console it says there is a syntax error
Any ideas what to write instead?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,933
First Language
English
Primarily Uses
RMMV
Try
Code:
$gameSwitches.value(9) === true
for your condition instead.
 

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
16
Reaction score
1
First Language
German
Primarily Uses
RMMV
How exactly?^^'
Tried it like this, but that also doesn't work

$gameSwitches.value(9) === true ? a.atk * 2 - b.def : b.hp \ 2
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,933
First Language
English
Primarily Uses
RMMV
You've used the wrong slash for your division. Should be b.hp / 2
 

Whirlnado

Villager
Member
Joined
Feb 10, 2018
Messages
16
Reaction score
1
First Language
German
Primarily Uses
RMMV
Thanks now it works :)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,933
First Language
English
Primarily Uses
RMMV
Just verified as well that just $gameSwitches.value(9) is fine, you don't need the === true
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Hello folks, I'm an old member deciding to reenter the forum. Greetings :D
When a parent (of a less than adult aged child) is like
"Oh, I'm like a friend to my child. We're friends."
I'm like
"Oh, that kid's gonna suck...."
Baby tiger gets a belly rub! ^.^
Ami
--- Friendship System ---

(F.Mage and F.Healer's FP is 100)
F.Mage: We did it! we can beat the monster easily!
F.Healer: With the Friendship System,we got stronger thanks to you F.Mage (Hugging)
F.Mage: (Blushing) Ahh...don't say like that. we are Best Friend Forever.
(In Distand)
M.Mage: They look happy...
M.Healer: Yeah...always like that...

Forum statistics

Threads
103,286
Messages
998,593
Members
134,796
Latest member
CotE
Top