"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
704
Reaction score
234
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
704
Reaction score
234
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

Made a brief video showcasing early game play... Got a copyright claim by BIG UP! (https://big-up.style/) for using music I bought from here (Future Steam Punk Pack). Now I wonder if I should strip any purchased music from here out of my game. :LZSskeptic:
Cleaned character animation and new room


I'm not sure if I should open a thread for this in games in development..
It's weird I actually have MORE work to do when stuck at home than before.
The No Travel Game Jam is here! Jump in to make a game in the month of April that takes place all in one town!

Forum statistics

Threads
95,473
Messages
929,424
Members
125,716
Latest member
DarkPatisserie
Top