Enemy Default State
EnemyDefaultState - 2018/03/27Creator 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
https://kek.gg/i/5T_Dd2.png
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.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
本贴来自国际rpgmaker官方论坛作者:ovate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/enemy-default-state.96155/
页:
[1]