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

Ok i got the model New and I will develop a little more, I think my SV is not beautiful yet.
"I, Giorno Giovanna, have a dream". In all seriousness, spatial BGM feature is now complete for my audio plugin.
Stream will be live shortly with some game development followed by the return of the Interactive Text Adventure after a short hiatus! Feel free to drop by!
Lately, I've taken to smashing random nouns/verbs together as insults. It's sort of amusing how many people don't really know how to respond to that. You bottle shaker!
Would be nice to pick color code that is not exclusively for message event

Forum statistics

Threads
103,243
Messages
998,318
Members
134,734
Latest member
Avaross
Top