Code to check if a specific skill is used?

Magusalfador

Veteran
Veteran
Joined
Jun 15, 2014
Messages
240
Reaction score
41
First Language
English Spanish
Primarily Uses
I want to check if a specific skill is used during battle, if so, have a different result than a regular one.

This looks like simple, but i cant find the code anywhere.

Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You need to be more specific - it's not the checking if the skill is used that's going to be difficult for you - it's the having a different result. So explain what you mean by that, and also describe how this specific skill is set up - what's its damage formula?
 

Magusalfador

Veteran
Veteran
Joined
Jun 15, 2014
Messages
240
Reaction score
41
First Language
English Spanish
Primarily Uses
Oh, sorry about that.
Im using various Yanfly Plug ins, one of them is the Buff State core.

So I have the following code on my statebox:
Code:
if (this.isPhysical())  {
this happens }
The thing is I have a Steal skill that does not make damage (so its not considered physical) but I want the "this happen" to process.

So im guessing that the code:
Code:
if (this.isPhysical()) || CodetoCheckSkillIDhere {
this happens }
Should acomplish what im looking for

Thanks!!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Sorry, can't help you further, as I'm not familiar with Yanfly's plugins.

However, it would be
Code:
if (this.isPhysical() || CodeToCheckSkillHere) {
this happens }
rather than what you've got - the entire condition must be within (), not just the first part of it.
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
I think you can use this:
Code:
if (this.isSkill() && user.currentAction().item().id === x){ //where X is your skill ID
do something
}
 

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,860
Messages
1,017,038
Members
137,567
Latest member
sashalag
Top