Adding state after other state removed

Mcwill

Villager
Member
Joined
Oct 12, 2016
Messages
6
Reaction score
2
First Language
English
Primarily Uses
Hello,

I've been trying to system in which a state will be added as soon as another wears off from walking so many steps outside of battle. I'm trying to use Yanfly's Buffs and States core to do this using the <Custom Leave Effect> script call.

So far, I've been trying to use $gameActors.actor(actorId).addState(n); to add the state, but I have no clue what to enter in the actorId spot that would select the actor that the new state needs to be applied to.. It works if I enter a static number, like 1 or 2, but that's not ideal.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
How does Yanfly's plugin refer to "this actor"? If you knew that, you wouldn't need to use $gameActors.actor(actorId) at all, and could reduce it to thisActor.addState(n). A link to the plugin would help (that would always be a good idea to include when you're asking for help with plugins).
 

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,317
Reaction score
818
First Language
English
<Custom Leave Effect>
a.addState(x)
</Custom Leave Effect>

EDIT: Actually...I'm not 100% sure if this will work outside of battle.
EDIT#2: Just tested it myself, and it doesn't work outside of battle.
 
Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
776
Reaction score
487
First Language
English
Primarily Uses
RMMV
this.addState(x)
The <Custom Leave Effect> uses 'this' as a stand in for the battler afflicted with the state.
 

Mcwill

Villager
Member
Joined
Oct 12, 2016
Messages
6
Reaction score
2
First Language
English
Primarily Uses
My bad, I assumed everybody already knew all about his plugins, but it's this one - http://yanfly.moe/2015/12/25/yep-50-buffs-states-core.

I just tried testing out this.addState(). It's not giving an error anymore, but it still didn't apply the state that I asked it to. I'm starting to think it's only meant for combat.

I'm looking into Hime's plugin. Seems more user friendly for those of us who know next to nothing about scripting.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
yeah, everybody knows about them, but not everybody uses them or knows exactly where to look. It's just easier if you always include a link to the plugin when you're asking for plugin help.
 

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top