Enemy Default State

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
632
Reaction score
1,070
First Language
English
Primarily Uses
N/A
EnemyDefaultState - 2018/03/27

Creator name: kido0617

Overview
Set default state for enemies

Features
- If you put <defaultState:4> in enemy's Note field, 4th state is given by default.
- For more than one states, <defaultState:4,5> separate state # with a comma.
- Short code

Preview


Code:
/*---------------------------------------------------------------------------*
 * 2018/03/27 kido0617
 * http://kido0617.github.io/
 * Ver.1.0
 * Public Domain
 * Please use freely, credit not necessary
 *---------------------------------------------------------------------------*/

/*:
 * @plugindesc Default state for enemy
 * @author kido0617
 * @help
 * If you put <defaultState:4> in enemy's Note field, 4th state is given by default.
 * For more than one states, <defaultState:4,5> separate state # with a comma.
 */

(function(){

  var _setup = Game_Enemy.prototype.setup;
  Game_Enemy.prototype.setup = function(enemyId, x, y) {
    _setup.call(this, enemyId, x, y);
    var meta = this.enemy().meta;
    if(!meta.defaultState) return;
    var states = meta.defaultState.split(",");
    for(var i = 0 ; i < states.length; i++){
      var id = parseInt(states[i].trim());
      this.addState(id);
      this.clearResult();
    }
  };

})();
Credit and Thanks: kido0617

Terms of Use- Free for commercial and non-commercial use.

License - Public Domain

You can download js file from the thread attachment or Dropbox link: https://www.dropbox.com/s/stsrigxmjvz9gfc/EnemyDefaultState.js?dl=1
 

Attachments

Last edited:
  • Like
Reactions: Val

Val

Veteran
Veteran
Joined
Oct 12, 2015
Messages
281
Reaction score
168
First Language
Français
Primarily Uses
Wow ! Nice little feature that could add some depth to any combat with preset and default strategy without losing some turn in battle.
 

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

Latest Threads

Latest Profile Posts

Brioche with a crème patissiere filling is so tasty!
A group of Game creators and others who trying to revive the Feel of Multiplayer and TOWN/ROLEPLAY games
Wow, lots of RPG Maker MV stuff on sale on Steam for 50%-75% off. Steam, why you not tell me?!
looking for help on top secret project
The nick "Toeuia" that I'm using comes from a, idk, you okay the chess game while chit chatting them. The first two are students. Then you know, finally, the champion, and then the champion's sensei. I played like this so many times until suddenly there's another chess master. Very naive but super smart. After he lost, he kinda advised me not to give up on chest. Because the next one was never seen beaten. Touya.

Forum statistics

Threads
99,380
Messages
964,646
Members
131,001
Latest member
funland
Top