"For" loop used for switches in battle

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
160
Reaction score
30
First Language
Italian
Primarily Uses
RMMV
Hi, how to use the loop "for" for checking if my switches(21 to 29) are on in battle?

I'm doing interaction through elements for example:
turn 1 player use spell fire so switch fire ON
turn 2 player use spell Ice so switch ice ON

at the end of ice spell, IF fire or earth or (etc..) is ON AND comboFIRE/ICE switch is ON

DO additional damage,

it's simple as that but I have only little knowledge in javascript and still learning.

I'm using yanfly general battle condition(the first troop is a general common event for all battles)

what I can do instead eventing every single interaction of elements?

it's used the "for", right?

thanks
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
724
Reaction score
251
First Language
Javascript
Primarily Uses
RMMV
Hi, how to use "for" for checking if my switches(21 to 29) are on in battle?

I'm doing interaction through elements for example:
turn 1 player use spell fire so switch fire ON
turn 2 player use spell Ice so switch ice ON

at the end of ice spell, IF fire or earth or (etc..) is ON AND comboFIRE/ICE switch is ON

DO additional damage,

it's simple as that but I have only little knowledge in javascript and still learning.

I'm using yanfly general battle condition(the first troop is a general common event for all battles)

what I can do instead eventing every single interaction of elements?

it's used the "for", right?

thanks
Trying to loop through the events?

Edit:
Could you link the yanfly plugin your using?
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
160
Reaction score
30
First Language
Italian
Primarily Uses
RMMV
I knew was a loop, wrong citation.

the script is YEP_BaseTroopEvents
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
724
Reaction score
251
First Language
Javascript
Primarily Uses
RMMV
Last edited:

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
160
Reaction score
30
First Language
Italian
Primarily Uses
RMMV
not really what I want, but so cool, I need a simple version of logical sequences in which the battle recognize that the "stone enemy" has been hit by fire and the by ice, now the stone crack and receive extra damage.
that's all ^_^
I was wondering if this could be done via script,I think yes with switches or variable, but I must enter a sequence script loop that check the enemies states to check combos.

then if the stone enemy has been hit by fire last turn, now ice can deal extra damage.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
160
Reaction score
30
First Language
Italian
Primarily Uses
RMMV
$gameSwitches[P] physical
$gameSwitches[Ice]
$gameSwitches[F] Fire
$gameSwitches[W] Water
$gameSwitches[L] Life
$gameSwitches[Umbra]
$gameSwitches[H] Holy
$gameSwitches[V] Void
$gameVariables[ElementOrder](1 to 2) means if the switches are inverse( fire ice for 1, ice and fire for 2)

$gameSwitches[P] == ON && $gameSwitches[Ice] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[Ice] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[F] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[F] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[W] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[W] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[L] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[L] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[Umbra] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[Umbra] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[H] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[H] == ON && $gameVariables[ElementOrder] == 2
$gameSwitches[P] == ON && $gameSwitches[V] == ON && $gameVariables[ElementOrder] == 1
$gameSwitches[P] == ON && $gameSwitches[V] == ON && $gameVariables[ElementOrder] == 2


and so on for every other element, as you see it's really big.
How can I compact with function or something else?

Otherwise I must insert single check for every skills.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Ugh! I have a headache coming on--not sure if it's from the sudden change in weather or caffeine withdraw...only one way to fi d out--Coffee time!
Found this old picture in the plastic case with my medical documents. I don't remember who this character is (I draw a lot of original characters and forgot about them very soon), but I like the design, may be I'll add guy in my game.

reading what makes plugins tick, so you can use other plugins to trigger said plugin... setup up Luna MV to have my own custom ATB Gauges from Yanfly's ATB. cool
It's Easter on Monday. Anybody got any Easter quarantine eggs? It'll also be my birthday, I'll be 31.
Sometimes I feel like I'm using plugins feature the wrong way. But as long as it works tho.

Forum statistics

Threads
95,799
Messages
932,029
Members
126,221
Latest member
Tsume
Top