Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
I am using Yan's Buffs and States core... I'm trying to figure out how to execute some events if the state is being added to an enemy. Something like this:

<Custom Apply Effect>
if (state being added to = troop/enemy)
{
do such and such
}
</Custom Apply Effect>

I was doing some research but couldn't find anyone with similar problems.
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
576
Reaction score
147
First Language
Engilsh
Primarily Uses
RMMV
What exactly are you trying to do because Custom Apply Effect applies when the state is applied
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
661
Reaction score
283
First Language
english
Primarily Uses
RMMV
sounds like they trying to get common event to run when state is applied to an enemy.
but buff/state core isnt even needed for that.
can have the skill that is adding the state also run common event.
whether the event is triggered by the skill or a custom apply effect it would still be the same thing,
the event would need a series of conditional check to figure out which enemy the state was applied to and then do stuff to that enemy.
this is usually just done with an invisible "target" state and the event checking for that state.
(remember to remove the target state with the event too.)

custom apply effect would be used to skip the whole event checking each target for the state before doing stuff and just do the stuff directly.
for someone to help with that coding we would need to know exactly what the event was intending to do to the target.
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
What exactly are you trying to do because Custom Apply Effect applies when the state is applied
Well, I'm basically just trying to figure out how to check if the state is being applied to an enemy. If it is being applied to an enemy, run some code. This code is only to be processed if a certain variable is enabled, in this case, a special party skill called Vampire which is a skill that works only using code and variables.

I'm just basically just trying to figure out how to check if the state is being applied to an enemy so it runs this code only once per enemy it is applied to.

-Edit-
Knowing how to do so will also help me with keeping track of variables that check how many enemies have been applied with X state to complete achievements or something.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
913
Reaction score
576
First Language
English
Primarily Uses
RMMV
A <custom apply effect> only happens if the state was successfully applied, so anything you put inside that tag will only happen if the state had been successfully applied. The script inside can safely assume the state had been applied, otherwise that block of code wouldn't be running.
Code:
<custom apply effect>
console.log('state applied!')
</custom apply effect>
Putting just this example will show that the text only shows up in the console if the state has been applied successfully. So if an enemy resists it, this code doesn't happen at all.
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
245
Reaction score
41
First Language
English
Primarily Uses
RMMV
A <custom apply effect> only happens if the state was successfully applied, so anything you put inside that tag will only happen if the state had been successfully applied. The script inside can safely assume the state had been applied, otherwise that block of code wouldn't be running.
Code:
<custom apply effect>
console.log('state applied!')
</custom apply effect>
Putting just this example will show that the text only shows up in the console if the state has been applied successfully. So if an enemy resists it, this code doesn't happen at all.
Lmao, I understand how it works, I just need to know how to check if the state was applied to an enemy and not to an actor since both can receive this state. But I want to check if it's the enemy receiving it, and if it is, then do so and so.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
913
Reaction score
576
First Language
English
Primarily Uses
RMMV
Gotcha.
Code:
<custom apply effect>
if (target.isEnemy()){
    //do stuff
} else {
    //do other stuff
}
</custom apply effect>
 

Latest Threads

Latest Posts

Latest Profile Posts

Dragonfly3116 wrote on Redweaver's profile.
i need to ask do you mind sending me a link to tutorial town an legend of ancients Please My new Email is necroboy1973@gmail.com
I Am A Member On The Site Here As Well If Your Still teaching Let Me Know Thanks Joseph
Added store elements.
44JtdpE5n4jQMFkSi7pACW.png

2uqvqT3uCWxcXAhlyZokxg.png

The next step will be to start making props (including distillers).
I just saw one of SigmaSuccor's RPG Maker news videos, it mentioned one of my plugins. Now I kind of wish I'd made a demo project for it, having nothing in that segment but a scroll down the code feels a little underwhelming given what the plugin COULD do. Except I suck at making demo stuff, and my testing project isn't fit for that. :(
Ok, to prepare for the GMTK Game Jam, I'm trying to make a game with the theme "The Cat's out of the Bag" in about 48 hours. I'd make a forum post with a question, but I don't have the time!
Worked over a week on a new BGM, and I'm finally happy with it.

Here are some screenshots of the area it will be used in
EzLHppdVIAMY7DP


EzLHpqsVIAEZ7jt

Forum statistics

Threads
110,517
Messages
1,053,892
Members
143,609
Latest member
ryuokami
Top