YEP - Row Formation (Lunatic Mode)

Hi everyone!


Im having a bit of trouble with the Row Formation scripting. First I'll show what I have right now.


<Physical Taunt>
<Custom Row Condition>
if ($gameTroop.rowAliveSize(1) == 0) 
        {
          if ("Is a troop in row 2") // This is what I need help with
          {
             condition = true;         
          } 
          else 
          {
          condition = false;
          }
        } 
    else    
        {
        condition = false;         
        }
</Custom Row Condition>


I've been working on this for a little while now I cant seem to get it right. I want the troops in row 2 to get a custom condition when the troops in row 1 die.


There have been a few examples on here but they don't really work the way that I need. If you remove the inner if/else statement but keep the "condition = true;" what you get is BOTH troop and party members in their respective row 2s get the condition (Because ($gameTroop.rowAliveSize(1) == 0) is true).


I added the extra if statement to add an argument that asks if its a troop and not an actor.


I've tried so many different things and when I think I've found it I actually just make a statement that is always true haha...
<Physical Taunt>
<Custom Row Condition>
if (user.isEnemy()) {
if ($gameTroop.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
</Custom Row Condition>


This way, enemies in row 2 get the state if all enemies in row 1 died(or row 1 doesn't exist), your party will never get this state.


Edit: Sadly for the equivalent for actors I only get an error:


<Physical Taunt>
<Custom Row Condition>
if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
</Custom Row Condition>


The problem is very likely this: "$gameParty.rowAliveSize(1) == 0", although this is similar to the line Yanfly wrote in the help file.
<Physical Taunt>
<Custom Row Condition>
if (user.isEnemy()) {
if ($gameTroop.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
</Custom Row Condition>


This way, enemies in row 2 get the state if all enemies in row 1 died(or row 1 doesn't exist), your party will never get this state.

Thank you so much! It was so simple!


I just had to add an extra


else
    condition = false;
To the end for it to work! 😀

If I change .isEnemy to .isActor and $gameTroop to $gameParty for it to work the opposite way correct?


Thank you so much! I wasn't expecting an answer so fast! I really appreciate it! 🙂


Edit: Haha I didnt see your edit 😛.
Edit: Sadly for the equivalent for actors I only get an error:



<Physical Taunt>
<Custom Row Condition>
if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
</Custom Row Condition>


The problem is very likely this: "$gameParty.rowAliveSize(1) == 0", although this is similar to the line Yanfly wrote in the help file.



What does the error say?
The error is:


Range Error
Maximum call stack size exceeded


@Mackyoh yeah, forgot the last line, but it should work without it as well
The error is:



Range Error
Maximum call stack size exceeded


@Mackyoh yeah, forgot the last line, but it should work without it as well



I dont get the error.


It's working for me.


Can you show me a screenshot from the state with that tag and the plugin parameters?
I got the error too but got around it by adding:


if($gameVariables.value(1) == 1)


{


if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}




}


else{


condition = false;


}


</Custom Row Condition>


Then i changed the in game Variable 1 to 1 once I loaded into a New Game.


Sorry about the formatting. Im on my phone.
Do you have the newest version of this plugin? 1.07?
I have 1.07.


Now that I'm home and on my laptop, this is the code I use for the actors:


<Custom Row Condition>
if($gameVariables.value(1) == 1)
{

if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
else
condition = false;
}
else
{
condition = false;
}
</Custom Row Condition>
<Physical Taunt>


I do not get the error when this. Since variables are 0 or something on the Title Screen.


Im sure its the "$gameParty.rowAliveSize(x)"
I do not get the error when this. Since variables are 0 or something on the Title Screen.


Im sure its the "$gameParty.rowAliveSize(x)"



Can you make a screenshot of the page where you're using that code?


'cause I'm using the following without any error.

Code:
<Physical Taunt>
<Custom Row Condition>
if (user.isActor()) {
  if ($gameParty.rowAliveSize(1) == 0) {
    condition = true;
  } else {
    condition = false;
  }
} else {
  condition = false;
}
</Custom Row Condition>
That code will give you an error. 


To get everything to work correctly:


-Create 2 new states


-On the first map that appears (the map that appears when you press new game),
create an event with a parallel process. In this event make it change a variable to 1. Make sure you note the Variable ID.


-Put this in one of the state's note box and change the "VARIABLE ID HERE" to the ID that you selected above.


<Custom Row Condition>
if($gameVariables.value(VARIABLE ID HERE) == 1)
{

if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
else
condition = false;
}
else
{
condition = false;
}
</Custom Row Condition>
<Physical Taunt>


-And put this in the other state (No extra setup for this one)


<Physical Taunt>
<Custom Row Condition>
if (user.isEnemy()) {
if ($gameTroop.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
else
condition = false;
</Custom Row Condition>




Remember to make sure you add those state IDs into the Row 2 States in the plugin setup


Now it should work.
Can you please upload your project?


I still don't get a error, even without

Code:
if($gameVariables.value(VARIABLE ID HERE) == 1)
{
Its ok, I just updated some of my other Yanfly Engine Plugins and I stopped getting the error.
Can you please upload your project?


I still don't get a error, even without



if($gameVariables.value(VARIABLE ID HERE) == 1)
{



Here, just add the img and audio (had to delete them to make the file size smaller) folders yourself and run.

I found that when the PartySystem is on it throws the error, Yanfly says that there is nothing wrong with the plugin and says its the syntax of this code is wrong:
 


<Custom Row Condition>

if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
else
condition = false;

</Custom Row Condition>
<Physical Taunt>




View attachment Test.rar
Here, just add the img and audio (had to delete them to make the file size smaller) folders yourself and run.

I found that when the PartySystem is on it throws the error, Yanfly says that there is nothing wrong with the plugin and says its the syntax of this code is wrong:
 



<Custom Row Condition>

if (user.isActor()) {
if ($gameParty.rowAliveSize(1) == 0) {
condition = true;
} else
condition = false;
}
else
condition = false;

</Custom Row Condition>
<Physical Taunt>




View attachment 32938



Ok, now we're getting closer to the problem.


You didn't say that you used the PartySystem plugin, too.


And that one of your actors has the default row notetag.


I wrote three ways you can use to get it working with the PartySystem plugin.





/EDIT:


Alright, there is an easier way for that problem.


Just paste this inside one of your party member's notetag:


<Custom Row Condition>
condition = user.friendsUnit().rowAliveSize(1) < 1;
</Custom Row Condition>


That way, you won't get the stack error anymore.
Hi everyone! I will use this forum to ask something too about Row Formation. I wonder if someone can help me to give a start for a mechanics that I want to test in my game. I would like that every character meet a condition move to a specific row. For example: If a character is full HP it will be in front line, on half HP the character automatically slide back in second line and so on. I'm sorry I cant provide any code write by me because my java skills are very little 🙁

Original thread: https://forums.rpgmakerweb.com/threads/yep-row-formation-lunatic-mode.57822/