Christoph

Villager
Member
Joined
May 24, 2019
Messages
9
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hi there,

I'm having a question that concerns Victor Saints VE_ActiveTimeBattle system. I wanted to include the feature to be able to switch between ATB ready characters by pressing "left" or "right".

I came quite far already, the only thing I'm missing is to (really) change the character. I can only manage to switch the character so that the new one steps forward, but the Actor command window (Window_ActorCommand) doesn't update.

So for example I'm having Char1 with skills named "Technique" and Char2 with skills named "Black Magic" and Char1 is ATB ready. I press my button to switch to Char2 who is also ready for input. He steps forward, but it still shoes "Technique" under skills. I of course get an error if I want to execute that. If I would only "Attack" it would work, since all characters use the same skill therefor.

Here is my code snipped that I inlcuded in Victors UpdateBattleManager function:


VictorEngine.ActiveTimeBattle.updateBattleManager = BattleManager.update;
BattleManager.update = function() {
VictorEngine.ActiveTimeBattle.updateBattleManager.call(this);
this.updateAtb();

//Start of my new code
if (this.actor()) {

if (Input.isTriggered('right')) {
SoundManager.playCursor();
currentActorID = this.actor()._actorId;
currentReadyActors = this.atbReadyActors();
currentMaxMembers = this._allAtbMembers.length;
var newCharacter;

//search for ATB ready character from current char till last char in party
for (var i = currentActorID; i < this._allAtbMembers.length; i++) {
if (this.isAtbReady(this._allAtbMembers)) {
newCharacter = this._allAtbMembers;
break;
}
}

//if no ATB ready character was found so far search from first char till current char in party
if (!newCharacter) {
for (var i = 0; i < currentActorID - 1; i++) {
if (this.isAtbReady(this._allAtbMembers)) {
newCharacter = this._allAtbMembers;
break;
}
}
}

//We found another ATB ready char (that is not the current one)
if (newCharacter) {
//That is the part of the code where I don't really know how to properly change the char right.
newCharacter.clearExpiredStates();
newCharacter.makeActions();
this.refreshStatus();
this.displayAtbStateMessages(newCharacter);
var index = $gameParty.members().indexOf(newCharacter);
if (index >= 0) {
AudioManager.playSe(VictorEngine.ActiveTimeBattle.ATBReadySound);
this.changeActor(index, 'inputting');
}

}

}

if (Input.isTriggered('left')) {
//insert second part of code after "right" works
}

}


};



Notes: I found out that there must either exist a function in Victors Scripts or in the base RPG Maker MV Scripts. I am actually also using Moghunters BattleHud and BattleCommand Plugin. But those don't interfere as far as I could figured out (I disabled the plugins and tried, but yet the same issues.
 

Christoph

Villager
Member
Joined
May 24, 2019
Messages
9
Reaction score
0
First Language
German
Primarily Uses
RMMV
Solved, didn't know Victor included the possibility to change between ATB ready characters by pressing the ESC button.
 

Latest Threads

Latest Posts

Latest Profile Posts

Jatopian wrote on war40k's profile.
What did you find for your plugin request?
Progress on my game for RSE is almost done! I should be able to release it next week.
Pfft! If other people would stop replying to threads, I could DOMINATE the Latest Posts box!
After so many hours of debugging, losing data to crashes, and slight adjustments.
BlackJack now deals cards perfectly! Time to adjust the background and implement the game logic so you can actually play it.BlackJack.png

Forum statistics

Threads
109,062
Messages
1,041,748
Members
141,555
Latest member
japanjacksin
Top