MV - SRPG Engine MV - Plugins for creating Tactical Battle System

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 38 of 166 View original ↗
  1. I made my first fully Selfmade SRPG Plugin,its called "SRPG_BattleUnits".
    The basic function is to store Variables and Switches
    and to check if a battle Unit has a state and to trigger an Animation on map (which can be looped),if the checked state is affected.
    The Variables where the Event Ids for every Map are stored can be used for any script where u need the event ids (for revive skill for example) ,that makes it easier if the Event Ids of your maps are randomly used..
    The Variables that store the Animation and CheckState Ids can also be changed by using other Variable Value.
    There are switches for every BattleUnit to disable the BattleUnit connection to the Plugin trigger .So its easy to control every single battleunit if needed.
    This plugin can be used, to show all states, on all Battle Units on Map for Example.
    BattleUnit = Actor or Enemy ;.. by default its not easy to adress the enemy with Event Commands in SRPG ,but this plugin uses the scriptcall=> "$gameSystem.EventToUnit(eventID)[1]"
    ..which only needs Event Id and adresses 1 Unit out of all BattleUnits.
    Note:this script can cause error if the unit is not active on the battlemap
    --this plugin is made for 50 100BattleUnits but can easy be extended with a bit JS knowledge--
    Updated the SRPGDemoVersion2.8 and added the Plugin and a Event setup example(on default map only) to manage switches and variables (and Variable Values that insert Event Ids ,Animation Ids and CheckState Ids)..links to the "UpdatedSRPGdemo" and a link to the "Plugin only" in my Signature Spoiler.
    -> and of course its free to use, credits are welcome but not required on SRPG_BattleUnits.js

    Example Images
    Screenshot_1.png
    Screenshot_1.png
  2. Hello.
    First of all amazing plug, you have done a great job and ty. Second, i like to ask if it's possible to creat someone a knockback mechanic in the battle similar to "into a breach", i ask because i try to make something like that back nothing i try works.
  3. DarkGGhost said:
    Hello.
    First of all amazing plug, you have done a great job and ty. Second, i like to ask if it's possible to creat someone a knockback mechanic in the battle similar to "into a breach", i ask because i try to make something like that back nothing i try works.
    i dont know "into a breach" sry,but if its about how to push or pull other units while using a skill for example .. than u can use "SRPG_PositionEffects"
    (one of the Plugins from Doktor_Qs Github)
    Screenshot_2.png
  4. Thank you for your quick answer i will try it right away. Have a great day.
  5. i had to edit my new Plugin "SRPG_BattleUnits",in order to make sure every "disable battleUnit" -switch is used by default if:
    -BattleUnit_Event_VarID=0(that was allready in the Plugin)
    -BattleUnit_Event_VarValue=0(thats new edited into the Plugin)
    .. this is to prevent gamebreaking errors if a VarID is set but the VarValue isnt,when the Plugin Command is triggered.
    ..this change is not a must for the Plugin to work,but its supposed to work that way and its recommended to avoid problems.

    Edited default Map_0 for the "SRPG_BattleUnits" Event Setup.
    The demo has a better Event-setup-Example now, in the default Map_0 with 20 BattleUnits used.
    ..if there are Questions or Problems with the Updated-SRPG_Demo2.8 or the Plugin "SRPG_BattleUnits", pls let me know.thx
  6. Dopan said:
    i dont know "into a breach" sry,but if its about how to push or pull other units while using a skill for example .. than u can use "SRPG_PositionEffects"
    (one of the Plugins from Doktor_Qs Github)
    View attachment 152826
    I would like to simulate retreats by having attackers push defenders who have low health. How would I be able to do that?
  7. Cats777 said:
    I would like to simulate retreats by having attackers push defenders who have low health. How would I be able to do that?

    Using SRPG_PositionEffects, you can make a damage formula that looks something like this:
    Code:
    your normal damage formula here + (b.hpRate() < 0.25) ? a.push(b, 1) : 0
    This means that if the target has <25% of their HP when you attack them, they are pushed back one space.

    You can also use the commands from SRPG_PositionEffects inside the lunatic mode tags from Yanfly Skill Core if you want to get more advanced.
  8. Doktor_Q said:
    @dlwjdvud123 The costs are not per-unit, and that's not a planned feature. I am looking into setting up tags that would allow specific units to ignore the movement penalty of specific terrains, but it's not working yet. I do have other things I need to do with my time.

    Is it still difficult to make the function mentioned above?
    I finished making my srpg game, but I haven't been able to distribute it yet because I haven't solved the problem. Sorry to bother you. But it's been a month...
  9. dlwjdvud123 said:
    Is it still difficult to make the function mentioned above?
    I finished making my srpg game, but I haven't been able to distribute it yet because I haven't solved the problem. Sorry to bother you. But it's been a month...

    If someone else wants to take a stab at developing something I haven't, go ahead- that's what I'm doing for the base game anyway- but I don't have the time to work on that at the moment.
  10. Doktor_Q said:
    If someone else wants to take a stab at developing something I haven't, go ahead- that's what I'm doing for the base game anyway- but I don't have the time to work on that at the moment.
    I think this movement problem can be solved with another little walkaround:
    by using a state to add movement ,to spezific units..
    (for example state "cavalry" and SRPG_core state's note:<srpgMovePlus:X>)
    ..and something like :
    Code:
            if (_varEVT0ID >= 1 && ($gameVariables.value(_varEVT0ID)) >= 1 && _varSOFFT0ID >= 1 && ($gameVariables.value(_varSOFFT0ID)) >= 1) {
                if ($gameSystem.EventToUnit($gameVariables.value(_varEVT0ID))[1].isStateAffected($gameVariables.value(_varSOFFT0ID)) && ($gameMap.terrainTag(($gameMap.event($gameVariables.value(_varEVT0ID)).x),($gameMap.event($gameVariables.value(_varEVT0ID)).y))==0)) {
                    $gameSystem.EventToUnit($gameVariables.value(_varEVT0ID))[1].removeState($gameVariables.value(_varSOFFT0ID))
                }
            }                                                                                                             
    
            if (_varEVT0ID >= 1 && ($gameVariables.value(_varEVT0ID)) >= 1 && _varSONT0ID >= 1 && ($gameVariables.value(_varSONT0ID)) >= 1) {
                if ((!$gameSystem.EventToUnit($gameVariables.value(_varEVT0ID))[1].isStateAffected($gameVariables.value(_varSONT0ID))) && ($gameMap.terrainTag(($gameMap.event($gameVariables.value(_varEVT0ID)).x),($gameMap.event($gameVariables.value(_varEVT0ID)).y))==0)) {
                      $gameSystem.EventToUnit($gameVariables.value(_varEVT0ID))[1].addState($gameVariables.value(_varSONT0ID))
                }
            }



    and this code should be able to Enable/Disable a state (like "cavalry") if the unit is on the terrain tag 0 in this example.
    x,y = needs the variable xy position of active event or variables that store the position related to the following event id ..
    event id = needs the event id or a variable that has the event Id stored ..
    That wont change anything on how the movement terrain-restriction works but it can change how the movement of the Unit (which was added by state) works if its on the terrain tag: o in this case..
    -> basicly what im tryin to make is a terrain tag plugin, that let terrain tags enable/disable states
    ..

    edit 4
    added the final and working Code this can be used if you want to do it all with script eventing and without a Plugin (note:the variable iDs have to be changed,this code shows how it works in the plugin)
  11. Dopan said:
    I think this movement problem can be solved with another little walkaround:
    by using a state to add movement ,to spezific units..
    (for example state "cavalry" and SRPG_core state's note:<srpgMovePlus:X>)
    ..and something like :

    Code:
    if ($gameSystem.EventToUnit(eventID)[1].isStateAffected(stateId) && $game_map.terrain_tag(x,y)==2) {
         $gameSystem.EventToUnit(eventID)[1].removeState(stateId)
    
    }

    and this code should be able to disable a state (like "cavalry") if the unit is on the terrain tag 2 in this example.
    x,y = needs the variable xy position of active event or variables that store the position related to the following event id ..
    event id = needs the event id or a variable that has the event Id stored ..
    That wont change anything on how the movement terrain-restriction works but it can change how the movement of the Unit (which was added by state) works if its on the terrain tag: 2..
    -> basicly what im tryin to make is a terrain tag plugin, that let terrain tags disable states
    ..
    sry but atm its just an Idea and i have to try it out, before i can provide a script, that works in an event or a plugin, including descriptions ect.
    (if anybody has a better idea ,that would be welcome aswell^^)

    I really thanks to your help and attention about my trouble!!
    but... i can't understand your solution... because of lack understanding... If you have a time please add this solution apply your srpg demo??
  12. I really thanks to your help and attention about my trouble!!
    but... i can't understand your solution... because of lack understanding... If you have a time please add this solution apply your srpg demo??
    this will take some time,perhaps I am able to build a little plugin for this..sry if the solution is not very well explained.. i will put this solution in the demo as soon im done.

    edit 1 (Preview: new Plugin ="SRPG_TerrainStates")
    the main function of the plugin will be to Add or Remove States depending on the Terrain Tag,where the Unit is located.
    -the BattleUnit has to be defined with the eventID in a Variable,..
    -the state that should be added has to be defined with the StateID in a Variable,..
    -the state that should be removed has to be defined with the StateID in a Variable,..
    => the PluginCommand("SRPG_TerrainStates") has to be used in order to trigger the function.
    this example shows how it works related to terrain-tag_0:
    Screenshot_1.png
    This shows how the Plugin is used;with this Event Setup as Example how to set the VariableValue:
    -> State with the stateID "4" will be added (on Terrain-tag_0)
    -> State with the stateID "22" will be removed (on Terrain-tag_0)
    -> Event(=battleUnit) that is affected from this Plugin is = Event with the ID "10" (on Terrain-tag_0)
    => PluginCommand (triggers the function 1_time)
    => Note: the EventID Variable must allways be used if using this function
    ..this function allready works!
    Everybody who uses this plugin, has to put all eventIDs of BattleUnits that are supposed to use this function, on every Map, in a Variable,similar to how it works in the Plugin "SRPG_BattleUnits"..

    edit 2

    Here it is : "SRPG_TerrainStates.js"

    Img TerrainStates.js
    Screenshot_1.png
    Edited info:
    -edited "SRPG_Switches" now its called "SRPG_BattleUnits" with room for 100 BattleUnits
    -edited the Updated-SRPG_Demo2.8 ,mostly on Default Map_0
    -added =>Ice-Terrain_tag1 & "flying_state"
    -added to Map_0 =>Event="manage;TerrainStates" and improoved Event="manage.BattleUnits"
    ,..the next update will get common-event-Examples to Manage those Plugins..
    map o edited events
    Screenshot_1.png
    next updates planed:
    - making "SRPG_TerrainSkills" (does the same like "SRPG_TerrainStates" but with skills)
    - and i am thinking of, how to make a plugin, that makes it easier to set the Event Ids for BattleUnits..
    - another demo Update when all planed Plugins are Finished
  13. Auras would also be nice.
  14. MetalKing11417 said:
    Auras would also be nice.
    edit.what is this could you explain as detailed as possible pls?
    ok i watched yeps passive aura Video , and basicly Auras are States that trigger States on other Units..
    i think by Using SRPG_BattleUnits.js and Eventing with some "if Conditions" this can allready be done without an Additional Plugin.
    just use Following Scriptcalls and the EventIds OR the BattleUnit EventID Variables:
    --
    ->as Scriptcall in a "if Condition" used in an Event this is = if eventUnit is State Affected
    Code:
    $gameSystem.EventToUnit(eventID)[1].isStateAffected(stateID)
    --
    -> as Scriptcall this adds State to eventUnit
    Code:
    $gameSystem.EventToUnit(eventID)[1].addState(StateID)
    --
    -> as Scriptcall this Removes State of eventUnit
    Code:
    $gameSystem.EventToUnit(eventID)[1].removeState(StateID)
    --
    -> this is the code for using a Variable (or better its Value)
    Code:
    $gameVariables.value(varID)
    --
    Example: the script for "revive a Unit" used with "variable BattleUnit EventID"
    => "this.unitRevive(EventID);" + "BattleUnit Variable with EventId stored"
    Code:
    this.unitRevive($gameVariables.value("VariablesID of BattleUnit_1"));
    -> this will revive the BattleUnit_1. The "VariableID of BattleUnit_1" can be used like this in any scriptcall that needs Event Ids.

    The most work using those plugins i made, is still the Eventing Part..
    and i got no idea how to make auras "simpler" with the help of a plugin.
    (or atleast i cant do it at this point^^,perhaps when i learned more about Js,
    but nothing i could promise for the future)

    edit.
    if the aura is suposed to be range affected these 2 scriptcalls could be usefull aswell..:

    Code:
    this.EventDistance(VariableID, EventID, EventID); # Store the distance between events in a variable.
    this.ActorDistance(VariableID, ActorID, ActorID); # Store the distance between actors in a variable.
  15. Dopan said:
    what is this could you explain as detailed as possible pls?
    Basically a state/unit trait that causes the unit with it to apply a state to surrounding units (player units, enemy or both; may include or exclude the user in applying the state) passively in an aoe. For a srpg example: https://fireemblem.fandom.com/wiki/Lily's_Poise
  16. Dopan said:
    edit.what is this could you explain as detailed as possible pls?
    ok i watched yeps passive aura Video , and basicly Auras are States that trigger States on other Units..
    i think by Using SRPG_BattleUnits.js and Eventing with some "if Conditions" this can allready be done without an Additional Plugin.
    just use Following Scriptcalls and the EventIds OR the BattleUnit EventID Variables:
    --
    ->as Scriptcall in a "if Condition" used in an Event this is = if eventUnit is State Affected
    Code:
    $gameSystem.EventToUnit(eventID)[1].isStateAffected(stateID)
    --
    -> as Scriptcall this adds State to eventUnit
    Code:
    $gameSystem.EventToUnit(eventID)[1].addState(StateID)
    --
    -> as Scriptcall this Removes State of eventUnit
    Code:
    $gameSystem.EventToUnit(eventID)[1].removeState(StateID)
    --
    -> this is the code for using a Variable (or better its Value)
    Code:
    $gameVariables.value(varID)
    --
    Example: the script for "revive a Unit" used with "variable BattleUnit EventID"
    => "this.unitRevive(EventID);" + "BattleUnit Variable with EventId stored"
    Code:
    this.unitRevive($gameVariables.value("VariablesID of BattleUnit_1"));
    -> this will revive the BattleUnit_1. The "VariableID of BattleUnit_1" can be used like this in any scriptcall that needs Event Ids.

    The most work using those plugins i made, is still the Eventing Part..
    and i got no idea how to make auras "simpler" with the help of a plugin.
    (or atleast i cant do it at this point^^,perhaps when i learned more about Js,
    but nothing i could promise for the future)

    edit.
    if the aura is suposed to be range affected these 2 scriptcalls could be usefull aswell..:

    Code:
    this.EventDistance(VariableID, EventID, EventID); # Store the distance between events in a variable.
    this.ActorDistance(VariableID, ActorID, ActorID); # Store the distance between actors in a variable.
    Well, you could at least provide an example in your SRPG Demo.
  17. MetalKing11417 said:
    Well, you could at least provide an example in your SRPG Demo.
    edit 3
    .. I just realized that Yep Auto Passive States is needed and perhaps the Scriptcall :
    Code:
    this.EventDistance(VariableID, EventID, EventID);
    In order to define what range is needed to make the PassiveState(="auras-child") get triggerd from the "Aura State"
    Perhaps i have to Edit BattleUnits.js . And i realized that making the plugin "TerrainSkills" is not needed, because all Skill changes that i can archieve with script-code ,can be archieved by States,
    ..only SRPG_TerrainStates.js is Required to affect skills on other terrain-tags (with the State Setup).
    Yep Auto Passive States will be added to the Updated-SRPG_Demo in the next update,with 1 example for Aura-State, and more Common Events to show How to handle "SRPG_BattleUnits" & "SRPG_TerrainStates" with Common Events instead of inMap Events..
  18. Dopan said:
    this will take some time,perhaps I am able to build a little plugin for this..sry if the solution is not very well explained.. i will put this solution in the demo as soon im done.

    edit 1 (Preview: new Plugin ="SRPG_TerrainStates")
    the main function of the plugin will be to Add or Remove States depending on the Terrain Tag,where the Unit is located.
    -the BattleUnit has to be defined with the eventID in a Variable,..
    -the state that should be added has to be defined with the StateID in a Variable,..
    -the state that should be removed has to be defined with the StateID in a Variable,..
    => the PluginCommand("SRPG_TerrainStates") has to be used in order to trigger the function.
    this example shows how it works related to terrain-tag_0:
    View attachment 153141
    This shows how the Plugin is used;with this Event Setup as Example how to set the VariableValue:
    -> State with the stateID "4" will be added (on Terrain-tag_0)
    -> State with the stateID "22" will be removed (on Terrain-tag_0)
    -> Event(=battleUnit) that is affected from this Plugin is = Event with the ID "10" (on Terrain-tag_0)
    => PluginCommand (triggers the function 1_time)
    => Note: the EventID Variable must allways be used if using this function
    ..this function allready works!
    Everybody who uses this plugin, has to put all eventIDs of BattleUnits that are supposed to use this function, on every Map, in a Variable,similar to how it works in the Plugin "SRPG_BattleUnits"..

    edit 2

    Here it is : "SRPG_TerrainStates.js"

    Img TerrainStates.js
    View attachment 153160
    Edited info:
    -edited "SRPG_Switches" now its called "SRPG_BattleUnits" with room for 100 BattleUnits
    -edited the Updated-SRPG_Demo2.8 ,mostly on Default Map_0
    -added =>Ice-Terrain_tag1 & "flying_state"
    -added to Map_0 =>Event="manage;TerrainStates" and improoved Event="manage.BattleUnits"
    ,..the next update will get common-event-Examples to Manage those Plugins..
    map o edited events
    View attachment 153203
    next updates planed:
    - making "SRPG_TerrainSkills" (does the same like "SRPG_TerrainStates" but with skills)
    - and i am thinking of, how to make a plugin, that makes it easier to set the Event Ids for BattleUnits..
    - another demo Update when all planed Plugins are Finished

    Thanks for your help!!!!! Finally I can release my game!!! I love so much dopan♡ I dont know how appreciate you more than
  19. ses1715 said:
    Thanks for your help!!!!! Finally I can release my game!!! I love so much dopan♡ I dont know how appreciate you more than
    Im happy that your problem is solved^^
    ------
    @ All

    Finally SRPG_BattleUnits is Edited again ,now with a new Function for Aura States:
    - Plugin Command "SRPG_BattleUnits CheckAddState"
    - this takes 1 Unit and checks the state of all 100 Units,if the wanted state is affected (on the 100),
    it will calculate the Range betwen the 1 Unit and the 100 (or those which are Active).
    ..And if the set EffectRange is bigger than the Distance.. a "child"- State will be Applied to the 100
    Units that fit in the previews Conditions
    -so if the "singel Unit" is State affected with Aura before the Function is Used,this can be used to make the Aura work.
    -I recommend to set 2 or 3 Permanent States :
    >"Friend" "Enemy" "All"-(or "B.Unit")
    -> this way we can allways use these passive Perma States to adress the Units,which we want to be affected..

    ..and another plugin is finished "UnitCall.Js" it basicly just uses some functions which can be used for singel Units (add state ,remove state,call Event page,Revive,Teleport and few other functions)

    I decided to put all BattleUnit related Plugins which i made, in a Zip together:
    here is the most Updated Version of "DopansPlugins.zip":
    -SRPG_BattleUnits.js
    -SRPG_TerrainStates.js
    -SRPG_UnitCall.js

    at the moment the UpdatedSRPG-Demo with the new Examples and Setups and the Aura Skill Setup is not finished,but i wanted to atleast upload the Plugins earlier for those who are interessted.
    If anybody has questions or finds a Bug ,..pls let me know
    .

    Edit
    There are several Bugs in the "aura" -function of SRPG_BattleUnits.js ,thats why i unlinked the Plugins till i fixed everthing and finished the demo update.
  20. Really enjoyed the demo for this plugin! It really showed off the extent of what you can do with this and I'm amazed at how comprehensive the demo is (not to mention how fun it is lol). Was wondering too if there's some way to have NPC's move on their own during the length of the battle running away but I guess it's just a matter of signing them a non-player AI and directing them to move away or something. I'm sure I'll figure it out when I get the plugin haha but I'm definitely in love with what's already been showcased in the demo alone <3

    Also, one note for the third map of the demo game, but I ended up talking to the fairy and her message loops no matter what I do. I can't get out of talking to her so I had to end the game prematurely since I was locked into the loop ;w;