How do I change elemental damage type for a turn? <Solved>

Status
Not open for further replies.

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
Hey gang!

So, I've got an idea for a skill. When an actor uses it, it displays the six elements my game uses in a list, and the player picks one of the options.

Then, they receive a state (one for each option) which changes the damage type of their spells to that element for the remainder of the current turn. (I'm using one of Yanfly's plugins so the player's turn doesn't end after they use this skill, and another to prevent them from using this skill multiple times in one turn.)

Here's where it gets tricky: All of the spells in the game already have an element assigned, some more than one (again, thanks to a Yanfly plugin), and it's important that this state overwrites those elements for the remainder of the turn. Additionally, it is crucial that this state only changes the damage element of spells (ie magical attacks) to that element, and not physical attacks or certain hits.

Is there a way to do this without adding a new plugin to the list? If not, is there a plugin out there already that can solve my problem? Any help at all would be greatly appreciated. Thank you :)
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
I suspect this would be difficult to do without a plugin. As every skill exists only once, changing the element of a skill for one actor will change it for every actor. So if another actor was to use a magical skill on the same turn it would also have it's element changed which I assume is not the desired result.

I don't know of any plugins that will allow you to do this unfortunately.

Depending on the number of magical attacks this skill would affect it might be worth considering setting up duplicate skills each with their element changed (this might not be viable if you have a lot of skills and a lot of elements). You could then have your element changing skill add a state to the actor for one turn, then have each of the original magical skills force one of the duplicate actions depending on what the element is if the actor is affected by said state.

Another approach which might cut out some of the work load would be rather than have a duplicate of every skill for every element, you could have one "changeable" duplicate which you can set the elementId of on the fly using a script when the element changing skill is used. The script would be something like this:

Code:
$dataSkills[x].damage.elementId = y
Where x = database id of skill
y = database id of element

Either way, this will be a lot of work. A plugin would certainly be better if it exists.
 
Last edited:

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
I suspect this would be difficult to do without a plugin.
I was afraid that might be the case, but I'm not particularly surprised that it is.

I don't know of any plugins that will allow you to do this unfortunately.
That is unfortunate. I'm starting to think that if nobody knows of such a plugin, I might have to simply remove the skill from the game and return to the drawing board.

Your suggestion is not feasible for my game, due in part to the reasons you yourself foresaw, but thank you for your time anyway. :)
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
Even if the plugin doesn't exist at the moment you could always create a plugin request for it. I'm sure someone out there has the know how.

EDIT:

I've had a quick nose around and I suspect you might want to have a further look at Yanfly's Element Core. There is the option here to use action sequences to force a specific element to skills.

FORCE ELEMENT: X

I admittedly haven't used Yanfly's action sequences but I'm sure you could use a conditional branch in conjunction with this to check for a state. The syntax might not be correct for use with action sequences, but something like this:

Code:
if (a.isStateAffected(y)) {
   FORCE ELEMENT: X
}
 
Last edited:

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
I've had a quick nose around and I suspect you might want to have a further look at Yanfly's Element Core.
That's actually the plugin I'm already using to have multiple elements for one skill, and at the same time, it's why I added the part about making sure that only magical attacks would be affected. If I'm correct (and please do tell me if I'm not as it would solve this problem) this "Force Element" command would affect magical and physical attacks, as well as certain hits.

However, I must admit that my knowledge of programming is... let's be nice and say "limited" rather than "non-existant", and I'm not sure how I would implement the above code into the game, regardless of whether or not it would actually work. I'm not even sure what these "Action sequences" are, or how they work. Can you tell me, or if it's easier, point me in the direction of some tutorial somewhere?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Action sequences are part of Yanflys battle engine which allows you to create custom action and effect sequences for skills.
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
I'd advise taking a look here to find out more about action sequences:

http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/ (last 30 seconds of video - but has help info at bottom)
http://yanfly.moe/2015/10/11/yep-4-action-sequence-pack-1/
http://yanfly.moe/2015/10/12/yep-5-action-sequence-pack-2/
http://yanfly.moe/2015/10/12/yep-6-action-sequence-pack-3/

I admittedly don't have much knowledge of the action sequences having not gotten round to working too much on my own games skills, but essentially they break down the stages of an attack and allow you to input custom commands at each step, like using different animations, or additional attacks etc.

I've checked and the use of conditional branches is laid out on the Battle Engine Core page so that should give you an idea of how to use that.

The force element command would change any skill, but only if you put it into its action sequence. You would only put the isStatedAffected() Force Element command into your magic skills.
 

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
Okay, so, I've installed all the plugins listed thus far, moved them into the correct order, and I've done some testing. Here are the results so far.

Code:
if (a.isStateAffected(Infuse - Wind)){
   force element : Wind
}
This code has been placed into the note section of a simple "fireball" style spell. I made a fire enemy, normally immune to fire and weak to wind, and first tested to see if the skill did no damage by default, which it did not.

Then, I applied the state Infuse - Wind, and used the fireball, and still no damage.

I changed the inputs from text to their numerical equivalents, and nothing changed.

I tried replacing the brackets at the start and end of (a.isStateAffected(Infuse - Wind)) with a $ at the start to mimic what I saw in the "If Else" section of the help section here, and still nothing.

I'm not sure what could be causing it to fail, and I'm fresh out of ideas for new things to test. At any rate, you fine folks have been a big help!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Normally, It takes IDs not names because the engine handles most database objects via their ID... So get the ID of your wind state, and of your wind element..

example, if you wind state is state #11

a.isStateAffected(11)

Also, did you also put that if() inside an action sequence tag? Im pretty sure it wont do anything unless you put it inside one, because thats the only time the plugin will know that you need to run it during the action sequence
 
Last edited:

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
The syntax is slightly different from actual JS with this plugin (for some reason), give this a try

Code:
<setup action>
if a.isStateAffected(id)
force element: wind
end
</setup action>
Substitute id with the database id of the state you're using.

Also @Engr. Adiktuzmiko Yanfly's syntax allows for names to be used instead of ids in these situations (at least according to the help files).
 

marbeltoast

Your future fish emporer
Veteran
Joined
Nov 11, 2018
Messages
80
Reaction score
28
First Language
English
Primarily Uses
RMMV
I've tested the above code and got a new error; it's telling me that "a" is undefined. I'm not sure if this will help matters, but I think it might be worth mentioning that only one character in my game can actually use this skill, so if there's a way to hard code it to affect them and them alone, then the problem is as solved as it'll ever need to be! Either way, I think we're close!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Normally, "a" only works for when the tag is evaluated during the damage formula because the damage formula evaluation designates "a" as the user.. Same thing for "b" as target.

Most yanfly notetags I've seen actually uses "user" and "target". :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

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

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,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top