ok sry wenn die frage undeutlich formuliert ist, ich denke ich muss erstmal genauer erklären worum s geht.
Also ich nutze das SRPG Engine Plugin (rpg mv) ,und habe ein zusatz Plugin(SRPG:_MapForceAction.js) gebaut um die "forceAction" funktion ohne "SV Kampf" nachzubauen.
-SRPG Engine ist das "core" plugin und es gibt neben anderen SRPG_Plugins noch das "MapBattle_Plugin".Dieses "MapBattle_Plugin"sorgt dafür,das man auf der Karte dierekt kämpfen kann ohne einen SV kampf zu nutzen.
Die "normale-forceAction", funktioniert nur im "SV Kampf" ,darum muss ich eine Funktion nutzen die ausserhalb von meinem neuen Plugin(SRPG:_MapForceAction.js) existiert. diese Funktion heißt:
"Scene_Map.prototype.srpgBattleStart(user, target)" und wird von meinem Plugin mit "_sceneMapProto.srpgBattleStart.call(this, user, target)" angelöst.
Mein Plugin nutzt 3 Scriptcalls ,jeder dieser Scriptcalls löst über umwege "Scene_Map.prototype.srpgBattleStart(user, target)" aus.
Das Problem bei der Sache ist folgendes.:
-sobald die "battleMap" startet muss die erste "MapBattle"-Aktion die ausgeführt wird,von meinem Plugin kommen,ansonsten funktionieren meine 3 ScriptCalls nicht.
-darum löst einer der 3 Scriptcalls eine "selbstAktion" bei der letzten Einheit auf der karte aus.Diese "selbstAktion" bewirkt nichts und erfüllt soweit den Zweck,das die anderen Scriptcalls später funktionieren.
=> falls eine andere Einheit vorher eine "mapBattle-Aktion" starten würde, würden meine Scriptcalls den " mapBattle"-Kampf nicht mehr auslösen (=buged)
Ich habe fast kein JS Kenntnisse und habe meine Plugins nur durch viel "testen bis es klappt" zustandegebracht^^
Ich glaube mein Plugin muss diese "mapBattle-Aktion" einmal am anfang nutzen um meinem Plugin die korrekten daten zu geben damit der "MapBattle-Kampf" in zukunft korrekt ausgelöst wird.Ich hoffe das es auch einen anderen Weg gibt meinem Plugin diese daten zu verschaffen (ohne eine extra Action auslösen zu müssen).
-Momentan führt meine Alternativ Lösung dazu,das am anfang jeder "BattleMap" eine verzögerung entsteht und dazugehörige Phasen ausgelöst werden, was ich gern vermeiden würde.
Folgendes Zitat hat das Plugin mit Code zur Ansicht.
Zur not könnte ich auch beispiel videos drehen und hier posten um zu zeigen wie das ganze abläuft,falls das was nützt.
(sry ich wollte das Zitat in einen Spoiler packen,finde aber die Spoiler Funktion hier nicht)
-> es gibt auch eine Demo wo man das alles selber testen könnte hier
(Im meinem "Signature Spoiler" dort)
- //=============================================================================
- // SRPG_MapForceAction.js
- //=============================================================================
- /*:
- * @plugindesc v1.0 Adds <SRPG_MapForceAction> ScritCall to SRPG
- * @author dopan
- *
- *
- *
- *
- *
- *
- * @param Blank_Skill ID
- * @desc Skill ID: ID of the Blank Skill that is used in the "this.isCreateMapForceAction();"-ScriptCall
- * @type skill
- * @default 1
- *
- *
- *
- * @help
- *
- * This Plugin helps to replicate the "force Action" Function for skills in: MapBattle"True" BattleMode.
- * the Plugin ScriptCall will activate a "force Action" on Map without using "SV battleMode"
- * Note: the Plugin is still experimental pls report any Bugs or Issues u might find.
- *
- * -> the "SkillAction" from this ScriptCall, wont work with a Skill that uses "minRange" or if,
- * the Target is Outside of SkillRange from the User-position.It will also trigger Counters,
- * if the added Skill would do that (ignoring range on counters).
- *
- *
- *
- * Plugin Scriptcalls:
- *---------------------
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * - "this.isMapForceAction(userId, targetId, skillId, payCost);"
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * Example : "this.isMapForceAction(9, 28, 1, true);"
- *
- * => this will forceAction, with "user"(event id 9 ),"target"(event id 28 ),using "Skill 1" with "PayCost"= true
- *
- * => there is an Example for this in the Updated-SRPG_demo
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * - "this.isMapForceActionNote(userId, targetId, skillId, payCost);
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * Example : "this.isMapForceAction(9, 28, 1, false);"
- *
- * => this will add a second attack if used in a Custom Ex SkillNoteTag ,..
- * .. with "user"(event id 9 ),"target"(event id 28 ),using "Skill 1" with "PayCost"= false
- *
- * => I advive to use the Following ScriptCall instead of using numbers on "user" and "target":
- *
- * var user = $gameTemp.activeEvent().eventId();
- * var target = $gameTemp.targetEvent().eventId();
- *
- * this.isMapForceActionNote(user, target, 11, false); // Skill 11 as another example
- *
- * => However this can be used in different ways it will add the Action but without a battlestart,...
- * ..so the action will happen as soon there is a battlestart.
- *
- * => there is an Example for this in the Updated-SRPG_demo
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * - "this.isCreateMapForceAction();"
- *-------------------------------------------------------------------------------------------------------
- *-------------------------------------------------------------------------------------------------------
- * => use this Scriptcall one time at the Start of a battle. Its a not very elegant walkaround,
- * that should make the other Scriptcalls work properly and must be used till i found a better solution.
- *
- * => this make sure that the First action that happens is an action from this plugin,i dont know exactly why,
- * but this has to happen in order to let the "Scene_Map.prototype;" of this Plugin work properly..
- *
- * => there is an Example for this in the Updated-SRPG_demo
- *
- *
- *
- * Known Issue:
- * -> 1 Action from this Plugin Must happen at battleMap start, that means there will be a delay,
- * and a pre&post Action Phase.. This issue is nothing gamebreaking and can be handled ,
- * but i will try to find a better solution in the Future..
- * ( at this moment i just dont know enough about JS and "Scene_Map.prototype;" to solve it properly.)
- *
- *
- * ============================================================================
- * Terms of Use
- * ============================================================================
- * Free for any commercial or non-commercial project!
- * (edits are allowed but pls dont claim it as yours without Credits.thx)
- * ============================================================================
- * Changelog
- * ============================================================================
- * Version 1.0:
- * - first Release 01.09.2020 for SRPG (rpg mv)!
- */
- (function() {
- // Plugin param Variables:
- var parameters = $plugins.filter(function (plugin) { return plugin.description.contains('SRPG_MapForceAction'); });
- var parameters = PluginManager.parameters("SRPG_MapForceAction");
- var _blankSkill = Number(parameters['Blank_Skill ID'] || 0);
- var _mapForceUserNote = 1 || userNoteId;
- var _mapForceTargetNote = 1 || targetNoteId;
- var _mapForceSkillNote = 1 || skillNoteId;
- var _mapForceUser = 1 || userId;
- var _mapForceTarget = 1 || targetId;
- var _mapForceSkill = 1 || skillId;
- var _mapForcePayCost = 'true' || 'false' || payCost;
- var _sceneMapProto = Scene_Map.prototype;
- //-----------------------------------------------------------------------------------------
- //Plugin ScriptCalls:
- //"this.isMapForceAction(userId, targetId, skillId, payCost);"
- Game_Interpreter.prototype.isMapForceAction = function(userId, targetId, skillId, payCost) {
- _mapForceUser = userId;
- _mapForceTarget = targetId;
- _mapForceSkill = skillId;
- _mapForcePayCost = payCost;
- _sceneMapProto.srpgMapForceAction();
- };
- //"this.isMapForceActionNote(userId, targetId, skillId, payCost);"
- Game_Interpreter.prototype.isMapForceActionNote = function(userNoteId, targetNoteId, skillNoteId, payCost) {
- _mapForceUserNote = userNoteId;
- _mapForceTargetNote = targetNoteId;
- _mapForceSkillNote = skillNoteId;
- _mapForcePayCost = payCost;
- _sceneMapProto.srpgMapForceActionNote();
- };
- //"this.isCreateMapForceAction();"
- Game_Interpreter.prototype.isCreateMapForceAction = function() {
- _sceneMapProto.srpgCreateMapForceAction();
- };
- //Plugin Function:
- var _srpgCreateMapForceAction = Scene_Map.prototype.srpgCreateMapForceAction;
- Scene_Map.prototype.srpgCreateMapForceAction = function() {
- if ($gameSystem.isSRPGMode()) {
- var lastUnit = $gameSystem._EventToUnit.length - 1;
- var user = $gameSystem.EventToUnit(lastUnit);
- var target = $gameSystem.EventToUnit(lastUnit);
- if ((!user[1].isDead()) && (!target[1].isDead())) {
- $gameTemp.setActiveEvent($gameMap.event(lastUnit));
- $gameTemp.setTargetEvent($gameMap.event(lastUnit));
- $gameSystem.forceSRPGBattleMode('map');
- user[1].forceAction(_blankSkill, target[1]);
- $gameSystem.setSubBattlePhase('invoke_action');
- _sceneMapProto.srpgBattleStart.call(this, user, target);
- }
- }
- return true;
- };
- var _srpgMapForceAction = Scene_Map.prototype.srpgMapForceAction;
- Scene_Map.prototype.srpgMapForceAction = function() {
- if ($gameSystem.isSRPGMode()) {
- var user = $gameSystem.EventToUnit(_mapForceUser);
- var target = $gameSystem.EventToUnit(_mapForceTarget);
- if ((!user[1].isDead()) && (!target[1].isDead())) {
- $gameTemp.setActiveEvent($gameMap.event(_mapForceUser));
- $gameTemp.setTargetEvent($gameMap.event(_mapForceTarget));
- $gameTemp.setShouldPayCost(_mapForcePayCost);
- $gameSystem.forceSRPGBattleMode('map');
- user[1].forceAction(_mapForceSkill, target[1]);
- $gameSystem.setSubBattlePhase('invoke_action');
- _sceneMapProto.srpgBattleStart.call(this, user, target);
- }
- }
- return true;
- };
- var _srpgMapForceActionNote = Scene_Map.prototype.srpgMapForceActionNote;
- Scene_Map.prototype.srpgMapForceActionNote = function() {
- if ($gameSystem.isSRPGMode()) {
- var user = $gameSystem.EventToUnit(_mapForceUserNote);
- var target = $gameSystem.EventToUnit(_mapForceTargetNote);
- if ((!user[1].isDead()) && (!target[1].isDead())) {
- $gameTemp.setActiveEvent($gameMap.event(_mapForceUserNote));
- $gameTemp.setTargetEvent($gameMap.event(_mapForceTargetNote));
- $gameTemp.setShouldPayCost(_mapForcePayCost);
- $gameSystem.forceSRPGBattleMode('map');
- user[1].forceAction(_mapForceSkillNote, target[1]);
- _sceneMapProto.srpgBattleStart.call(this, user, target);
- }
- }
- return true;
- };
- //-----------------------------------------------------------------------------------------
- //-----------------------------------------------------------------------------------------
- //--End:
- })();