Call Outs, GTBS Addon - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Archives (https://www.save-point.org/forum-105.html) +--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html) +---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html) +----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html) +------ Forum: Battle System (CBS) (https://www.save-point.org/forum-94.html) +------ Thread: Call Outs, GTBS Addon (/thread-6380.html) |
Call Outs, GTBS Addon - GubiD - 03-27-2011 Call Outs, GTBS Addon by GubiD Mar 27 2011 This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss. No support is given. If you are the owner of the thread, please contact administration. This script basically allows you to have characaters say something before performing their attack or skill. It allows you to designate a generic statement or a specific one tying to map_id and whom exactly you are attacking. If you add this code to the gtbs demo, you will see exactly what I mean. Enjoy! ^_^ GTBS Call Outs [code] module GTBS #-------------------------------------------------------------------------- # Call Out Rate - The higher this number, the LESS likely you will do a generic # callout on a standard action. #-------------------------------------------------------------------------- Call_Out_Rate = 3 # 1 is 100% rate, 2 is 50%, 3 is 33%, etc. #-------------------------------------------------------------------------- # Call Out settings, generic - is actor type, attacker id, and skill_id # Determine your own filtering method to the desired text. #-------------------------------------------------------------------------- def self.generic_callout_text(is_actor, attacker_id, skill_id) case skill_id when 1 # heal return "White light, heal with might. Heal!" end if is_actor case attacker_id when 1 values = ["To easy!", "Take that!"] return values[rand(values.size)] end else case attacker_id when 1 return "Die scum!" end end end #-------------------------------------------------------------------------- # Call Out Setting, specific - attacker_id, actor?, map_id) # You can setup your own filtering here as well, but its not required. You # must return embeded hash in the following manor. #-------------------------------------------------------------------------- # texts[ENEMY_ID] = [TEXT1, TEXT2, TEXT3.. ] #-------------------------------------------------------------------------- def self.attack_specific_call_outs(attacker_id, is_actor, map_id) texts = {} case map_id when 1 if is_actor == true case attacker_id when 1 texts[34] = ["Are you really this blind?", "I dont want to do this"] end elsif is_actor == false # is enemy case attacker_id when 34 texts[1] = ["You will pay for your crimes"] end end end return texts end end #-------------------------------------------------------------------------- # Scene Battle TBS Changes for Call Outs #-------------------------------------------------------------------------- class Scene_Battle_TBS #-------------------------------------------------------------------------- # * Post Start - This does POST initial startup processing #-------------------------------------------------------------------------- alias post_start_callouts post_start def post_start post_start_callouts setup_callouts end def setup_callouts @call_outs = {} for actor in actors + neutral data = GTBS.attack_specific_call_outs(actor.id, true, $game_map.map_id) updated_data = {} if data != {} for id in data.keys for en in enemies if en.enemy_id == id updated_data[en] = data[id] end end end @call_outs[actor] = updated_data end end for enemy in enemies data = GTBS.attack_specific_call_outs(enemy.enemy_id, false, $game_map.map_id) updated_data = {} if data != {} for id in data.keys for en in actors+neutral if en.id == id updated_data[en] = data[id] end end end @call_outs[enemy] = updated_data end end end def set_callout(skill_id = nil) if @call_outs[@active_battler] != nil call_out_text = "" text = @call_outs[@active_battler] targets = @active_battler.current_action.targets for target in @targets if text[target] != nil call_out_text = text[target][0] @call_outs[@active_battler][target].delete(call_out_text) break end end if call_out_text != "" $game_temp.message_text = call_out_text if defined?(NORMAL_MODE) #CCOA UMS Support if @active_battler.is_a?(Game_Actor) $game_system.gtbs_a_id = @active_battler.id else $game_system.gtbs_e_id = @active_battler.enemy_id end end end elsif rand(GTBS::Call_Out_Rate) == 0 map_id = $game_map.map_id if @active_battler.is_a?(Game_Actor) callout = GTBS.generic_callout_text(true, @active_battler.id, skill_id) else callout = GTBS.generic_callout_text(false, @active_battler.enemy_id, skill_id) end $game_temp.message_text = callout end @message_window.update end #-------------------------------------------------------------------------- # TBS_Phase_9 - Always set callouts before proceeding with standard attack/skill #-------------------------------------------------------------------------- alias tbs_phase_9_callouts tbs_phase_9 def tbs_phase_9 case @step when 1 if @active_battler.current_action.kind == 1 set_callout(@active_battler.current_action.skill_id) else set_callout end end tbs_phase_9_callouts end end[code] |