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

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 64 of 166 View original ↗
  1. Diz89 said:
    Hey there!

    the eval suggestion for the enemy notetags works great. Thx again for that :) The only problem is, that with Yanflys Enemy Base Parameter with an level up for the enemy, the stats are not changing. When leaving the Map and doing the quest/mission again, then it is shown (the level with a variable is shown, that it changed, but not the stats, which will be calculated with that level variable)

    got a new question:

    I want to store the actorID of the battling actor into a variable. in the plugin parameters there allready exists a variable for this, but I want to store it in another one, so right in the after Battle Event I do


    $gameVariables.setValue(80, $gameVariables.value(24));

    this works perfectly in the Player Turn, but seems not to happen in the enemy turn

    my goal is something like this:
    - when my actor is defeated (either my turn or in the enemy turn), I want to give the enemy, who defeated it a special boost (or other stuff)...depending on the actor wgo got defeated (so f.e. if my archer actor got defeated, the enemys health will recover a bit, if the warrior is defeated, the enemy will be stronger in the next battle and so on.

    is there a way to check, whether it's the enemies turn? then I could make a condition workaround maybe :3


    I found a workaorund for the last thing, the stat changing thingy remains :3
    Are you using srpgLevel to set an enemy's level? srpgLevel is not the same as level parameter than yanfly enemy levels use. How are you changing enemy level? Is it with the lunatic code notetag? If so you need to add code to convert srpgLevel into yanfly level
  2. Are you using srpgLevel to set an enemy's level? srpgLevel is not the same as level parameter than yanfly enemy levels use. How are you changing enemy level? Is it with the lunatic code notetag? If so you need to add code to convert srpgLevel into yanfly level

    No @boomy . I use a variable for the srpgLevel notetag. I also don't use the Level parameter from yanfly. Here I also use the same variable I put into the srpgLevel.

    The funny thing is: if I increase in either turn this variable, it will be shown in the enemy information window (so if the Level variable increases from 1 to 2, it is shown). But this doesnt count for the changes like the HP or ATK. Here it is only shown when I end the SRPG Battle (and changing the Map) and starting the same map again. Then the Stats are ok.

    I will edit this post later to show my enemy notetag, but I think, the problem is elsewhere (updating the windows with the stats...no idea)

    Thx for the help so far!
  3. Diz89 said:
    No @boomy .
    But this doesnt count for the changes like the HP or ATK. Here it is only shown when I end the SRPG Battle (and changing the Map) and starting the same map again. Then the Stats are ok.
    @Diz89

    did you try "refresh map"? ..
    JavaScript:
    $gameMap.refresh()

    Its just an Idea i didnt test anything
  4. Sadly that didn't do the trick, but thx for trying @Dopan

    Here are the enemy tags that I use (just an example):


    <srpgClass:Warrior>

    <srpgLevel:$gameVariables.value(123)>

    <srpgMove:5>

    <srpgWeapon:$gameVariables.value(215)>


    <Custom Enemy Parameters>

    maxhp = 50 + ($gameVariables.value(123)-1) * 5 + $gameVariables.value(220);

    maxmp = 30 + ($gameVariables.value(123)-1) * 4 + $gameVariables.value(221);

    atk = ($gameVariables.value(123)-1) * 3 + 10;

    </Custom Enemy Parameters>


    so variable 123 is my flexible Level. When selecting an enmy it shows 1 in the beginning and after battle and after some normal stuff it shows 2 (because the enemy leveled during the fight against my actors)

    While it works for the Level, it doesn't show the increasing of atk.

    In the beginning he had 12 atk (10 plus the atk increase from the weapon), at level 2 he should have 55 HP, 34 MP and 15 ATK (not to forget about the 2 atk from the weapon XD)

    This does not show in the SRPG-battle, where it happens, BUT after loosing/winning the whole fight and doing the SRPG Battle again, the stat changes are there.


    I also saw a strange behaviour using GALVs Eventspawner. In my project, I can be on the map first to "spawn" my actors where I want them to be. Then leaving the map and going on the same Map again using the SRPG-Switch, the battle will start and I can use them. This works already, but:

    Turn 1: I move the actor to another place a few tiles lower (the maximum range)
    Turn 2: Nothing happens, because the enemy is moving too (or battling my actor, I tried both)
    Turn 3: I wann move my actor again a few tiles lower, klick on the tile the arrow shows but before doing other stuff (waiting, attacking and so on) I make a RIGHT CLICK and immediatly my actor "jumps" where it was in the Beginning (where I spawnt it using Galvs Eventspawner. From there I still can move (but not as far war I was before RIGHT CLICKing) and doing that actors turn...

    any ideas also for this behaviour?
  5. Diz89 said:
    I also saw a strange behaviour using GALVs Eventspawner. In my project, I can be on the map first to "spawn" my actors where I want them to be. Then leaving the map and going on the same Map again using the SRPG-Switch, the battle will start and I can use them. This works already, but:

    Turn 1: I move the actor to another place a few tiles lower (the maximum range)
    Turn 2: Nothing happens, because the enemy is moving too (or battling my actor, I tried both)
    Turn 3: I wann move my actor again a few tiles lower, klick on the tile the arrow shows but before doing other stuff (waiting, attacking and so on) I make a RIGHT CLICK and immediatly my actor "jumps" where it was in the Beginning (where I spawnt it using Galvs Eventspawner. From there I still can move (but not as far war I was before RIGHT CLICKing) and doing that actors turn...

    any ideas also for this behaviour?
    idk if its your setup(project), or wrong eventspamer Setup, or any other conflict.. but my tutorial demos show how to use the eventspawmner (chucks place Nr3, normal spawn enemy usage) and the "EventGraves_ Common Events"..

    you could also try out yeps eventspawner, but for my needs galvs eventspawner worked better..
    (thats why i recommend galvs eventspawner generaly)
  6. idk if its your setup(project), or wrong eventspamer Setup, or any other conflict.. but my tutorial demos show how to use the eventspawmner (chucks place Nr3, normal spawn enemy usage) and the "EventGraves_ Common Events"..

    you could also try out yeps eventspawner, but for my needs galvs eventspawner worked better..
    (thats why i recommend galvs eventspawner generaly)

    Not sure about the project setup either. Just used the newest demo for the SRPG Engine, put galvs to the end of the Plaugin list, made my map for spawning and go.

    I also tried your project @Dopan (I already looked at it for the event graves :3), and I can't see any wrong usage for now as I can spawn the events in the correct place I like. The problem is later while in the SRPG Battle (where I don't use any spawn events) and just use my spawned events (from earlier). This was just my assumption as when I'm using normal actors already on the map it does not happen for them. Only when I'm moving for a second (or third or fourth time) the GALV-Events. I thought it might have something to do with the 'preserved' tag for galv spawns, but I need them to be true.

    I even tried to change your demo to spawn an event in the call actor common event (just one new Event with simple actor setup from the Galvspawneventmap. the event is spawned, but I can't move it lol XD

    I'm not sure, if my explainations make any sense for you guys XD
  7. Diz89 said:
    Not sure about the project setup either. Just used the newest demo for the SRPG Engine, put galvs to the end of the Plaugin list, made my map for spawning and go.

    I also tried your project @Dopan (I already looked at it for the event graves :3), and I can't see any wrong usage for now as I can spawn the events in the correct place I like. The problem is later while in the SRPG Battle (where I don't use any spawn events) and just use my spawned events (from earlier). This was just my assumption as when I'm using normal actors already on the map it does not happen for them. Only when I'm moving for a second (or third or fourth time) the GALV-Events. I thought it might have something to do with the 'preserved' tag for galv spawns, but I need them to be true.

    I even tried to change your demo to spawn an event in the call actor common event (just one new Event with simple actor setup from the Galvspawneventmap. the event is spawned, but I can't move it lol XD

    I'm not sure, if my explainations make any sense for you guys XD
    perhaps you tried to spawn an event that is allready an Unit instead of spawning a clean event and transforming that into an Unit??

    edit
    ( i think both should work and without looking into it i cant say for sure whats wrong,sry)

    JavaScript:
    Event command => script:
      this.addActor(EventID, ActorID);//   # Make the event with the specified ID the actor.
      this.addEnemy(EventID, EnemyID);// # Make the event with the specified ID the enemy.

    img example from chucks map 3
    Spoiler
    Screenshot_3.png
  8. perhaps you tried to spawn an event that is allready an Unit instead of spawning a clean event and transforming that into an Unit??

    what I did to your Call Actor Common event:

    JavaScript:
    Script:
    var x = 5;
    var y = 8;
    var eventID = 30 //this was the new event on your GalvEventSpawnerMap
    
    Galv.SPAWN.event(eventID,x,y,true)
    (I could use the normal command without the var's, but I wanted to do it like in my project)

    Event 30 was just an event with simple eventnotes for an actor (with the penultimate number in the actor tab). Then I just use the skill on your "Map 3" and together with Shadow, the other actor who gets called (not spawned I know) the char appears. But I could not move the other new actor.

    I can think, that the spawner only works before the SRPG-Battle is loaded (atleast it works in my project, as I enter the Map before (without the SPRB Battle Switch), then I leave the map again and start the SRPG Battle (with the Switch), then I can move my actor units, but the behaviour (only for the ones spawned with GALV) appears, the other work as intended.

    Man...I hope, one can understand, what I wrote XDD Not that good in english lol
  9. Diz89 said:
    what I did to your Call Actor Common event:

    JavaScript:
    Script:
    var x = 5;
    var y = 8;
    var eventID = 30 //this was the new event on your GalvEventSpawnerMap
    
    Galv.SPAWN.event(eventID,x,y,true)
    (I could use the normal command without the var's, but I wanted to do it like in my project)

    Event 30 was just an event with simple eventnotes for an actor (with the penultimate number in the actor tab). Then I just use the skill on your "Map 3" and together with Shadow, the other actor who gets called (not spawned I know) the char appears. But I could not move the other new actor.

    I can think, that the spawner only works before the SRPG-Battle is loaded (atleast it works in my project, as I enter the Map before (without the SPRB Battle Switch), then I leave the map again and start the SRPG Battle (with the Switch), then I can move my actor units, but the behaviour (only for the ones spawned with GALV) appears, the other work as intended.

    Man...I hope, one can understand, what I wrote XDD Not that good in english lol
    That sounds like the unit is not active, only a normal event.. thats why i use this setup on the spawn event:
    this makes sure that the eventNotes gets activated on the spawned event
    Screenshot_5.png
    the 1st eventpage is set to parrallel to activate the script, and the 2nd page uses the needed default "actionTrigger"
    Screenshot_6.png
    ..
    in this Case i did not used "this.addEnemy(EventID, EnemyID);" to activate the UnitEvent, instead the script will read&activate the SkillNote ,that makes the Event an "Unit".

    I did this because this way i could also activate the Eventnote "Unit:4"
    (defines what enemy Unit this is,.. i need this for the plugin "SRPG EnemyUnits"..)

    /( this immitates the actor id.. but for enemys, because the enemys get cloned and Actors are always individuals.. that way i can give every enemy on map its own id)
    BEWARE Cloning Actors makes problems, only revive Actors but never clone them

    => in other words, i guess you are not spawning Units, you are spawning Events, and forgot to activate them so they get Units..
    ( thats what the script on the 1st eventpage of the 1st IMG does)
    ->its Set all Eventype and All Enemys in that case


    I gave no example to do that for actors, because all actors in the demo use Placeholder events,and dont get spawned with the eventspawner..but the code to activate actors on an Event is :
    this.addActor(EventID, ActorID); # Make the event with the specified ID the actor.

    i once recognized that spawned events dont have their eventnote activated, thats why i looked into the core to find the Script on the First Img:
    Screenshot_7.png
  10. Thx for trying to help @Dopan

    Sadly I still can't use the command with galv.spawn with an Event exactly set up like your screens.

    I have to take a few more steps back to explain my project better:

    You are a master of some dungeon (like Dungeon Keeper).
    You can visit your dungeon and "put" your minions like you want (with the GALV Eventspawner). That is without any battle.
    afterwards you get some alert of sort an are teleported to the same dungeon map again (this time with the SRPG Battle swtch on)
    Then you battle.

    And here is my problem. I use only the SRPG plugin and galv (and Yanfly base paramter plugins for enemies and actors). I can start the battle and my spawned events are recognized as actors (so I can move them around and do the normal stuff. But the strange movement behaviour appears.

    I tried the setAllEventType() command, but nothing changed.
  11. Diz89 said:
    Sadly that didn't do the trick, but thx for trying @Dopan

    Here are the enemy tags that I use (just an example):


    <srpgClass:Warrior>

    <srpgLevel:$gameVariables.value(123)>

    <srpgMove:5>

    <srpgWeapon:$gameVariables.value(215)>


    <Custom Enemy Parameters>

    maxhp = 50 + ($gameVariables.value(123)-1) * 5 + $gameVariables.value(220);

    maxmp = 30 + ($gameVariables.value(123)-1) * 4 + $gameVariables.value(221);

    atk = ($gameVariables.value(123)-1) * 3 + 10;

    </Custom Enemy Parameters>


    so variable 123 is my flexible Level. When selecting an enmy it shows 1 in the beginning and after battle and after some normal stuff it shows 2 (because the enemy leveled during the fight against my actors)

    While it works for the Level, it doesn't show the increasing of atk.

    In the beginning he had 12 atk (10 plus the atk increase from the weapon), at level 2 he should have 55 HP, 34 MP and 15 ATK (not to forget about the 2 atk from the weapon XD)

    This does not show in the SRPG-battle, where it happens, BUT after loosing/winning the whole fight and doing the SRPG Battle again, the stat changes are there.

    The issue is Yanfly enemy level does not "reset" stats manually upon simply changing the level. This can be addressed by using Yanfly's enemy Level function: enemy.changeLevel(X) which changes the enemy's level to X and also recalcualtes the enemy's stats.

    Your goal is to manipulate an enemy;s level to be equal to a variable that you define and you are doing this by using lunatic notetag + game variable. I recommend you run a script at the start of battle that sets the enemy level to X using yanfly functions.

    Example:
    for(var i = 0; i < $gameSystem.srpgEnemiesList().length; i++) {
    $gameSystem.srpgEnemiesList().changeLevel(X); //You could use gainLevel too
    }

    I use a new function called srpgEnemiesList that returns all enemies on the map in the above loop (paste it into srpg_core somewhere...)

    Game_System.prototype.SrpgEnemiesList = function() {
    var i;
    var array = [];
    for(i = 0; i < $gameSystem._EventToUnit.length; i++) {
    if (typeof $gameSystem._EventToUnit !== 'undefined') {
    if($gameSystem._EventToUnit !== null) {
    if($gameSystem._EventToUnit[0] == "enemy") {
    array.push($gameSystem._EventToUnit[1]);
    }
    }
    }
    }
    return array;
    }

    I did this and got enemy levels to change on the fly + stats change as seen below (I change an enemy's level to level 12 and its stats change as shown in the status screen):

    ylUJZ8R.gif
  12. for(var i = 0; i < $gameSystem.srpgEnemiesList().length; i++) {
    $gameSystem.srpgEnemiesList().changeLevel(X); //You could use gainLevel too
    }

    I use a new function called srpgEnemiesList that returns all enemies on the map in the above loop (paste it into srpg_core somewhere...)

    Game_System.prototype.SrpgEnemiesList = function() {
    var i;
    var array = [];
    for(i = 0; i < $gameSystem._EventToUnit.length; i++) {
    if (typeof $gameSystem._EventToUnit !== 'undefined') {
    if($gameSystem._EventToUnit !== null) {
    if($gameSystem._EventToUnit[0] == "enemy") {
    array.push($gameSystem._EventToUnit[1]);
    }
    }
    }
    }
    return array;
    }

    Hey @boomy

    Thx for the script. This might solve my problem, but there is one thing I don't understand :3

    It looks to me (me: noob in scripting XD) that this will change ALL the enemies on the map to the Level X (or they gain it depending on the code I use). But what I want: Enemy 7 is Level 2 after the battle (when my actor is defeated), enemy 8 could already be Level 2 and now raises up to Level 3

    or...wait...does it even matter? I never use the "level" from yanfly. just my variable. so the X is not important, just that it updates the stats, right?


    EDIT:
    hmmm...but this didn't work for me :(

    I put your code into the srpg.core after the Game_System.prototypes in the beginning and I used your example for running the code in the afterAction event (because I want to update them after the battle so that next turn I have the new stats.

    Edit2: I also put (just for testing) $gameSystem.srpgEnemiesList() into one variable with

    $gameVariables.setValue(101,$gameSystem.srpgEnemiesList());

    but it's empty or did I use a wrong code?
  13. I use a new function called srpgEnemiesList
    @boomy

    i dont understand why you didnt used the base code of SRPG_UnitGroups..?
    i mean this can be used to adress every enemy, or every actor, or every team member:

    all Units
    Spoiler
    JavaScript:
                    //0U_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allUxTest();"
                    Game_Interpreter.prototype.allUxTest = function() {
                        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())) {
                            // <-insert test code here
                        }
                      
                        }
                        return true;
                    };
    enemy
    Spoiler
    JavaScript:
                    //0E_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allExTest();"
                    Game_Interpreter.prototype.allExTest = function() {
                        for (var i = 1; i <= $gameMap.events().length; i++) {
                        var battleunit = $gameSystem.EventToUnit([i]);
                        var eventunit = $gameMap.event([i]);
                        if (battleunit && eventunit && (battleunit[0] === 'enemy') && (!battleunit[1].isDead())) {
                            // <-insert test code here
                        }
                      
                        }
                        return true;
                    };
    actor
    Spoiler
    JavaScript:
                    //0A_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allAxTest();"
                    Game_Interpreter.prototype.allAxTest = function() {
                        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[1].isDead())) {
                            // <-insert test code here
                        }
                      
                        }
                        return true;
                    };
    team member
    Spoiler
    JavaScript:
                    //0T_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allTxTest();"
                    Game_Interpreter.prototype.allTxTest = function() {
                        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].srpgTeam() == team)) {
                            // <-insert test code here
                        }
                      
                        }
                        return true;
                    };

    <-insert test code here
    the extra codeline at "insert test code here" for your example would be:
    JavaScript:
    battleunit[1].changeLevel(X);
    OR
    JavaScript:
    battleunit[1].gainLevel(X) ;
    ____
    idk did i miss anything?
  14. idk did i miss anything?
    because I don't use this plugin (I even don't know, if I should use it or not or if the new functions are needed for my...needs XD)

    Edit:
    and even then I don't know, where to put the call for the function and how to call it and: wha ist it battleunit[1] and not i? I just tried to use this.allExTest(); in the afterAction event. Because: it is possible, that ALL my actors level up (or not all but a few) after the fight and I would like to refresh the stats for ALL of them :)
  15. Diz89 said:
    because I don't use this plugin (I even don't know, if I should use it or not or if the new functions are needed for my...needs XD)

    Edit:
    and even then I don't know, where to put the call for the function and how to call it and: wha ist it battleunit[1] and not i? I just tried to use this.allExTest(); in the afterAction event. Because: it is possible, that ALL my actors level up (or not all but a few) after the fight and I would like to refresh the stats for ALL of them :)
    you can add units to a Team and let only the Team lv up..
    ( for that you need SRPG_Teams.js aswell..one of DrQs Plugins, but my example is without using Teams for starters.. )
    the code i showed are Funtions that can be added to any plugin, and then you can use/ call the functions..
    Example: let all actors lv up:
    JavaScript:
                    //0A_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allAxTest();"
                    Game_Interpreter.prototype.allAxTest = function() {
                        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[1].isDead())) {
                            // all Units ,only actors in that case, lv up
                            battleunit[1].gainLevel(X) ;
    
                        }
                  
                        }
                        return true;
                    };
    to call the Function than you can use that (because its a game interpreter function):
    this.allAxTest();

    Or you can use only the code in a Script without making it a function that can be called:

    JavaScript:
                        // code below checks all Map events
                        for (var i = 1; i <= $gameMap.events().length; i++) {
                        // code below define a BattleUnit (battler part of Unit)
                        var battleunit = $gameSystem.EventToUnit([i]);
                        // code below define a EventUnit (Event Part of the Unit)
                        var eventunit = $gameMap.event([i]);
                        // code below asks if the Unit is an Actor and If its NOT Dead
                        // it also checks if the "Event" and the "Battler" are the same Unit
                        if (battleunit && eventunit && (battleunit[0] === 'actor') && (!battleunit[1].isDead())) {
                            // all Units ,only actors in that case, lv up
                            battleunit[1].gainLevel(X) ;
                            // "battleunit[1)" is the battler, because "gainLevel(X)",
                            //  is a battler Function, events cant do that..
                        }
    
                        };

    Sry my JS knowledge is also nooby so i cant really teach it..
    ( i was just curius why boomy made that extra function because i thought it would not be needed, but there are often several ways to do the same thing..)
  16. ( i was just curius why boomy made that extra function because i thought it would not be needed, but there are often several ways to do the same thing..)

    I was working off the assumption of @Diz89 only using srpg_core. I don't use srpg_unitgroups myself as I have my own version and I didn't even know there was a script like that already.
  17. That did the trick @Dopan

    I copied your last script (as I don't use the other Plugin right now) into a common event and called it in the afterAction event.

    Thx for the great help an the steps through my problems!
    Just the strange movement behaviour stays and some friendly german coder already took the job and said, that there really might be a problem, how the eventspawner (Galv) handles the coordinates with his preserved state (which I need).
  18. Diz89 said:
    That did the trick @Dopan

    I copied your last script (as I don't use the other Plugin right now) into a common event and called it in the afterAction event.

    Thx for the great help an the steps through my problems!
    Just the strange movement behaviour stays and some friendly german coder already took the job and said, that there really might be a problem, how the eventspawner (Galv) handles the coordinates with his preserved state (which I need).
    of course it did^^

    well i dont use the "preserved state"..
    ( i think you mean what galv calls: "
    s = true to save event")
    That might explain why i got no idea about that issue..
  19. ( i think you mean what galv calls: "s = true to save event")
    That might explain why i got no idea about that issue..
    Oh yeah!My bad!

    I mean in his description the true/false boolean to save an event on the map or not.
  20. Diz89 said:
    Oh yeah!My bad!

    I mean in his description the true/false boolean to save an event on the map or not.
    if you really need that " save an event "- stuff.. your german coder, or you can write me a private message in german and explain the problem, perhaps i can help to solve it..