- 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.
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.