[RMVX ACE] HOW TO CALL A SCRIPT'S FUNCTION MANUALLY?

Posts

Pages: 1
EDIT: Wrong person named in scripts

So I'm making the terminal mistake of trying to use Yami's ATB script and Yanfly's Skill Restricitons (ie, cooldown) script at the same time.

As many of you who have tried this before has discovered, the cooldowns never go down when a turn passes.

I'm trying to implement a workaround where a common event is called every turn, and uses a script call to call the cooldown script's "update_cooldowns" function.

However, just putting "update_cooldowns" in the script call just gives me an "undefined local method" error.

How do I go about calling script methods from within common events?

UPDATE:

GOT THE !@#$ER!

If you want to use Yami's ATB script and Yanfly's Skill restrict system to have cooldowns in an ATB system, just do this:

In the Game_Battler class, search (CTRL-F) for "on_turn_end"

Add "update_cooldowns #changed" to the end.

  #--------------------------------------------------------------------------
# * Processing at End of Turn
#--------------------------------------------------------------------------
def on_turn_end
@result.clear
regenerate_all
update_state_turns
update_buff_turns
remove_states_auto(2)
update_cooldowns #changed

end
SunflowerGames
The most beautiful user on RMN!
13323

Isn't the script by Fomar, which was designed to be compatible with Yanfly's Battle system? To my knowledge all of Yanfly's scripts work with each other.

The problem with the script is that it doesn't count the turns correctly. You can test this out by trying states / buffs that last a certain number of turns. Or have enemies activate something on a certain turn.
Marrend
Guardian of the Description Thread
21781
If it's giving you an "unidentified local method" error, my completely random guess is that you need a class object to make it recognize "update_cooldowns" as a function of said class?
author=Marrend
If it's giving you an "unidentified local method" error, my completely random guess is that you need a class object to make it recognize "update_cooldowns" as a function of said class?

I figured, but I'm not used to Ruby's syntax.

I'll try looking that up after supper.

If that doesn't work I'll use Fomar's, which I found a fix for.
Tried many variations of

YEA::SKILL_RESTRICT.update_cooldowns


Only to be told "undefined method 'update_cooldowns' for YEA::SKILL_RESTRICT:module

Gonna come back to this tomorrow and maybe monkey around some more before switching scripts.
GOT THE !@#$ER!

In the Game_Battler class, search (CTRL-F) for "on_turn_end"

Add "update_cooldowns #changed" to the end.

  #--------------------------------------------------------------------------

# * Processing at End of Turn
#--------------------------------------------------------------------------
def on_turn_end
@result.clear
regenerate_all
update_state_turns
update_buff_turns
remove_states_auto(2)
update_cooldowns #changed

end
Pages: 1