Skill Change

This script allows you to set an action to execute a different skill if certain conditions are met, with some probability. The condition is a formula that can use any game data available, including the action’s user as well as the action targets.


For example, if your actor’s HP is less than 50%, then there might be a chance that each attack will be a special “critical attack” instead.


Or your attack skill might change depending on what weapon you're using, or a different skill is executed depending on whether the target has a particular state or not.


Download


Get it at Hime Works
Oh ho ho! This is fantastic! Just think of the possibilities!

I may have a mighty fine use for this myself!
this is really awesome... 
It would be more awesome if the skill could be changed for each individual target (in the case where your action hits multiple targets), but that would require me to rewrite the action processing methods in the battle scene.
yeah, that seems a bit troublesome to do than a single change...
A good example of what this can be used for is something that I needed for my game, making the Attack skill change to a dummy-Attack skill that will deal 0 damage against a specific enemy ID. (Because in my plot my Human-character can't harm a Demon-character without a specific key item)
or you can simply do that in the damage formula I think as you don't really need a completely new skill for that since you only need it to deal 0 damage...

I think this is more usable for when you need a completely different skill (like different elements, different animations etc)
Yeeeeah but typing that out in the damage formula with them ifs ands or buts takes up processing time.

Not sure if the whole thing would even fit though, being that it only holds 100 characters.  My Attack formula is somewhat lengthy already.
or you can simply do that in the damage formula I think as you don't really need a completely new skill for that since you only need it to deal 0 damage...


I think this is more usable for when you need a completely different skill (like different elements, different animations etc)
What about a skill that adds a state depending on who the target is?


Or a skill that performs some special logic depending on who the target is?


You can write everything into the damage formula because it has the full power of ruby, but on the other hand it might be cleaner to use separate skills.


What if you had a script that allows you to have a skill target both allies or enemies, but you want different things to happen depending on whether the target is an ally or enemy?


Or perhaps you have a skill that does the following


1: if dead, revive


2: otherwise, restore full HP


While a damage formula has the full power of ruby backing it, it also has its limitations (eg: if you don't hit the target, it doesn't run)
Those are included in the needs completely different skill, because well, it probably won't really fit in the formula bar anyways... assuming you are doing conditions for more than 1 enemy

1: if dead, revive2: otherwise, restore full HP
I would probably want a different animation for those skills... make revive somehow more "dramatic"... 

I'd use your script for anything else that isn't a simple: if enemy.id == blahblah, damage1, else damage2...
You can write everything into the damage formula because it has the full power of ruby, but on the other hand it might be cleaner to use separate skills.
Mmmhmm, this right here. It looks a lot more cleaner and easy to manage.
If timer count >= 600 && <= 300, use a certain skill

else if timer count < 300 use another skill

(pseudo-code btw)

Edit: oh snap accidental double post, I thought tsuki made a reply.
I have an idea... this might be usable to recreate the geomancer class (the skill of the class differs depending on the terrain in the target area) of FFT if coupled with some custom script to save the tileset or the individual tiles... 
I have an idea... this might be usable to recreate the geomancer class (the skill of the class differs depending on the terrain in the target area) of FFT if coupled with some custom script to save the tileset or the individual tiles...
You could store tile ID's or region ID's using script calls.


You could even copy the relevant methods over from the Tile Swap script so that you can use the user-friendly tile ID convention.
yeah, that's my idea... I said custom script since if I'll do random encounters then I'll need to put those into the script that processes random encounters, so custom script... XD... anyway, it's good to know that it's totally possible to do using this...

and if ever you could do the per target skill change, that brings up a whole lot of possibilities...
If I change it to per-target I could get rid of the need to index the targets as an array (because there would only be one target), which would make things much easier for the user cause indexing an array of targets that could be empty is not very safe...


EDIT:


I've made it so that a skill can support multiple skill change note-tags.


Per-target skill change mode is added. Or at least, something that looks like it.


If per-target mode is on, then `b` is a single target. If it is off, then `b` is a list of targets.


You can turn it off in the configuration by turning off the option. You should turn it off if you don't intend to have multiple target scopes for any skills that will use the skill change property.


The implementation is at the very bottom of the script. If anyone can think of a better way to handle it that would be great.


It changes the way animations are done by processing each target one at a time, rather than showing animations for all targets, and then calculating damage for each target. This is where the compatibility issues come in because that may not be desirable.


Furthermore, it doesn't function the same way as the original skill change. Because the skill changes depending on the target, the actual skill used by the user is the skill you picked, not the skill that it automatically changes to. This means that the skill use message is for the selected skill.


So the add-on basically changes how it works for the most part.
I'm sorry, but I just don't understand how to install all of this properly.  And it's causing me no end of frustration.  I understand where to install the script itself, but adjusting the Skill id's doesn't make sense to me...
The script is plug & play. All you have to worry about are the notetags. What exactly are you trying to do? I can give another example...

If I put the following in the Notes of a skill...

<skill change>

id: 13

chance: 1.0

condition: b[0].state?(27)

</skill change>

 

That means skill # 13 will be triggered 100% of the time if the target has state # 27 applied. I thought it was pretty simple to understand.
What should I do if I want to change a skill based on the state of the one using a skill? In other words if the attacker has a certain state applied how can I get the skill to change?

Original thread: https://forums.rpgmakerweb.com/threads/skill-change.18479/