YEP - Row Formation (Lunatic Mode)

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
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...
 

gokuby

Veteran
Veteran
Joined
Nov 2, 2015
Messages
96
Reaction score
14
First Language
German
Primarily Uses
N/A
<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.
 
Last edited by a moderator:

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
<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! :D

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 :p.
 
Last edited by a moderator:

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
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?
 

gokuby

Veteran
Veteran
Joined
Nov 2, 2015
Messages
96
Reaction score
14
First Language
German
Primarily Uses
N/A
The error is:


Range Error
Maximum call stack size exceeded


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

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
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?
 

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
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.
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Do you have the newest version of this plugin? 1.07?
 

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
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)"
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
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>
 

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
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.
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
Can you please upload your project?


I still don't get a error, even without

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

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
Its ok, I just updated some of my other Yanfly Engine Plugins and I stopped getting the error.
 

Macky

Villager
Member
Joined
Jun 1, 2014
Messages
14
Reaction score
3
First Language
English
Primarily Uses
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
 
Last edited by a moderator:

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
82
First Language
German
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.
 
Last edited by a moderator:

Witchcat

Villager
Member
Joined
Feb 6, 2016
Messages
10
Reaction score
1
First Language
Italian
Primarily Uses
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 :(
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top