"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
705
Reaction score
240
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
705
Reaction score
240
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

Ami
4 days im not using my laptop to waiting someone to reinstall (sigh)
Stream will be live shortly with some Donkey Kong 64! Feel free to drop by!
Working on a test Boss for the new No Travel Game Jam
- Name Plugin by Moghunter -
Free RPG Maker Ready Charging Up Animation

Enjoy -No Credit Needed But Appreciated -
Download it at https://lvgames.itch.io/free-charging-up-pixel-animation-fx-rpg-maker-ready
:/ .... so, thought I’d go to the park to sit in the cool breeze and get out of the house a little. Nope, guess that’s quarantined too. Ok...

Forum statistics

Threads
95,486
Messages
929,522
Members
125,733
Latest member
whypzk
Top