Only one I could find is the Skill Replaces Skill script but I would need one that changes the skill depending on if a state is applied, as the actor can transform the attacks would have a different animation.
Skill replaces skill when state is applied?
RGSS3 Script RequestsEdit: Crap, just realized I ended up on the non-MV boards somehow. I'm not sure how much of this translates over to VXA or whatever this is for, so I'll leave it up anyway just in case yanfly has a non-MV equivalent of this. Sorry. 🙁
- - -
You can do that with Yanfly's skill core plugin using these note tags:
On the skill to swap out while the state is active:
<Custom Show Eval>
if (!user.hasSkill(NEW_SKILL_ID)) user.learnSkill(NEW_SKILL_ID);
visible = !user.isStateAffected(STATE_ID);
</Custom Show Eval>
On the skill to swap in while the state is active:
<Custom Show Eval>
visible = user.isStateAffected(STATE_ID);
</Custom Show Eval>
Replace NEW_SKILL_ID with the id of the skill that's going to replace the existing skill. Note that the actor will be taught this new skill permanently, but it'll never show unless the required state is active.
Replace STATE_ID with the state that's supposed to trigger the switch.
- - -
You can do that with Yanfly's skill core plugin using these note tags:
On the skill to swap out while the state is active:
<Custom Show Eval>
if (!user.hasSkill(NEW_SKILL_ID)) user.learnSkill(NEW_SKILL_ID);
visible = !user.isStateAffected(STATE_ID);
</Custom Show Eval>
On the skill to swap in while the state is active:
<Custom Show Eval>
visible = user.isStateAffected(STATE_ID);
</Custom Show Eval>
Replace NEW_SKILL_ID with the id of the skill that's going to replace the existing skill. Note that the actor will be taught this new skill permanently, but it'll never show unless the required state is active.
Replace STATE_ID with the state that's supposed to trigger the switch.
it doesn't, because the coding language is completely different - RGSS3 instead of Javascript.
And the notetag is completely dependent on a plugin as notes do nothing by default - there are notetags in VXA as well, but they also depend on the scripts installed in that editor.
@Morpheus an alternative that doesn't use any script or plugin would be to have the state seal the old skill and add a new skill by features of the state. Unfortunately that would not completely hide or replace the old skill, only disable it. For a true replace you'll need a script.
Something like this?
forums.rpgmakerweb.com
State Add/Remove Commands
State Add/Remove Commands v1.01 Shaz Introduction This script lets you enter RGSS script commands to be run when a state is added or removed. Like calling a common event when a state is added, or setting one state to be replaced by another after a certain number of turns. Versions Features -...
forums.rpgmakerweb.com
I'll try it out. I see it's your script, so, off the top of your head do you know the command to add/remove a skill?
It's just learn_skill(id) or forget_skill(id)
where id is the skill id, with no leading zeros.
(that wasn't off the top of my head - if I'd done that I would have gotten it wrong 😀 )
where id is the skill id, with no leading zeros.
(that wasn't off the top of my head - if I'd done that I would have gotten it wrong 😀 )
Challenge accepted I will make this possible.
Code:
class RPG::Skill
def custom_show_eval
unless @custom_show_eval
script = "return true"
load = false
note.split(/[\r\n]+/).each do |line|
case line
when /<custom show eval>/i
script = ""
load = true
when /<\/custom show eval>/i
load = false
else
if load
script += line
end
end
end
name = "custom_show_eval_ex"
eval("create_method(:#{name}) {#{script}}")
@custom_show_eval = true
end
custom_show_eval_ex
end
def create_method(name, &block)
self.class.send(:define_method, name, &block)
end
end
class Window_SkillList
alias skill_included? include?
def include?(item)
return skill_included?(item) && item.custom_show_eval
end
end
This notetag translates into
Code:
<custom show eval>
return !state?(STATE_ID)
</custom show eval>
Code:
<custom show eval>
return state?(STATE_ID)
</custom show eval>
Okay, it works however the thing we didn't account for was if the player has even learned the skill yet. Like let's say one skill that might change is unlocked at level 30 but the player can transform at level 15, if the player hasn't learned the skill yet then it gives them the skill.
Any idea of a workaround? Currently I'm using a common event to check all of this but the event will be quite long.
learn_skill(skill2.id) if @skills.include?(skill1.id)
forget_skill(skill1.id)
you don't need to do a test when forgetting, as if it's not learned, it just won't do anything.
So the above will learn skill 2 if skill 1 is learned, and will then forget skill 2.
forget_skill(skill1.id)
you don't need to do a test when forgetting, as if it's not learned, it just won't do anything.
So the above will learn skill 2 if skill 1 is learned, and will then forget skill 2.
I knew the language was different, but wasn't sure how much of a similarity existed between yanfly's note tags here vs MV. I know Yanfly did his thing before MV came around, but wasn't sure how much was directly ported over (and thus, similar tag usage) vs how much was brand new for MV.
Also, one could argue that MV's note tags are mostly reliant on plugins as well, since most plugin devs make their own note tag parsing functions for a number of reasons (case insensitivity, <tag></tag> style, etc)
Anyhow, hopefully I'm not derailing too much. Good luck to the OP. 🙂
Sorry it took awhile to reply back, I had to mess around with some settings to get this to do what I wanted as my actors will have varying levels of transformations but it all worked out in the end, thank you SO much for the script and the very fast help!
you misunderstood how those notetags work.
There are two different types of notetags (both in Ace and MV) - text-type notetags and eval-type notetags.
Text notetags would be handled completely by the script or plugin, and those could be identical depending on how the script or plugin was written.
Eval-type notetags (or 'lunatic' notetags as yanfly called them) however are only passed through the script or plugin and given to the language interpreter. They always have to be code-snippets in the language that the entire engine is written about, because the script or plugin does nothing with them, it just sends them on to the engine.
And that is why those notetags can never be transferred between Ace and MV without rewriting them into a different code language.
Err technically, they're both the same type of note tag, and its just the plugin/script/whatever that decides what the contents mean. There's nothing stopping a plugin creator from utilizing note tags that contain both standard text and eval snippets in the same tag, like so:
<Replace Attack>25, user.hp / user.mhp < 0.5</Replace Attack>
I mean yeah, I *know* the code portions of what I posted won't work with VXA and I should've probably been clearer with my "oops" edit. What I meant was that, if Yanfly had a VXA version of his skill core plugin with similar note tag functionality, the note tag contents could've been adapted for ruby or whatever it uses.
Original thread: https://forums.rpgmakerweb.com/threads/skill-replaces-skill-when-state-is-applied.118918/