Enemy Default State

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
531
Reaction score
866
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
166
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

Stream will be going live early today as I will be working on some music before I transition to art! When I switch to art, I will be focusing on making a new stream avatar~ Feel free to drop by!
For anyone who has uploaded a game to Steam and wonders if they actually check your game's build when you first upload it, I can personally vouch for Steam.
6 more towns to make in my game. SIX. not done with interiors yet but SIX EXTERIORS.
what to do when you come across a person that has stated "What if I say, f*** their EULA? I could probably get away with it." concerning asset packs sold here... on this site ...
So a guy enters in a bar and walks up to the counter. He looks the bartender with a mysterious look and asks him...

Forum statistics

Threads
93,496
Messages
913,008
Members
123,031
Latest member
yasukun55
Top