Changing variables with skills

Hi,


I've got a skill which I want to keep track of the usage of. In the skill's effects, along with it doing its thing I have tried to call a common event which increases a variable every time the skill is used. However, this common event never gets called during the battle, and waits until after the battle and all other events have finished before finally activating, which is useless. What this indicates to me is that common events called by a skill don't work at all how I was expecting them to. In that case, how do I keep track of the usage of a specific skill?


I've attached the skill sheet thing as an example. I just want to call that common event WHEN the skill is used.

sample skill.jpg
if the common event waits until after battle, then you have set that event to parallel process or something similiar. That doesn't work combined with the call command, the call command needs a CE that is not triggered by something else.

Please post a screenshot of the CE called so that we can check the error there

However, you can also change the variables by entering a script command into the damage formula - that depends on what the CE really does, as the damage formula field is limited and you need to know the script equivalents of the commands used in the common event.
if the common event waits until after battle, then you have set that event to parallel process or something similiar. That doesn't work combined with the call command, the call command needs a CE that is not triggered by something else.

Please post a screenshot of the CE called so that we can check the error there

However, you can also change the variables by entering a script command into the damage formula - that depends on what the CE really does, as the damage formula field is limited and you need to know the script equivalents of the commands used in the common event.
After you mentioned that, I found out what my problem is. It seems that the common event does not get called when you finish a battle with an ability that calls a common event. (I thought the problem was in my defense version of the skill, but it's actually in the attack version) In that case, the battle ends, the event seems to be delayed, and only occurs after everything else finishes.

So I guess I need to use scripting in the formula with the attack? Is there another way?

I need the event to be called on time regardless of whether or not it finishes the battle when you use the skill.

Edit: Just in case that wording wasn't super clear, I mean something like this:

  • Say you have a skill called "Punch"
  • Along with doing damage, it also calls the common event to increase the usage count of Punch's variable (see first post)
  • It you use it and DON'T win the battle from that attack, the common event is called and executes
  • If you DO win the battle from that attack, the common event is delayed until everything else finishes, including any events you were in the middle of before the battle
  • I want to check the number of times the player used the attack in a battle immediately after said battle, which means I need that last hit to count too and the delayed effect won't fire in time


cower event.jpg
From the sound of things I think what may be your problem is that by default battles end immediately after the last enemy reaches 0 HP.  This can be pretty frustrating if you are trying to trigger events after the last monster dies.

A way around this is change your enemies to an immortal state and end the battle manually when ever you are ready.  I also think Tsukihime made a script to help with this.  I will try to dig it up for you and post it here when I find it.

#Edited

Well I did find it.  But unfortunately my paste button is broken also so it seems and it won't let me copy and paste links.   I'll try typing it out and see what that does...

http://Himeworks.wor...phase-triggers/

Well the link doesn't seem to work.  But maybe that will give enough information you can find the script.  You can find a functioning link in the Leveling up in battle thread.  I posted a  link there a while back and it seems to still work.
Berylstone is probably referring to End Phase Triggers
So it turns out that this script ALSO allows common events called by skills to run before the battle ends, which basically does exactly what I needed.

Much appreciated, you two!
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.

Original thread: https://forums.rpgmakerweb.com/threads/changing-variables-with-skills.19952/