MV SRPG Engine MV - Plugins for creating Tactical Battle System

EDIT 3 @ ALL

added 3 fixes to SRPG_UnitCore
- Fixed a none gamebreaking Issue on the EXP/Gold steal skills,
where they didnt trigger correctly if no gold or exp left

- Fixed the Issue on checking EquipSlots_itemId without checking first if the slot is existing.
i added the slot check in the same array as the id check and i am not sure if it needs to be in an extra array instead..


- Added a check to the Itemlist, that asks if "active unit" is existing, or else if "gameMenu actor" is existing..
and use whatever "actor data" is existing to store the actor data for the function.
@DunkyClassic
You should not need to remove any code..i am pretty sure this should solve both issues,which you mentioned, even if i am not sure where your error was triggered, or if any other plugin was affected in triggering this problem.
(by checking if the data is existing before storing or using it, this should solve any Issues with other plugins or Trigger-Situations which i didnt consider)

updated the github again
Wow, you work FAST. Thanks so much, Dopan!

I'll let you know if I run into anything weird, but I think with your new code I should be able to figure out any oddities that pop up from having fewer slots than normal on my own from here out. You're awesome man ^^
Wow, you work FAST. Thanks so much, Dopan!

I'll let you know if I run into anything weird, but I think with your new code I should be able to figure out any oddities that pop up from having fewer slots than normal on my own from here out. You're awesome man ^^
pls use the newest version of the SRPG_UnitCore, i just updated it again a few minutes ago..

while working on the "default resolution patch 816x624"
(another Version of shoukangs window plugin)
..,i recognized a gamebreaking typo mistake on the slot check, from the edit before..
@Shoukang how do you make a default effect like that of summon magic circle.. but instead of being a skill, it's a death effect? like when enemy unit dies, it leaves the magic circle in its spot that boost stat for 1 turn? is it possible to summon a chest where the enemy unit defeated is at, that the player can open with a password?

also there's the summon stone, its possible to make a path impassable too like 5 tile cross? in the demo therese is not a temporary unit, i thought the slime was an ally pet. how to summon ally pet (ally AI, you cannot control, their in autobattle) like attack dogs?

I'm so happy with the summon, Advance Wars features now possible!
After fixing the usual bugs that come alongside a big new addition of code, for some reason I'm still running into the same EventID problem as before. As soon as I click 'Equip' to view my actors inventory, it hard crashes.

Oof... I'm too tired for this. I'll keep bug fixing in the morning. here's the new, slightly different error message I got this time if anybody has ideas. xP

Imgur
After fixing the usual bugs that come alongside a big new addition of code, for some reason I'm still running into the same EventID problem as before. As soon as I click 'Equip' to view my actors inventory, it hard crashes.

Oof... I'm too tired for this. I'll keep bug fixing in the morning. here's the new, slightly different error message I got this time if anybody has ideas. xP

Imgur
old text
Spoiler
it seems that the system cant even ask if the data is existing, ..
so i will need to add conditions about the scene itself..

this happens because you go to another scene when using "equip" command.. there the active event cant be read

i cant replicate the bug myself, because i disabled any "equip command" & "menu equip command" in battle by default..
-this makes testing a bit difficult ..
( and again "imgur" imgs are displayed very small, its better to drag and drop the screenshot into a spoiler, or else people need to download your error img first, to be able to zoom in.. )
Spoiler
this isnt helpfull
Screenshot_1.png
edit github updated
about the "SRPG UnitCore" Plugin:
its fixed, i also fixed similar issues if going to the item Menu in battle
@Shoukang how do you make a default effect like that of summon magic circle.. but instead of being a skill, it's a death effect? like when enemy unit dies, it leaves the magic circle in its spot that boost stat for 1 turn? is it possible to summon a chest where the enemy unit defeated is at, that the player can open with a password?

also there's the summon stone, its possible to make a path impassable too like 5 tile cross? in the demo therese is not a temporary unit, i thought the slime was an ally pet. how to summon ally pet (ally AI, you cannot control, their in autobattle) like attack dogs?

I'm so happy with the summon, Advance Wars features now possible!
I'm pretty sure you can do that with my summon functions. However I'm traveling now so I can't try it myself. The function that handles battler death(erase event, change number of existing battler, etc) is
Scene_Map.prototype.srpgBattlerDeadAfterBattle
I overwritten this function in AoE Animation plugin. In that function, you can call my summon function after a death check. Instead of using 'this.summon(...)' (Scene_Map is not a game interpreter), use '$gameMap._interpreter.summon(...)'
Let me know if it works!

I think summon a row of stone is possible but I just found some issue with aoe summon. The cell Target note tag doesn't work with aoe so I need to fix it after I'm back.

To summon ally pet just create an actor with auto battle flag. The summoned Therese won"t expire but she will disappear after battle.
I'm pretty sure you can do that with my summon functions. However I'm traveling now so I can't try it myself. The function that handles battler death(erase event, change number of existing battler, etc) is
Scene_Map.prototype.srpgBattlerDeadAfterBattle
I overwritten this function in AoE Animation plugin. In that function, you can call my summon function after a death check. Instead of using 'this.summon(...)' (Scene_Map is not a game interpreter), use '$gameMap._interpreter.summon(...)'
Let me know if it works!

I think summon a row of stone is possible but I just found some issue with aoe summon. The cell Target note tag doesn't work with aoe so I need to fix it after I'm back.

To summon ally pet just create an actor with auto battle flag. The summoned Therese won"t expire but she will disappear after battle.
OMG it works! thank you very much.. i tested killing 4 slimes in a cross with the fire spell, and only got 1 aura summoned at the center instead of 4 slimes being summoned.

JavaScript:
var _Scene_Map_srpgBattlerDeadAfterBattle = Scene_Map.prototype.srpgBattlerDeadAfterBattle;
    Scene_Map.prototype.srpgBattlerDeadAfterBattle = function() {
        var activeEvent = $gameTemp.activeEvent();
        var targetEvent = $gameTemp.targetEvent();
        var allEvents = [activeEvent, targetEvent].concat($gameTemp.getAreaEvents());
        $gameTemp.clearAreaTargets();

        for (var i = 0; i < allEvents.length; i++){
            var event = allEvents[i];
            var battler = $gameSystem.EventToUnit(event.eventId())[1];
            battler.clearAoEDistance();
            if ( i > 0 && event === activeEvent) continue; //active event occurs again, ignore
            battler.setActionTiming(-1);
            battler.removeCurrentAction();
            if (battler && battler.isDead() && !event.isErased()) {
                event.erase();
                var valueId = battler.isActor() ? _existActorVarID : _existEnemyVarID;
                var oldValue = $gameVariables.value(valueId);
                $gameVariables.setValue(valueId, oldValue - 1);
                $gameMap._interpreter.summon('unitEvent', 4, 0, 0, 3) // summon aura after unit death
            }
        }
    };
OMG it works! thank you very much.. i tested killing 4 slimes in a cross with the fire spell, and only got 1 aura summoned at the center instead of 4 slimes being summoned.

JavaScript:
var _Scene_Map_srpgBattlerDeadAfterBattle = Scene_Map.prototype.srpgBattlerDeadAfterBattle;
    Scene_Map.prototype.srpgBattlerDeadAfterBattle = function() {
        var activeEvent = $gameTemp.activeEvent();
        var targetEvent = $gameTemp.targetEvent();
        var allEvents = [activeEvent, targetEvent].concat($gameTemp.getAreaEvents());
        $gameTemp.clearAreaTargets();

        for (var i = 0; i < allEvents.length; i++){
            var event = allEvents[i];
            var battler = $gameSystem.EventToUnit(event.eventId())[1];
            battler.clearAoEDistance();
            if ( i > 0 && event === activeEvent) continue; //active event occurs again, ignore
            battler.setActionTiming(-1);
            battler.removeCurrentAction();
            if (battler && battler.isDead() && !event.isErased()) {
                event.erase();
                var valueId = battler.isActor() ? _existActorVarID : _existEnemyVarID;
                var oldValue = $gameVariables.value(valueId);
                $gameVariables.setValue(valueId, oldValue - 1);
                $gameMap._interpreter.summon('unitEvent', 4, 0, 0, 3) // summon aura after unit death
            }
        }
    };
The default summon position is at the game player position. Try to set the summon position as event.posX() and event.posY()
The default summon position is at the game player position. Try to set the summon position as event.posX() and event.posY()
thanks! it works now! haha
@Shoukang
Spoiler: old text
did you ever try to add another page (4pages) to your windows plugin?
i am trying to do that for the "default resolution patch", but i am running into some errors
EDIT
nevermind i found the problem

it was about the page contents code.. not about adding the page itself ..sry for bothering^^
-> and have nice holidays

EDIT 2 @ ALL

updated my Github

-
added SRPG_StatusWindow(816x624).js
-> put this below SRPG_UnitCore.js if using the default resolution of 816x624

Spoiler: example imgs
816x624
Screenshot_2.png

Screenshot_3.png

Screenshot_4.png

Screenshot_5.png

--------
Screenshot_6.png

Screenshot_7.png

Screenshot_8.png
- updated SRPG_StatusWindow(patch).js
-> put this below SRPG_UnitCore.js if using the default resolution of 1110x768
(recommended, the SRPG_UnitCore.js was made for 1110x768,by default)

Spoiler: example imgs
1110x768
Screenshot_9.png

Screenshot_12.png

Screenshot_11.png
Screenshot_10.png
- updated SRPG_UnitCore.js
-> Bugfixed, gamebreaking issues when going into the menu "item" or "equip" while battle
-> small edits for the battleStatusWindow
(add Nicknames for actor window and other small edits)
-> added a scriptcall that allows to enable/disable the "itemSlots" menu command
(for example disable in battle & enable outside of battle)


=> known Issue => when in battle and in Item_Menu , Items cant be used/consumed,..
-> in battle only itemSlot items can be used with the battleActorCommand "item"
(outside of battle, its no problem to use items over the Item_menu)
--> idk items should not be consumed in battle over the menu anyway, that should happen with battleActorCommands..
..so i am not sure.. if thats a Bug or Not.. Or even if thats a Bug, if that should be changed or not..
any body knows to make the unit events spawn at random location, and make enemy events have random ID? thanks!
any body knows to make the unit events spawn at random location, and make enemy events have random ID? thanks!
what spawner plugin do you use for this, and which id do you mean? i assume enemy ID.. or is it Unit ID?

(event id cant be random the next event is always the next number)

edit

for example Galv eventspawner, can spawn events on random regions, but you will need a random math script that uses a random number from the amount of spawn events(or in other words the amount of event ids ) on the spawn map. This result "x" of random number would be the "x" that is used as ID-data for the spawn scriptcall.
(for this to work the spawn map should only store spawn events , no other events.)
And with the regions you can define where the random spawn locations are,..
-> also if you use that several times you need code that prevents already spawned Event to be spawned again, to avoid getting enemyUnits with the same unitID..
it might be a bit complicated , but it should be possible

I didnt used shoukangs spawner yet, and i dont use the YEP spawners so i cant gve any advice on those 2.

Galv.SPAWN.event(id,r,s); // scriptcall from Galvs eventSpawner for more detailed info read the help info of that plugin
any body knows to make the unit events spawn at random location, and make enemy events have random ID? thanks!
It's easier to delete random unit events (so create a whole bunch and then delete some prior to srpgBattle start) than spawn new ones as spawning new ones requires reading notetag data which is technically baked into the database and harder to manipulate
@dopan i am not using any yet, in tomoaky RPG MAKER VX, it was a very short script for random event placement, just checking passability and event having the tag <lost>..
Code:
#--------------------------------------------------------------------------
  # ● イベントのいない通行可能な座標を返す
  #--------------------------------------------------------------------------
  def empty_pos
    list = []
    for x in 0...width
      for y in 0...height
        list.push([x, y]) if @map_pass_normal[x + 1, y + 1] == 1
      end
    end
    for event in @events.values   # イベントがある座標を候補から除外
      list -= [[event.x, event.y]]
    end
    return list
  end
  #--------------------------------------------------------------------------
  # ● 迷子ユニットをランダム位置へ移動させる
  #--------------------------------------------------------------------------
  def setup_lost_unit
    list = empty_pos
    for unit in unit_list
      if unit.lost?
        last_x, last_y = unit.x, unit.y
        unit.moveto(*list[rand(list.size)])
        unit.set_last_pos
        unit.turn_enemy
        list -= [[unit.x, unit.y]]
        list += [[last_x, last_y]]
      end
    end
  end

  #--------------------------------------------------------------------------
  # ● ランダム位置へ場所移動する
  #--------------------------------------------------------------------------
  def move_lost
    list = $game_srpgmap.empty_pos
    moveto(*list[rand(list.size)])
    set_last_pos
    turn_enemy
  end
  #--------------------------------------------------------------------------
  # ● ユニットが迷子かどうかを返す
  #--------------------------------------------------------------------------
  def lost?
    return true if @lost_flag
  end

@dopan thanks, i will see if it would me manageable to set all and delete. i know event notes can have eval, so i thought having the x to \v[n] would be possible.
Shoukang, good afternoon. The following issue occurred while using SRPG_BattlePrepare.
If at the start of the battle there are dead characters in the squad (the Incapacitated state is imposed), then such characters are also available for selection and placement on the battlefield. How to make them unavailable for selection?
Shoukang, good afternoon. The following issue occurred while using SRPG_BattlePrepare.
If at the start of the battle there are dead characters in the squad (the Incapacitated state is imposed), then such characters are also available for selection and placement on the battlefield. How to make them unavailable for selection?
Thanks for letting me know. I will fix it.
any body knows to make the unit events spawn at random location, and make enemy events have random ID? thanks!
Why do you need random Id?
Why do you need random Id?
To increase challenge, and easier set up for many possible variations on an enemy species (orc warrior, orc shaman, orc soldier, orc archer, orc theif) like that.
To increase challenge, and easier set up for many possible variations on an enemy species (orc warrior, orc shaman, orc soldier, orc archer, orc theif) like that.
You mean random enemy Id? You can use eval() similar to how you set up different enemy level at different difficulty. Some other functions you may need are Math.floor() and Math.random().
- updated SRPG_UnitCore.js
-> Bugfixed, gamebreaking issues when going into the menu "item" or "equip" while battle
-> small edits for the battleStatusWindow
(add Nicknames for actor window and other small edits)
-> added a scriptcall that allows to enable/disable the "itemSlots" menu command
(for example disable in battle & enable outside of battle)
Man, you work FAST.

I took your code through a pretty hardcore series of bug-tests and compatability trial runs and found that it held up perfectly! It looks like you nailed it!

I did find one weird little new issue that cropped up post-bugfix, but it doesn't effect my project, and presumably won't effect yours either?
For some reason the new patch you implemented now stops the entirety of the NRP line of Dynamic action plugins from working xD
Results in a crash with this in the console: Imgur

Personally I've never found the dynamic action plugins super necessary, as you can usually hard-code around the scenarios they're meant to solve, but I wanted to give a heads up just in case this effects anybody else.

Original thread: https://forums.rpgmakerweb.com/threads/srpg-engine-mv-plugins-for-creating-tactical-battle-system.110366/