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

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 138 of 166 View original ↗
  1. Lonewulf123 said:
    For example, Ralph has a passive skill that grants him +5 atk when he attacks an enemy.

    You control Ralph, you initiate combat with an enemy, he gains +5 atk. The skill deactivates.

    Then the enemy takes his turn. The enemy attacks Ralph, he DOESN’T gain the attack bonus in this action.

    Does that make sense?
    If you are using yanfly plugins then you can with buffs/states core + passive skills + passive state conditions. The passive state condition will be $gameSystem.isBattlePhase() == "actor_phase". The passive skills plugin allows you to assign it to a unit (and doesn't disappear if they 'die'). Buff states core might be a dependency. If you want to achieve +5 atk then you might also need yanfly parameter plugin that allows you to change stats on a integer basis.
  2. Please test above first.. Before testing mine.

    I'm affraid that code work too on enemy turn. AFAIK the code said battle phase, not player phase.

    Lonewulf123 said:
    For example, Ralph has a passive skill that grants him +5 atk when he attacks an enemy.

    You control Ralph, you initiate combat with an enemy, he gains +5 atk. The skill deactivates.

    Then the enemy takes his turn. The enemy attacks Ralph, he DOESN’T gain the attack bonus in this action.

    Does that make sense?
    Make sense..
    I'm not on pc and need you to check it out.
    Okay.. If you edit map.. There is 4 blank event on left top corner.. Lets called it "state".. If anyone can give other name.. Plz correct me.
    I'm writing the state here


    MV/SRPGgearMV_JP/State.md · main · G. Wibisono / Rpgmaker · GitLab

    From left to right
    • battle Start
    • actor Turn
    • enemy Turn
    • turn End
    • before Battle
    • After Action
    how to
    On player state (no 2?)
    Run common event for buffing player.. Since you will use it frequently not on 1 map only
    - the step -
    Cek if switch to buff is off if on/true..skip
    If not buffed..Give buff to your targeted player
    Make sure buffed switch is ON

    ----------
    Enemy state
    Run debuff here. Put on your common event. The step reverse from above
    you must added debuff when lose or defeat. the debuff must same you use on enemy state

    sory for long reply
    . . . .
    Can you/someone post tag name from event on top left corner
    * there is 4 or more there
  3. Lonewulf123 said:
    For example, Ralph has a passive skill that grants him +5 atk when he attacks an enemy.

    You control Ralph, you initiate combat with an enemy, he gains +5 atk. The skill deactivates.

    Then the enemy takes his turn. The enemy attacks Ralph, he DOESN’T gain the attack bonus in this action.

    Does that make sense?
    triancontane's SideEffectSkill plugin allows to add a state to a character before a skill effect is activated, then use Yanfly's auto passive to determine if the given skill or an existant skill (like you used a skill called swing sword then check if character has a passive weapon focus sword + character is weapon type equipped correctely) would cause the auto passive state +5 atk to appear.

    Need to test both compatibility with srpg engine however, only did it with regular mv project.
  4. gundambison said:
    Agree.. But for newbie better take my advice.. Since they need guide to make the plugins..
    Can you share your data folder and zipped itu.. Then we can check it out..
    * backup your data first.. Then just delete few things from there before zip and share to us

    Give us example attack you want to make..
    Like added str when attack?
    Different method is depend on your detail
    * more detail plz
    Which folder? I just moved everything back to MV and reconverted everything over there...
  5. Aurawhisperer said:
    Which folder? I just moved everything back to MV and reconverted everything over there...
    this "data" folder
    root
    ycej9SAWGG.jpg
    inside
    uYYIuZ8wr1.jpg
    since there is map*** and other json related to your config.. You can hide it .. Some programer not wanted showing all his work..
    * is kinda programer code.. not to show all unless is secure or you trust
  6. gundambison said:
    this "data" folder
    root
    View attachment 253497
    inside
    View attachment 253498
    since there is map*** and other json related to your config.. You can hide it .. Some programer not wanted showing all his work..
    * is kinda programer code.. not to show all unless is secure or you trust

    This is the MZ one. The one having issues with the stuff showing right. MV is working fine.
  7. Actually.. I dont have MZ and my laptop are not good running MZ.
    Btw we are discuss on MV right?
  8. gundambison said:
    Actually.. I dont have MZ and my laptop are not good running MZ.
    Btw we are discuss on MV right?
    We can yea. But my MV isn't having any issues atm. The issue was on MZ, in which Dopan stated support on it is minimum due to majority of SRPG is supported on MV.
  9. Sry.. I'm answering in here also
    It seem.. Your player and troops will be heal when battle start state end. Mean when start turn 1 after bla-bla (opening) , your decrease mp will turn full!!
    .
    My suggestion put your code on actor turn state. Give condition to make it run:
    The common is not run
    Is this first turn
    .
    If both are true.. Run the common event
  10. Aurawhisperer said:
    @dopan Do you have a demo for Unit Core? It keeps crashing on me and not sure why.
    sry my current showcase demo was not availleble (broken link)
    ---
    i had first to build this itchio page, in order to be able to have a permanent demo-link

    this demo does not have much explanations, it is a setup to build new projects while having a test map & all default switches installed , ect..
    (the plugin manager and its plugins are bugfree, as far i know)
  11. turn all character into 0
    using common event.. if someone able make plugin of this, please..
    common event
    wfirmozfwY.jpg
    common event turn mp 0​
    please added recover all before decreasing all
    L9WBUOul7d.jpg
    recover all​
    then added decrease by giving -999
    Code:
    //----Decrease all hero using ---
    $gameMap.events().forEach(function(event) {
      var eventId=event.eventId();
      var battlerArray = $gameSystem.EventToUnit(eventId);
    //----------------work on enemy only ?!?----
      if (battlerArray && (battlerArray[0] === 'actor' || battlerArray[0] === 'enemy')) {
        var mpUnit = battlerArray[1].mp; //console.log( mpUnit);
        if (battlerArray[1].isAlive()) battlerArray[1].gainMp( -mpUnit);
      }
    //----------------
    });
    the code work on enemy.. but I'm added hero to note only​

    call the common event on Battle Start .. not at unit turn
    battle start
    oFpsgpT5xd.jpg
    event battle start​
    * added info how to use
    changelog
    PCcGDX0OkG.jpg
    you don't need to open this.. this is only to preview my work

    8id3p8eXm1.jpg
    miss mp character​
    if I'm not added decrease all character.. some character have full mp
    lFVzHnlOvF.jpg
    no MP..​
    this event already decrease enemy MP
    * forgot orc not need mp.. ups
  12. gundambison said:
    if someone able make plugin of this, please..


    my plugin SRPG_UnitGroups.js ..
    adapted a script which i found in the srpg core, with different variations, including this minimum variation for own edit usage: (img is from UnitGroups-plugin)
    ..
    this is able to trigger a group of units, in this case its all alive units ,actors and enemys..
    (your method should work aswell, this is just another method)

    2023-02-18 17_30_57-Storage-old-plugins-_SRPG_UnitGroups.js at main · DopanPlugins_Storage-old...png
    --> i used a game-interpreter function , so that the script can be triggered via scriptcall
    ...
    i also made a little github tutorial, where i show this script and other basic srpg scripts..
    ( i used github in order to better show the js code )
    Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins ---
    script for unit groups ect is already explained a few times in this thread^^
    ---

    edit
    - SRPG_UnitGroups.js is in my demo & i reuploaded it to my github mainpage ..
  13. gundambison said:
    turn all character into 0
    using common event.. if someone able make plugin of this, please..
    common event
    View attachment 253587
    common event turn mp 0​
    please added recover all before decreasing all
    View attachment 253592
    recover all​
    then added decrease by giving -999
    Code:
    //----Decrease all hero using ---
    $gameMap.events().forEach(function(event) {
      var eventId=event.eventId();
      var battlerArray = $gameSystem.EventToUnit(eventId);
    //----------------work on enemy only ?!?----
      if (battlerArray && (battlerArray[0] === 'actor' || battlerArray[0] === 'enemy')) {
        var mpUnit = battlerArray[1].mp; //console.log( mpUnit);
        if (battlerArray[1].isAlive()) battlerArray[1].gainMp( -mpUnit);
      }
    //----------------
    });
    the code work on enemy.. but I'm added hero to note only​

    call the common event on Battle Start .. not at unit turn
    battle start
    View attachment 253595
    event battle start​
    * added info how to use
    changelog
    you don't need to open this.. this is only to preview my work

    View attachment 253585
    miss mp character​
    if I'm not added decrease all character.. some character have full mp
    this event already decrease enemy MP
    * forgot orc not need mp.. ups

    This works. After playing with it though, it seems like the increase method won't work either. So like, when all MP is 0'd, per turn both sides have a MP regen of +10 per passing turn. Such an example: player phase, everyone gets a +10 on MP. Enemy phase, same thing. That way, either side can use magic one the appropriate amount is available to use.

    Edit: Figuring an alternative (Something I want to remove eventually) I made a state called MP Regen and force it under the actor and enemies. This works after turn 1, for it does not work right away on the same turn. What I can do if there's no solution is after SRPG Battles, I can remove the state from the actor so that it doesn't apply in the dtb mode (seeing this game will be dtb/srpg based.) and MP can be used normally when in dtb.

    Update on edit: Find out enemies MP won't regen, and state doesn't exist.

    Final Update: For adding the id, I created the script that Dopan provided and explained to me. For right now, maybe it is best for me to use the state MP Regen. Added the solution in pics.

    1676754385374.png
  14. dopan said:
    my plugin SRPG_UnitGroups.js ..
    adapted a script which i found in the srpg core, with different variations, including this minimum variation for own edit usage: (img is from UnitGroups-plugin)
    ..
    this is able to trigger a group of units, in this case its all alive units ,actors and enemys..
    (your method should work aswell, this is just another method)

    View attachment 253609
    --> i used a game-interpreter function , so that the script can be triggered via scriptcall
    ...
    i also made a little github tutorial, where i show this script and other basic srpg scripts..
    ( i used github in order to better show the js code )
    Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins ---
    script for unit groups ect is already explained a few times in this thread^^
    ---

    edit
    - SRPG_UnitGroups.js is in my demo & i reuploaded it to my github mainpage ..

    I've tried using this code before, but I do not understand its functionality is the problem. I'm not super JS savvy (only time I've used it was for websites, and at a very small percentage.) Even though I am able to read syntax, it's the logic I have trouble understanding.
  15. Aurawhisperer said:
    I've tried using this code before, but I do not understand its functionality is the problem. I'm not super JS savvy (only time I've used it was for websites, and at a very small percentage.) Even though I am able to read syntax, it's the logic I have trouble understanding.
    try to avoid double posting^..

    However.. the logic is explained on the github tutorial which i posted..

    i try to make a more simple explanation:
    JavaScript:
       for (var i = 1; i <= $gameMap.events().length; i++) {
            var battleunit = $gameSystem.EventToUnit(i);
            var eventunit = $gameMap.event(i);
            if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
                battleunit[1].addState(addId);
            }  
       };
    here is the clean short script i will explain every line:
    1. var i starting with 1 represents the event id, "$gameMap.events().length" is the max number.. this line makes sure all event ids from 1 to max number will be used
    2. var battleunit, is where we store the battleunit data, which is a mix of event[0] & battler[1] data
    3. var eventunit is where we store the map.event data
    4a. this if condition asks if the event id of battleunit & eventunit is existing
    4b. and if the battleunit[0] is actor or "||" enemy (here we can remove one option if we want)
    4c.. and if battlerunit is not dead ( "!" means "not" )
    5. every battleunit[1] that fit to the above conditions will get state ( [1] is added to adress the battler data here)

    -> the whole point is that the "for" is used instead of "if" or "forEach"..
    .. to check all availleble events on map..
    .. the forEach-method does a similar thing
    the other if conditions are used to avoid bugs, if units are dead and to make sure that the triggered event is also a battle unit and no normal event,,
  16. dopan said:
    try to avoid double posting^..

    However.. the logic is explained on the github tutorial which i posted..

    i try to make a more simple explanation:
    JavaScript:
       for (var i = 1; i <= $gameMap.events().length; i++) {
            var battleunit = $gameSystem.EventToUnit(i);
            var eventunit = $gameMap.event(i);
            if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
                battleunit[1].addState(addId);
            }   
       };
    here is the clean short script i will explain every line:
    1. var i starting with 1 represents the event id, "$gameMap.events().length" is the max number.. this line makes sure all event ids from 1 to max number will be used
    2. var battleunit, is where we store the battleunit data, which is a mix of event[0] & battler[1] data
    3. var eventunit is where we store the map.event data
    4a. this if condition asks if the event id of battleunit & eventunit is existing
    4b. and if the battler is actor or "||" enemy (here we can remove one option if we want)
    4c.. and if battlerunit is not dead ( "!" means "not" )
    5. every battleunit[1] that fit to the above conditions will get state ( [1] is added to adress the battler data here)

    -> the whole point is that the "for" is used instead of "if" or "forEach"..
    .. to check all availleble events on map..
    .. the forEach-method does a similar thing
    the other if conditions are used to avoid bugs, if units are dead and to make sure that the triggered event is also a battle unit and no normal event,,
    I see.... is the function part needed or can I use the for loop as its own for it to work?

    And I'm guessing addid is replaced with the id number for it to add the state per battleunit, yes?
  17. Aurawhisperer said:
    I see.... is the function part needed or can I use the for loop as its own for it to work?

    And I'm guessing addid is replaced with the id number for it to add the state per battleunit, yes?
    this script can be used as it is.. the function i used was just for the plugin..

    the "addid" was just a dummy placeholder & should be the state id (any valid number which is a valid state id)
  18. dopan said:
    this script can be used as it is.. the function i used was just for the plugin..

    the "addid" should be the state id
    I see... well, the script did work for the id part. And my guess is, if I want to remove it just replace addid with removeid. (Or just use the in game block code seeing I only need to remove the state from actors...)

    Sorry for sounding complicated. Think I understand the code now. What overwhelmed me is the function part.
  19. Aurawhisperer said:
    I see... well, the script did work for the id part. And my guess is, if I want to remove it just replace addid with removeid. (Or just use the in game block code seeing I only need to remove the state from actors...)

    Sorry for sounding complicated. Think I understand the code now. What overwhelmed me is the function part.
    Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins the github tutorial shows the solution (also how to show/change mptphp and stats)
    --

    $gameSystem.EventToUnit(eventID)[1].removeState(stateId);

    which is in this context => battleunit[1].removeState(stateId);

    JavaScript:
       for (var i = 1; i <= $gameMap.events().length; i++) {
            var battleunit = $gameSystem.EventToUnit(i);
            var eventunit = $gameMap.event(i);
            if (battleunit && eventunit && (battleunit[0] === 'actor' || battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
                battleunit[1].removeState(stateId);
            }
       };
    --
    "addState" and "removeState" are different codes.
    the one code adds the state the other removes it,, there is no code that can do both
    -> the code triggers functions, and these are 2 different functions^^
    ..
    the 3rd would be "isStateAffected" which asks is the state is applyed or not, that one is used mostly in if conditions