"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
725
Reaction score
258
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
725
Reaction score
258
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

The new intro Logo for my videos.

I speed it up, the one I use to use was to long.
The workweek is now over. Now I can work on my GamZzzzzZzzzzZzzzZzzZz....
Just watched Onward with the family. One of the best movies I've ever seen. <3
2 hours & 20 minutes remaining. :D
...trying to hurry finish up all commissions before I never put the controller down again ;)

Forum statistics

Threads
95,824
Messages
932,206
Members
126,258
Latest member
kimimartin
Top