Hi!
I am having an issue creating a custom select condition with Yanfly's Selection Control. I think I am on the right track, as the code works to an extent, but I can't get it work as I would like.
I have 5 party members; one each in a separate row (row 1 to 5). For context the rows are arranged horizontally rather than vertically (think of rows like in Plants vs Zombies). I also have 5 enemies, one in each row also (set using default row notetag). They are both lined up facing each other with player 1 facing enemy 1 and so forth.
I have a skill that I would like to restrict targets to enemies/players in the same row OR adjoining rows. i.e player character in row 3 can use the skill on an enemy in row 2, 3 and 4, but not 1 or 5.
I have come up with code below;
<Custom Select Condition>
if (target.row() >= user.row()) {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>
The problems I have are as follows;
1. I cannot have the character/enemy attack their corresponding character/enemy on the same row by using '==' or '==='. The skill is greyed out i.e not meeting the condition.
2. Using the above I can have the character/enemy attack their corresponding character/enemy on the same row, but also those in rows 'higher' that those. i.e player character in row 3 can use the skill on an enemy in row 3, 4 or 5.
I have used 'battler.row()' in lieu of 'target.row()' or 'user.row()' which brings up an error. My first attempt at was as follows and did not work probably for the same reasons as problem 1 listed above;
<Custom Select Condition>
if (target.row() === user.row()) {
condition = true;
} else {
if ((target.row() === user.row()) + 1) {
condition = true;
} else {
if ((target.row() === user.row()) - 1) {
} else {
condition = false;
}
</Custom Select Condition>
Any assistance would be greatly appreciated.
I am having an issue creating a custom select condition with Yanfly's Selection Control. I think I am on the right track, as the code works to an extent, but I can't get it work as I would like.
I have 5 party members; one each in a separate row (row 1 to 5). For context the rows are arranged horizontally rather than vertically (think of rows like in Plants vs Zombies). I also have 5 enemies, one in each row also (set using default row notetag). They are both lined up facing each other with player 1 facing enemy 1 and so forth.
I have a skill that I would like to restrict targets to enemies/players in the same row OR adjoining rows. i.e player character in row 3 can use the skill on an enemy in row 2, 3 and 4, but not 1 or 5.
I have come up with code below;
<Custom Select Condition>
if (target.row() >= user.row()) {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>
The problems I have are as follows;
1. I cannot have the character/enemy attack their corresponding character/enemy on the same row by using '==' or '==='. The skill is greyed out i.e not meeting the condition.
2. Using the above I can have the character/enemy attack their corresponding character/enemy on the same row, but also those in rows 'higher' that those. i.e player character in row 3 can use the skill on an enemy in row 3, 4 or 5.
I have used 'battler.row()' in lieu of 'target.row()' or 'user.row()' which brings up an error. My first attempt at was as follows and did not work probably for the same reasons as problem 1 listed above;
<Custom Select Condition>
if (target.row() === user.row()) {
condition = true;
} else {
if ((target.row() === user.row()) + 1) {
condition = true;
} else {
if ((target.row() === user.row()) - 1) {
} else {
condition = false;
}
</Custom Select Condition>
Any assistance would be greatly appreciated.