NickTheBrick

Regular
Regular
Joined
Sep 2, 2018
Messages
43
Reaction score
3
First Language
English
Primarily Uses
N/A
For starters, I am using the Yanfly Row Formation Plugin for my actors, and I have 3 of them in a party.
I wish to have one of the characters use a skill that gives every alive party member that is in row 1 a specific state.
I tried to experiment with certain script calls and common events, such as this


$gameParty.rowAliveMembers(1).addState(3)

And I know that the plugin identifies that there are actors in the front row, but the game identifies them as [object, Object] rather than the actors name.

So I know the plugin identifies that someone is in the first row, but it cant seem to specify who.
Would someone be able to help me out with this, feel free to ask any more questions.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,693
Reaction score
11,265
First Language
English
Primarily Uses
RMMV
$gameParty.rowAliveMembers(1).addState(3)
That's not valid syntax - rowAliveMembers() will return an array, but addState() is a method of the Game_Actor object.

In order to use addState(), you need to be referencing one specific element of the array, such as $gameParty.rowAliveMembers(1)[0].addState(3)

If you want to apply the state to every actor in that array, you can use JavaScript's built-in array functions.

Code:
$gameParty.rowAliveMembers(1).forEach(actor => actor.addState(3))
 

NickTheBrick

Regular
Regular
Joined
Sep 2, 2018
Messages
43
Reaction score
3
First Language
English
Primarily Uses
N/A
That works, thank you so much.
For something else I was wondering, I know that each row can have its own states.
Would it be possible to have a lunatic state event happen from getting these states when you move into these rows?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,693
Reaction score
11,265
First Language
English
Primarily Uses
RMMV
Yanfly's Buffs and States Core has documentation for Custom Add and Custom Remove Effects.
 

Latest Threads

Latest Profile Posts

Updated my game's development post with the first video of it in action!


'Milestone Get!' :p
Heh, heh. I've been experimenting with a naughty word detector Common Event and using scripts to check certain strings. I never thought I would see such language in computer code. I would post a screen shot, but it probably wouldn't be appropriate, even with a Spoiler. But it certainly makes me laugh and it works great.
Yknow what? Im seriously considering recruiting a manager to oversee my games development.
Because I cannot focus or complete these tasks by myself. I need someone to give me orders, without having them be my boss.

Forum statistics

Threads
136,806
Messages
1,270,212
Members
180,561
Latest member
BlueLotus
Top