RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Okay nevermind I'm being a huge noob with this. Realized the reason the state was staying the same is because I had the state setting set to something else which was preventing the state to end. Thank you Shockra and Naveed for your help. And sorry for my noobish designing haha I never would have noticed that I had inputing a single line of code wrong. I do however have one last quick question. I'm trying to have all basic attacks cause a state to occur but if skills are used that state won't be added. Haha any idea how I would do that? I swear it's my last question for this thread.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
Why not just give an add state effect in the attack skill?
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Well I'm trying to make an enemy who is weak against standard attacks and I wanted to do that by having standard attacks afflict the enemy with a state. I don't want all my attacks to have the state because I don't want all my standard attacks afflicting that state. I want it to be a weakness to that specific enemy. Yeah I'm using the RowsFormation Plugin so attacking with regular attacks won't be easy in case it doesn't make sense as to why I would ask this. Hope that made sense.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
So if I understand correctly, you want basic attacks to inflict a state on that specific enemy only?
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Yes that's correct. Sorry for the late reply Naveed. You keep finding a way to sum up my request in a simple sentence. XD
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
Give that enemy a passive state. Then, on the passive state, use this code:

<Custom Respond Effect>
if (this.isAttack()) target.addState(stateId);
</Custom Respond Effect>
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Okay I'm on it! Testing it right now.
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
And just like that it worked... I tried doing it myself and couldn't get it to work. Tried repurposing your previous line of code you gave me but to no avail. The funny thing is your line doesn't look that much different from mine. But you did use a different execution for it so I guess I'm just blind lol. Thanks for taking the time to help me once again. Appreciate the help and it's pretty late on my end too. +1 Like of course.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
You can post your line here. I'll look at it and see what went wrong.
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Oh sorry I didn't realized you had responded. Here was my incorrect code I tried to use.
<Custom Establish Effect>

if (this.isAttack()) {

target.addState(71);

}

</Custom Establish Effect>
I tried repurposing your original code you gave me before. I thought it might work because if the attack connects it would add the state. But I think I don't have a clear enough understanding as to what's going on with the Establish effects in the BuffStatesCore Plugin. I am curious why it didn't work however.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
You used <Custom Establish Effect>, so the code will run when the enemy attacks, not when it is attacked. To make the code run when the enemy is attacked, you have to use <Custom React Effect> or <Custom Respond Effect>. You should read through the help file of Yanfly's buffs and states core to understand which notetag you should use when. It has a clear explanation of when each code is run.
 

RPG Samurai

Veteran
Veteran
Joined
May 16, 2014
Messages
31
Reaction score
1
First Language
English
Primarily Uses
Okay that makes sense. Why didn't you have to use the "{" or "}" symbols in your coded version? You wrote the whole thing on a single line. Does that make any difference?
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
148
First Language
English
Primarily Uses
RMMV
It's sort of like a shorthand in coding. If there is only one line after the condition, you don't need curly brackets. So

Code:
if (this.isAttack()) target.addState(stateId);

And

Code:
if (this.isAttack()) {
target.addState(stateId);
}

Are both the same thing and are both correct.

However, if there is more than one line after the condition, curly brackets are mandatory:

Code:
Correct Code:

if (this.isAttack()) {
target.addState(stateId1);
target.addState(stateId2);
}


Wrong Code:

if (this.isAttack()) target.addState(stateId1); target.addState(stateId2);
 

Latest Threads

Latest Profile Posts

1620833447825.png
This is one of the most beautiful art styles I've seen... it's also the style I draw in... er.... what's this style called...?
Ami
This is the End of the Endurance,everyone are celebrating the end of their Endurance

I just wondering what Menu for Tomorrow
Two years into developing my game and I just scrolled through the BaseResource Pack that comes with MV for the first time xD I never knew how much awesome stuff was in there. Also so many names I know from the forum, like Shaz & Archeia ... and that's not the only resource pack I found in the depth of my hard drive :0 Right now I'm both confused and hyped about all the stuff I own.
Decided to start watching Naruto; and not only is it a genuinely good series, but it's also very inspiring.
I just wish Funimation got its act together and fix the missing dubbed episodes.

Forum statistics

Threads
111,290
Messages
1,059,979
Members
144,602
Latest member
sdzezzzs
Top