RPG Maker Forums

Hey everyone,


I can't believe I'm stuck on this - I'm just trying to re-position enemies on the screen during a battle. I'm making a (trying to at least) a TBS plugin for RPGMMV, but I'm also brand new to the RPGM software (not to javascript though). Maps will have notetags that provide positions of the enemies in a troop, and you simply place a battle call in the map events. Here's a snippet of relevant code:


TBS.Param.EnemyPositions = [[8,1],[9,1],[10,1]]; //this is being correctly pulled from a notetag, included just to show structure

//Adjust enemy positions
TBS.Core.sceneBattle_start = Scene_Battle.prototype.start;
Scene_Battle.prototype.start = function() {
    TBS.Core.sceneBattle_start.call(this);
    this.positionEnemies();
};
Scene_Battle.prototype.positionEnemies = function(){
    for( var i=0; i<$gameTroop.members().length; i++  ){
        var newX = TBS.Param.EnemyPositions[0] * $gameMap.tileWidth();
        var newY = TBS.Param.EnemyPositions[1] * $gameMap.tileHeight();
        $gameTroop.members().positionMe(newX, newY);
    }
};
Game_Enemy.prototype.positionMe = function(x, y) {
    alert("Before: " + this._screenX + "," + this._screenY);
    this._screenX = x;
    this._screenY = y;
    alert("After: " + this._screenX + "," + this._screenY);
};


I'm not getting any errors and the alerts are showing that screenX and y have different (and correct) values before and after. However, the enemies are just staying in the same position they're in, in the troop window. At first I thought that a latter function in the battle scene was resetting them, but adding positionEnemies() to update() gave the same result. I'm guessing my reference point is just off. Any help would be appreciated.

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top