Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
95
Reaction score
16
First Language
English
Primarily Uses
RMMV
Hello, everyone! Just wanted to know how to do something with the plugin in the title. Basically I want to apply certain states if other ones are already affecting the target. So if "poison 1" is affecting the target, then next time I cast the same ability I want the target to be affected by "poison 2." The plugin in the title is supposed to do this, but I can't figure out how. You're supposed to write this in the notes of the "poison 0" state. The 0 state is like a placeholder that "decides" what state is to be applied.

if (a.isStateAffected(4)) {
5;
}
else {
4;
}

And it works, but just for going from "poison 1" to "poison 2." I can't make the states go from "poison 2" to "poison 3."

Please help me with this.

The page of the plugin is this one.
http://himeworks.com/2016/01/placeholder-states/

Oh, and I think this plugin is supposed to work with this other one:
http://himeworks.com/2015/11/overriding-states/

It just makes a state be able to erase other states.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,717
Reaction score
9,876
First Language
German
Primarily Uses
RMMV
you need to make the code a series of if commands instead of only a single if command. And the conditions need to be ordered from highest to lowest, like
if state poison 2 then afflict poison 3
if state poison 1 then afflict poison 2
if no state then afflict poison 1
 

Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
95
Reaction score
16
First Language
English
Primarily Uses
RMMV
you need to make the code a series of if commands instead of only a single if command. And the conditions need to be ordered from highest to lowest, like
if state poison 2 then afflict poison 3
if state poison 1 then afflict poison 2
if no state then afflict poison 1

Thanks a lot for your answer. Now I'm learning the logic behind this. Nevertheless, I can't make it work yet. What am I doing wrong?


<placeholder state>
if (a.isStateAffected(2)) {
3;
}
else {
if (a.isStateAffected(1)) {
2;
}
else {
1;
}
</placeholder state>

EDIT: It throws this error: SintaxError (unexpected end of imput)
 
Last edited:

Gargoyle77

Veteran
Veteran
Joined
Dec 4, 2017
Messages
95
Reaction score
16
First Language
English
Primarily Uses
RMMV
you're missing a }
each { opened requires a closing } or it will cause errors.

Yeah, that's it! Now it works perfectly! Thank you very much for all your help. Have a nice day friend!
 

Angelus197

Villager
Member
Joined
Sep 24, 2020
Messages
12
Reaction score
1
First Language
Español
Primarily Uses
VNM
I can't get it to work. I just want that if the character has a state, when applying the same state, this state is removed and a new one is applied.

if (a.isStateAffected (1)) {
2;
}
más {
1;
}

If 1 is the poison state and 2 is poison+, when I apply state 1 it does not go to state 2. What am I doing wrong ... I don't understand.
 

Latest Threads

Latest Profile Posts

Pirate portrait quickie :LZYcheeze:
pirate.png
My game has a (much needed) tutorial now...
Game Making Every Day #20:kaohi:

ScreenShot_8_14_2022_11_55_51.png
FINALLY added the comic bubble to the Title Screen...

Forum statistics

Threads
124,507
Messages
1,164,110
Members
163,333
Latest member
TheWarDon
Top