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,373
Reaction score
1,548
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,373
Reaction score
1,548
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,373
Reaction score
1,548
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 Profile Posts

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,095
Members
132,260
Latest member
enciasduras
Top