Help to Modify the Eval Script Code

rechronicle

Mystvaldia
Veteran
Joined
Oct 30, 2013
Messages
137
Reaction score
108
First Language
Bahasa
Primarily Uses
RMMV
Can anyone modify this to get the array index from start to finish, and then back to start again? (ex: 0, 1, 2, 0, 1, 2, 0, 1, etc)

<After Eval>
var old = #
// Change # to the skill's required state
var newstate = $dataEnemies[user._enemyId].meta.states.split(',').map(function(n){return parseInt(n)});
// Reads the allowed state values from the enemy notetag
var index = Math.randomInt(newstate.length);
var choice = newstate[index]
if (user.isStateAffected(choice)) {
} else {
BattleManager._subject.removeState(old);
BattleManager._subject.addState(choice);
}
</After Eval>

Original script:

I already tried to write it out myself, but my intelligence is not enough as of now. -_-
Thanks!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm streaming @jasonzeno 's game called Moonfall
I've been trying out Fell Seal: Arbiter's Mark, and it has an interesting approach to consumable items - you get a limited inventory that is automatically refreshed to max limits (1 or 2 each, craft to expand + improve effect) at the start of each combat. It's a mechanic that goes against the common urge to hoard consumables.
Degica has discounts on Humble for games and older Makers. I don't know which A-train to choose. :-D

Forum statistics

Threads
103,194
Messages
997,931
Members
134,669
Latest member
Brownbeard_thePirate
Top