Falcao 88 Posted October 8, 2012 (edited) Hello everybody This script idea come to me when creating the Pets Servants system where pets commands have waiting time after used So, This script adds something similar, a waiting time is applied to a already used skill (if you tagged to do so obviously) Features - Bring more balance to the game skills system, just imagine you create a really powerful skill that kills all enemies, it don make sense if you can use that powerful skill over and over again, just put waiting time now with this snipped. - A simple time meter is displayed at the help window showing time left Installation Paste this script above main and below any custom battle system Usage It is pretty simple just tag a skill as follows (skill note tags) <cooldown: x> Instead x puts cooldown integer, time in seconds More about Falcao Scripts? go to my site http://falcaorgss.wordpress.com Screenshots Skill tagged waiting time Skill used and cool-down applied Code #==============================================================================# # #*****************# # # #*** By Falcao ***# * Falcao Skills Cool Down 1.0 # # #*****************# This script allows you set waiting time to a # # used skill, so you have to wait x time before # # RMVXACE use it again. Date: Octuber 8 2012 # # # # Falcao RGSS site: http://falcaorgss.wordpress.com # # Falcao Forum site: http://makerpalace.com # #==============================================================================# #------------------------------------------------------------------------------- # * Installation # # Paste this script above main and below any custom battle system #------------------------------------------------------------------------------- # * Features # #- Bring more balance to the game skills system, just imagine you create a # really powerful skill that kills all enemies, it dont make sense if you can # use that powerful skill over and over again, just put waiting time now. #- A simple time meter is displayed at the help window showing time left #------------------------------------------------------------------------------- # * Usage # # It is pretty simple just tag a skill as follows (skill note tags) # # <cooldown: x> Instead x puts cooldown integer, time in seconds #------------------------------------------------------------------------------- # * License # # Free to use in any project, but you still need to credit me as creator #------------------------------------------------------------------------------- module FalCooldown def self.apply_cooldown(skill) i = skill.id - 1 ; data = $game_system data.cooldown[i] = skill.cooldown * 60 if data.cooldown[i] == 0 end end class Game_System attr_accessor :cooldown alias falcaocooldown_ini initialize def initialize @cooldown = [] $data_skills.size.times do ; @cooldown.push(0) ; end falcaocooldown_ini end end class Window_SkillList < Window_Selectable alias falcaocooldown_enable enable? def enable?(item) return false if !item.nil? and cool_data(item.id) > 0 falcaocooldown_enable(item) end def update @refresh_delay = 0 if @refresh_delay.nil? refresh_cooldown(cool_data(item.id)) if !item.nil? and cool_data(item.id) > 0 if @skill_index != self.index @skill_index = self.index refresh_cooldown(cool_data(item.id)) if !item.nil? end @refresh_delay -= 1 if @refresh_delay > 0 refresh if @refresh_delay == 1 for i in 0...$game_system.cooldown.size @refresh_delay = 2 if $game_system.cooldown[i] == 1 end super end def refresh_cooldown(cooldown) @help_window.contents.font.size = Font.default_size @help_window.refresh @help_window.contents.font.size = 20 cooldown > 0 ? operand = cooldown : operand = item.cooldown * 60 total_sec = operand / Graphics.frame_rate cd = sprintf("%02d:%02d", total_sec / 60, total_sec % 60) @help_window.contents.draw_text(-30, 22, @help_window.width, 32, "Cooldown: #{cd}", 2) end def cool_data(id) value = $game_system.cooldown[id - 1] if $game_system.cooldown[id - 1] > 0 return value.nil? ? 0 : value end end class RPG::Skill def cooldown @note =~ /<cooldown: (.*)>/i ? cd = $1.to_i : cd = 0 return cd end end class << Input unless self.method_defined?(:falcaocd_update) alias_method :falcaocd_update, :update end def update update_cooldown_global falcaocd_update end def update_cooldown_global data = $game_system unless data.nil? for i in 0...data.cooldown.size data.cooldown[i] -= 1 if data.cooldown[i] > 0 end end end end class Scene_Battle < Scene_Base alias falcao_cooldown_use_item use_item def use_item item = @subject.current_action.item FalCooldown.apply_cooldown(item) if item.is_a?(RPG::Skill) falcao_cooldown_use_item end end class Scene_ItemBase < Scene_MenuBase alias falcaocd22_use_item use_item def use_item FalCooldown.apply_cooldown(item) if item.is_a?(RPG::Skill) falcaocd22_use_item end end Edited October 12, 2012 by Falcao Share this post Link to post Share on other sites
estriole 326 Posted October 9, 2012 (edited) a suggestion. you might want to add commands for triggering the cooldown without using the skill. so we can use it with yanfly field skill select script. that script only store the skill in variable but not 'actually' use the skill. if you made the command. we can have field skill that have cooldown . edit : and also in reverse to reset the cooldown of certain skill / all skill owned by certain actor/ all skill owned by party. Edited October 9, 2012 by estriole Share this post Link to post Share on other sites
Ashern 8 Posted October 9, 2012 This is a nice script, and I'll definitely use it. One question, though. Is there a way to make it so an enemy can cause certain (or random) skills to automatically start a cool-down process? For an example: You're about to use a skill, but the enemy casts a 'disabler' on you that will cause that skill to start recharging -- even if you haven't used it yet. Share this post Link to post Share on other sites
Falcao 88 Posted October 9, 2012 (edited) @estrile and @Ashern There is a command to apply skill cooldown manually but i didn't mention anything about it because i thought nobody would need it Here the script call FalCooldown.apply_cooldown($data_skills[id]) Change 'id' for the skill id you want to apply the cooldown I know it is not an elegant script call but anyways work >_< Edited October 9, 2012 by Falcao Share this post Link to post Share on other sites
estriole 326 Posted October 10, 2012 This is a nice script, and I'll definitely use it. One question, though. Is there a way to make it so an enemy can cause certain (or random) skills to automatically start a cool-down process? For an example: You're about to use a skill, but the enemy casts a 'disabler' on you that will cause that skill to start recharging -- even if you haven't used it yet. @ ashem : not correct i think. if you already choose the skill. it will still executed even though you set the cooldown. so you need to add '1 turn stun' state so the skill not executed and then call common event to trigger the cooldown of the skill you want. @falcao : i see. but from what i see you trigger the cooldown of that skill on all actor - since you only sent $data_skills[id] (means if you have that skill on more than one actor both will be cooldowned). i would suggest making it able to trigger certain actor certain skill too?. (and maybe all skill that certain actor has ex: slime cast cooldown trigger on eric and all eric skills get cooldown triggered. it would be fun ). but it's up to you. just suggestion though. nice script btw. i will try using it with yanfly ace battle system and see if it works. i will report you later. Share this post Link to post Share on other sites
Falcao 88 Posted October 10, 2012 (edited) @estriole Since the script cooldown kernel is working based on skill id index it is not possible to add skills cooldown for each actor. the script looks very simple but it is working in a complex way, just imagine you set cooldown to a bunch of 100 skills, the script has to check the timing for each skill, updating the time meter and finally draw the skill time meter at the help window. May be in a future i will change the base of this script, but i think it is a helpful tool as it is Edited October 10, 2012 by Falcao Share this post Link to post Share on other sites
Ashern 8 Posted October 10, 2012 Thanks Falcao, though it's not exactly what I meant. It does still helps to know that call script. But I was referring to a type of situation in which you're, say, fighting a nusance of a boss, and the boss will often disable random skills on your character; making it harder to use what you want. Pretty much like the state Silence, only making the specific skills become disabled (start cooling down) instead of the whole class of skills. Share this post Link to post Share on other sites
estriole 326 Posted October 12, 2012 (edited) Thanks Falcao, though it's not exactly what I meant. It does still helps to know that call script. But I was referring to a type of situation in which you're, say, fighting a nusance of a boss, and the boss will often disable random skills on your character; making it harder to use what you want. Pretty much like the state Silence, only making the specific skills become disabled (start cooling down) instead of the whole class of skills. you could do some workarround. just make the skill add state that 'stun' you for one turn (to avoid you still using it when you already select it). then that skill call common event that have the script call to trigger the cooldown. you want it random skill? just make some copy of that skill that trigger different skill. add it at boss enemy behavior in same priority and maybe set some switch condition then in troops page set variable random which will turn on off of that switches (or if you use victor enemy condition you could set some more advanced random with only variables and without switches). it's hard? now now... it's a boss fight.... and to design boss fight need some effort . no one want their boss fight like regular encounter don't they? Edited October 12, 2012 by estriole Share this post Link to post Share on other sites
Ashern 8 Posted October 12, 2012 it's hard? now now... it's a boss fight.... and to design boss fight need some effort . no one want their boss fight like regular encounter don't they? Well of course not . I don't think it'll be that hard, really. Just will have to keep on toggling with stuff, but thanks for the 'work-around' solution; I'll definitely try it. Share this post Link to post Share on other sites
Kallethan 0 Posted October 14, 2012 Is there a way you could add cooldown in turns instead of seconds/minutes? Share this post Link to post Share on other sites
Falcao 88 Posted October 15, 2012 Is there a way you could add cooldown in turns instead of seconds/minutes? Not now, may be for the next update i going to add more features Share this post Link to post Share on other sites
Ashern 8 Posted November 8, 2012 Just wanted to report a bug, and hopefully get a fix! If you use a skill that has a countdown, the countdown timer will appear on things like Items (even if the item doesn't have a cooldown). It doesn't restrict the item use, but you can still see that timer when it shouldn't be there. Also, if your skill is recharging at the end of a battle, it'll still be recharging during the next battle. Is there a way to make it reset the timers at the end of a battle? Share this post Link to post Share on other sites