[VXAce] How can I check if a specific party member has a state?

ConnedQuest

Warper
Member
Joined
Oct 27, 2021
Messages
3
Reaction score
1
First Language
English
Primarily Uses
RMVXA
In this case, the state I am looking for is Fallen, and in the eventing screen I only see a way to check if the actor has the state.
In my game, you can change the formation at will, and I want an enemy to stomp on the target with fallen (using force action, with a state that cancels their normal turn AI, which only lets me check party member index).
Sorry if its too wordy/poorly written, I'm new to using script and whatnot.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,321
Reaction score
8,755
First Language
German
Primarily Uses
RMMV
there is an eventing way to do this, but it's much longer.
you'll need an event that checks every party member for the state and then selects the fitting force action to act - basically one conditional branch for each party index with the different force actions inside.
 

ConnedQuest

Warper
Member
Joined
Oct 27, 2021
Messages
3
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Oh, jeez. That doesn't sound like much fun at all.
At that point I'd rather just have them just stomp randomly. Thanks man!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,321
Reaction score
8,755
First Language
German
Primarily Uses
RMMV
you can use scripts to automate that, but that will require at least some ability to understand scripts.
you can find those scripts in the pinned topic about script equivalents to event commands.
 

NhatNguyen

Peaceful Days Dev
Veteran
Joined
Sep 19, 2013
Messages
274
Reaction score
842
First Language
Vietnamese
Primarily Uses
RMVXA
I haven't got a chance to test this but you can try this code in troop event section.
Replace the 3 variables at the beginning to match with your game.
This piece of code is looping through your party then call force action on enemyIndex that will use skill_id to the party member that has been inflicted with state_id
Ruby:
enemyIndex = 0
state_id = 5
skill_id = 12
$game_party.battle_members.each_with_index do |member, index|
  if member.state?(state_id)
    params = [0, enemyIndex, skill_id, index]
    $game_troop.interpreter.instance_variable_set(:@params, params)
    $game_troop.interpreter.command_339 # Force action.
  end
end
 

ConnedQuest

Warper
Member
Joined
Oct 27, 2021
Messages
3
Reaction score
1
First Language
English
Primarily Uses
RMVXA
enemyIndex = 0 state_id = 5 skill_id = 12 $game_party.battle_members.each_with_index do |member, index| if member.state?(state_id) params = [0, enemyIndex, skill_id, index] $game_troop.interpreter.instance_variable_set:)@params, params) $game_troop.interpreter.command_339 # Force action. end end
Sorry if formatting sucks there. It works perfectly, thank you so much!
 

NhatNguyen

Peaceful Days Dev
Veteran
Joined
Sep 19, 2013
Messages
274
Reaction score
842
First Language
Vietnamese
Primarily Uses
RMVXA
Glad to hear that :p
 

Latest Threads

Latest Posts

Latest Profile Posts

"16. Do NOT contact other members by private message, on the forum or status feed, inviting them to put additional tools (such as leaderboards, ads, etc - whether yours or another person's) into their game."
Oh no. Necessity is the mother of invention. Do I want to know what happened?
Early WIP for my next entry. Since it's early you're going to need to wait a little longer than usual. What's that? You'll find out in my next update!
12.PNG
20 festive cards can now be unlocked in BiteMe!

The cards are permanent, but can only be unlocked in December!
Once the year is over, you won't be able to unlock the cards, or to upgrade it.
https://johndoenews.itch.io/biteme-storymodeCard141-160-Ad.png
Finally showing some updates again

Forum statistics

Threads
117,181
Messages
1,105,245
Members
153,307
Latest member
nyhkkbjyek
Top