Yanfly Skill Core: Custom Execution Effect

Status
Not open for further replies.

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
219
Reaction score
173
First Language
English
Primarily Uses
RMMV
Greetings,

I've been trying to use Yanfly's Skill Core plugin to create a skill with a custom effect that will check the current scene and then activate a switch if the skill is used from the menu. I am trying to have a skill that's usable in battle and on the map that will behave differently in each scene. After searching for a while last night, I ended with this:

<Custom Execution>
SceneManager.is(Scene_Skill) ? $gameSwitches.setValue((50), true) : $gameSwitches.setValue((50), false);
</Custom Execution>

*NOTE: I am not fixed on this one single method and, while this is something I am interested in learning, I am also open to alternative methods of achieving a similar result. I recently spoke with a fellow game maker who is working on the exact same concept and his result was to use 2 plugins, one that runs a group of events at the start of each battle and one that runs a set of events at the end of each battle. Personally I'd rather work with the skill directly and leverage a plugin I am already using.

Plugin link:
http://www.yanfly.moe/wiki/Skill_Core_(YEP)

Thanks!
 

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
219
Reaction score
173
First Language
English
Primarily Uses
RMMV
Maybe this?
Code:
$gameSwitches.setValue(50, SceneManager._scene instanceof Scene_Skill);
I.e. if on the skill scene, turn on switch 50, else turn it off. :)

In case you're interested, more details on the instanceof operator can be found here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof

It worked perfectly! Thank you so much!

Also, thank you for the link to the reference page. I am currently learning JavaScript and I'm just about done with the basics, every resource helps!
Thank you again for your help!
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,497
Reaction score
5,334
First Language
english
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top