Is it possible to access a plugins variable or function from within a conditional branch in the event that is running the plugin?
I am hacking the ABS alpha systen, trying to get an enemy bot's state? In the addons code there is a variable that tracks the bot's state:
Game_AIBot.prototype._changeState = function(newState) {
this._absParams.state = newState;
switch(newState) {
case 'free' :
this._absParams.target = null;
this._restoreMoveData();
this._moveSpeed += this.battler().ABSParams().moveSpeedUpKoef;
break;
case 'battle' :
if(this._absParams.regenTimer) {
this._absParams.regenTimer.reset();
}
this._onBattleStart();
this._changeActionState('approach'); //преследую цель!
break;
case 'return' :
this._deactivate();
LOG.p("AI : Return to " + this._absParams.myHomePosition.toString());
break;
case 'search':
this._restoreMoveData();
LOG.p("AI : Curious! I'am searching...");
if(!this._absParams.behavior.noEmote) this.requestBalloon(2);
break;
case 'dead' :
this._moveType = 0;
var key = [$gameMap.mapId(), this.eventId(), Consts.PARAMS.DEAD_SWITCH];
$gameSelfSwitches.setValue(key, true);
this._originalDirection = -1;
this._originalPattern = -1;
this.refresh();
this._deactivate();
break;
case 'stun':
//this.interruptCast();
this._resetTarget();
this._moveType = 0; //Stop
this._moveFrequency = this._absParams.moveData.moveFrequency;
LOG.p("AI : I'am stunned!");
if(!this._absParams.behavior.noEmote) this.requestBalloon(10);
break;
so in rpg maker mv, i try to use a script if conditional branch like this:
if this._absParams.state=='dead'
i get an error that is undefined
How can I access it?