Status
Not open for further replies.

Lief_Katano

Warper
Member
Joined
Sep 17, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Row Formation plug-in, though if there are other alternatives that would work I'd be fine with trying them.

Basically - in my game, I want to have up to five people in the party. You can have up to three people in the front row, and up to three people in the back row - leaving a space open in either case. (Think Final Fantasy IV, or any Etrian Odyssey.)

Is there a way to limit it so that you can't have more than three people in one row?
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
10
Reaction score
3
First Language
English
Primarily Uses
RMMV
From your description, it sounds like you only have two rows enabled via the plugin, correct?

If so, you can prevent players from moving more than three actors into a row via the row formation menu by adding code to Yanfly's cursorLeft and cursorRight functions.

For the cursorLeft function, after line 2341 where it says
Code:
if (actor.isRowLocked()) return SoundManager.playBuzzer();
add the following two lines of code:
Code:
var nRow = actor.row() - 1;
if ($gameParty.rowSize(nRow) >= 3) return SoundManager.playBuzzer();

Then for the cursorRight function, after line 2327 where it says the same thing
Code:
if (actor.isRowLocked()) return SoundManager.playBuzzer();
add the following two lines of code:
Code:
var nRow = actor.row() + 1;
if ($gameParty.rowSize(nRow) >= 3) return SoundManager.playBuzzer();
(Note that in the left function one must be subtracted from the actor's row and for the right function one must be added to the actor's row for it to work properly both directions.

There are some limitations I am aware of to this solution:
1) This only works if two rows are enabled. More rows should be possible to account for, but would require slightly more complex checks and some additional edits to the functions.
2) This solution prevents the player from manually moving more than three actors into a row, but it does not prevent the plugin from automatically assigning more than three actors to a row. If your game begins with more than three actors and you allow the plugin to simply place all your actors in the default row as set within the plugin parameters, the game will still begin with more than three actors assigned to that row, and I believe any actors added to the party later in the game will also be added to their default row, regardless of whether or not it already has three or more members. If there are only a small number of possible actors in your game, this can probably be resolved via actor notetags to adjust each actor's default row, but if you plan to have many different actors available, you may need a more involved solution.
3) This does not affect enemy row formations, but you can control for this using Yanfly's SetEnemyRow plugin command to control each enemy's row on the troop page by creating a tab with conditions: Turn 0 and span: Battle.
4) If you plan to have items and/or skills that can move the target to a different row, you would need to add additional checks to these in order to prevent moving more than three actors or enemies into a row. This should be fairly simple for items/skills that move only a single target, but may be more difficult if they move multiple targets.

I hope this helps! My javascript and game engine knowledge are fairly limited, so I'm not sure if I can provide much beyond this if it is not enough for your game :(
 

Lief_Katano

Warper
Member
Joined
Sep 17, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Excellent! This works like a charm! Thank you so much for all the help.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,758
Reaction score
15,316
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.



This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

unintentionally made a track that sounds straight out of Yume Nikki
Revisiting one of my older projects in a long time to work some more on the mechanics. I've been working on- and off-again for about a year now on recreating the Force and Mystic systems from Wild ARMs. And I think I've finally made some good breakthroughs on that!

Still, it is not perfect and I may post my thoughts at a later time to see if there are any other suggestions or alternatives I've missed.
actor name string, why you gotta be case sensitive like that?
Doing RPG Maker News for 26th October 2021

My entire world, full of monsters and treasures, will likely be done by the end of the year. After that it's all NPCs and side quests... then done. I'm never making an open world game again xD

Forum statistics

Threads
116,106
Messages
1,095,848
Members
151,505
Latest member
rensky
Top