"For" loop used for switches in battle

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
155
Reaction score
29
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
666
Reaction score
196
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
155
Reaction score
29
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
666
Reaction score
196
First Language
Javascript
Primarily Uses
RMMV
Last edited:

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
155
Reaction score
29
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
155
Reaction score
29
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

People in Italy panicking for this stupid coronavirus, it's nothing more than a flu and they are all acting like it's the black plague...
Blech. I hate coming up with stories. Making gameplay is fun but coming up with lore and reasons for these areas/mechanics just makes me sleepy.
40 card deck size, the plugin seems more sluggish.
Village theme I composed for a commission!

Forum statistics

Threads
94,567
Messages
921,939
Members
124,430
Latest member
Venator123
Top