while working on rebuilding
SRPG_MapForceAction.js i think i figured out why mapbattle"True" triggers the PreAction phase after the effect of the action already happened..
(this happens in both Plugin the same way SRPG_Mapbattle.js & SRPG_MapForceAction.js)
its Because
"this.eventBeforeBattle();" has to be the last thing that happens in a "Scene_Map.prototype" without any other function in chain..
(similar to how "$gameTemp.reserveCommonEvent(ID)" waits for the end of the current working event or action chain to finish)
The SRPG_Core solves this with using a "if condition" in the
"Scene_Map.prototype.update = function() {" of the SRPG_Core,
in order to trigger the final Battle trigger..
(and the "this.eventBeforeBattle();" happens before that because its part of the Action chain that prepares the battle,..)
So i think it should be possible to immitate what the SRPG_Core does in order set the Pre Action Phase before the Action effect happens .. like it does in the SRPG_Core and in its SV battles..
long story short:
=> the point is that the
SRPG_Mapbattle.js uses
"this.srpgAddMapSkill" (2 times) in the "Scene_Map.prototype.srpgBattleStart"- function.
=> If we use something like
"this._callSrpgBattle = true;" instead,.. lets call it
"this._callSrpgMapBattle = true;" . than this should work!
("_callSrpgBattle" is triggered separately with the help of "Scene_Map.prototype.update = function() {" and "this._callSrpgMapBattle = true;" should be made the exact same way..)
This Edit wont solve my problem with Re-building
SRPG_MapForceAction.js.. but it would be an improvement of
SRPG_Mapbattle.js.
Im not sure if I am able to correctly make this edit myself, so i wanted to ask you first what you think about this idea?
=> in my Example the last Mapbattle trigger code which is put into the "Scene_Map.prototype.update = function() {"
would look like this:
JavaScript:
if (this._callSrpgMapBattle == true ) {
this._callSrpgMapBattle = false;
this.srpgAddMapSkill(action, user, target);
return;
};
=>
the only Problem is.. "this.srpgAddMapSkill
(action, user, target);"
..the data which is stored in the "()". perhaps this needs another "Scene_Map.prototype."Function, in order to have a
"this.isMapSkillTrigger();" which works with an empty array..
or to edit the "srpgAddMapSkill"-Fuction in order to only get triggered from the "Scene_Map.prototype.update = function() {" ?
=> or did i missunderstood something and that is not posssible to do at all ??
here some Images for better understanding :
SideNote: the other Function which i wanted to add is
"mapAction Text" which is basicly just a "Instant Common Event" or a
"$gameTemp.reserveCommonEvent(ID)" ,depending on what is needed ..
The TextBox will be put in the Common Event.There will be a Setup for this Common Event in the Next demo update.. it will work for all Skills.
(This CE is Part of the mapForceAction Plugin which im working on and could be put in Mapbattle.Js instead aswell..)
Instant Common Event: (example)
JavaScript:
// "this.isInstantCE(ceID);" // InstantCE
Game_Interpreter.prototype.isInstantCE = function(id) {
var commonEvent = $dataCommonEvents[id];
if (commonEvent) {
var eventId = this.isOnCurrentMap() ? this._eventId : 0;
this.setupChild(commonEvent.list, eventId);
}
};
At the moment i have connected "MapActionText" to the SRPG_Mapbattle.js with this small edit:
Spoiler: Info
(the code shown is only part of mapForceAction Plugin atm)
=> the "for" and "if" part is not needed with the right timing..
JavaScript:
// "this.srpgMapActionText();" // made to connect the Mapbattle plugin to this Function
var _srpgMapActionText = Scene_Map.prototype.srpgMapActionText;
Scene_Map.prototype.srpgMapActionText = function() {
for (_usedSkill = 1; _usedSkill <= $dataSkills.length; _usedSkill++) {
if (_usedSkill === $gameSystem.EventToUnit( $gameTemp.activeEvent().eventId() )[1]._actions[0]._item._itemId) {
$gameTemp.reserveCommonEvent(_usedCE);
}
}
};
And thats the mini edit in the Mapbattle Plugin:
=> if the SRPG_Mapbattle.js gets edited for the "preActionPhase".. than the "mapActionText" has to be placed somewhere else ,but thats the smallest problem here^^