[solved]Help: Option to turn off this script if player wants

Status
Not open for further replies.

ddejan90

Regular
Regular
Joined
Oct 5, 2015
Messages
152
Reaction score
33
First Language
Serbo-Croatian
Primarily Uses
Anyone knows how to turn a script off if a player choses? Naimly, I use script Blitz Commands to have player input sequences of buttons to trigger spell before the timer expires. Some players asked me to to make optional easy/casual mode so they can chose if they want to turn off blitz comands and use default press spell use spell mechanic. Also, I've just found a controler script and since the spells use more buttons than a controler has and to not force people to play game with controler and have a spell done with keyboard. I just need a scriptcall so I can put in options. Moghunter wasn't that active on twitter that much so I don't think he will reply, but I've sent him a message anyway.

#==============================================================================
# +++ MOG - Blitz Commands (v1.6) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Permite ativar ações através de sequência de comandos.
#==============================================================================
# UTILIZAÇÃO
#==============================================================================
# No banco de dados de habilidades ou itens, coloque o seguinte comentário na
# caixa de notas.
#
# <Blitz Command>
#
# * Lembre-se de definir a sequência de botões no editor de script antes de
# usar a habilidade
#
# Para definir uma velocidade especifica na sequência de botões use o cometário
# abaixo.
#
# <Blitz Speed = X>
#
#==============================================================================
# Arquivos necessários. Graphics/System/
#==============================================================================
#
# Blitz_Background.png
# Blitz_Flash.png
# Blitz_Layout.png
# Blitz_Meter.png
# Chain_Command.png
#
#==============================================================================
# Histórico
#==============================================================================
# v1.6 - Melhoria na codificação.
#==============================================================================

$imported = {} if $imported.nil?
$imported[:mog_blitz_commands] = true

module MOG_BLITZ_COMMANDS
#Definição do tempo para inserir os comandos. (tempo X quantidade de comandos)
DEFAULT_INPUT_DURATION = 30
#==============================================================================
# BLITZ_INPUT = { SKILL_ID => [COMMAND] }
#
# SKILL_ID = ID da habilidade no banco de dados.
# COMMANDS = Defina aqui a sequência de botões.
# (Para fazer a sequência use os comandos abaixo)
#
# "Down" ,"Up" ,"Left" ,"Right" ,"Shift" ,"D" ,"S" ,"A" ,"Z" ,"X" ,"Q" ,"W"
#
# Exemplo de utilização
#
# BLITZ_INPUT = {
# 25=>["Down","D","S","Right"],
# 59=>["Down","Up","Left","Right","Shift","D","S","A","Z","X","Q","W"],
# 80=>["Shift","D"]
# }
#==============================================================================
BLITZ_INPUT = {
3=>["Left","X","Up","Right","Right"],
4=>["X","X"],
20=>["Left","Right","Right","Left","A","D"],
22=>["Left","Up","Right","Down","Up","Down","Left","Right","Z","Z"],
23=>["Q","Up","Q","W","Z","Down","S","Q","D","Z"],
26=>["A","S","Up","Up","D"],
33=>["A","D","S","Left","S","Left"],
34=>["A","D","S","X","Right","Left","Up","W","S","Left"],
35=>["X","Left","Right","X","Right","Left","W"],
36=>["Down","Left","Z","W","Right","A","S","Up"],
38=>["X","X","Z","Right","X","Left","Q",],
40=>["Z","W","Left","Down","Down","D"],
44=>["Left","Left","Right","Left","D","A","W"],
48=>["Down","Down","A","X","X","Down","Down"],
49=>["X","X","D","Q","Left","Z","Z"],
50=>["W","X","Right","Up","A","Down","W"],
52=>["Right","Left","Right","Left","X","Right","X"],
53=>["X","Z","A","S","D"],
54=>["X","Z","A","S","D","Up","X","Down","Down"],
59=>["W","Q","Q","Up","Down"],
61=>["Z","D","X","Right","Left"],
62=>["Right","Left","Right","Q","Z","Z","D","X","Right","Left"],
66=>["Right","Up","Up","Z"],
69=>["X","Right","Left","Z","Z"],
71=>["Up","W","W","Down","A","Q","Right"],
72=>["Right","W","W","Down","S","Q","Right","S","A"],
74=>["Down","Right","Down","Right","A"],
78=>["Left","Right","Q","Z","Up","A","S"],
89=>["X","X","Down","X","Up","Right","Up","Up","Down","X"],
97=>["Left","Right","A","D","D","Q","Left","Right","Up","X"],
101=>["Left","Right","Z","Z","Down","S","S"],
105=>["Left","Z","Z","Up","Up","X","Left","Right","Up","Left","Z"],
106=>["Down","Down","Z","Down","Down","Left","Right"],
107=>["Left","Right","Q","Z","Up","A","S","Down","D","Z","D","A","W"],
108=>["X","Down","X","Up","Down","Left","Up","Up","X"],
109=>["A","X","X","Down","W","Right","A","Right","Left","Right"],
110=>["Up","Z","Down","D","Z","Left"],
112=>["X","X","Up","Down","Down","Left","Right","Q","Z","Up","A"],
113=>["Up","Down","Left","X","Z","X","Right","D","Z","Left","Down","D"],
114=>["Up","Z","Down","Down","Left","Right","Down","Down","D","A","X","X"],
121=>["Z","Z","W","Up","UP","Left","Right","Left","W","D","S","X","Q"],
128=>["Up","D","Z","Up","X"],
131=>["A","S","D"],
132=>["Up","D","Down","Right","Down","Up","Up","X"],
134=>["D","S","A","Up","X"],
135=>["Up","Up","W","Right","W","Down","Up","D"],
136=>["Left","Up","Left","D","W","Down","X","Q"],
137=>["Up","Q","Up","Right","Down","Down","S"],
138=>["Q","Up","Right","Down","Down","W",],
140=>["D","A","Up","Down","Up"],
141=>["W","D","A","Up","S","X","Q"],
142=>["D","W","A","Up","Down","Up","Z",],
143=>["A","Up","Z","Down","D",],
144=>["Up","D","W","Down","Up"],
145=>["S","Up", "Up", "Down","Up"],
146=>["D","X","A","Up","Up","Down","Up"],
147=>["D","W","W","Z","W","X",],
148=>["W","D", "A","D","Up", "Down"],
149=>["D", "Z","A", "W","W","Up", "Down"],
150=>["W", "A", "Up", "Z","Down","Z",],
151=>["A", "A", "Up", "Down""W","W",],
152=>["W", "Z", "Up", "Z","Down"],
153=>["Z","Z","Left","Right","S","X","Q"],
155=>["Left","Right","Right","Left","A","D"],
156=>["Left","Up","Left","Right","Z","Z"],
157=>["S","Q","D"],
158=>["Up","Z","Down","D","D"],
159=>["A","D","S","Left","S","Left"],
160=>["A","D","S","W","S","Left"],
161=>["X","Left","Right","Left","W"],
162=>["Down","Left","Z","W","Right","A","S","Up"],
163=>["X","X","Z","Right","X","Left","Q",],
164=>["Z","W","Left","Down","Down","D"],
165=>["Left","Left","D","A","W"],
167=>["X","X","X"],
168=>["Z", "Z", "Z"],
169=>["Z","X","D"],
170=>["X","Z","Up","Right","Down","Down",],
171=>["X","Z","A","S","D","Up","X","Down","Down"],
172=>["W","Q","Q","Up","Down","D","Z",],
173=>["Z","D","X","Right","Left"],
174=>["Right","Left","D","X","Right","Left"],
175=>["Right","Up","Up","Z","Up","Up",],
176=>["X","Right","Left","Z","Z"],
177=>["Up","W","W","Down","A","Q","Right"],
178=>["Right","W","W","Down","S","Q","Right","S","A"],
179=>["Down","Right","Down","Right","A"],
180=>["Left","Right","Q","Z","Up","A","S"],
181=>["X","X","Down","X","Up","Down","X"],
182=>["Left","Right","A","Up","X"],
183=>["Q","Q","Up","Left","S"],
184=>["Left","Right","Up","Left","Z"],
185=>["Down","Up","Down","Up","Down","Left","Right"],
186=>["Left","Right","Q","Z","D","A","W"],
187=>["X","Down","X","Up","X"],
188=>["A","X","Right","A","Right","Left","Right"],
189=>["Up","Z","Down","D","Z","Left"],
190=>["Down","Down","A","X","X","Down","Down"],
192=>["Right","Left","Right"],
193=>["Up","Z","Down","D","Z","Left"],
194=>["X","X","Up","Down","Down","A"],
195=>["Up","Down","Left","X","Z","Down","D"],
196=>["Up","Z","Down","Down","Left","Up","Up","X"],
197=>["Z","Z","W","Up","S","X","Q"],
198=>["Up","D","Z","Up","X","S","X",],
199=>["A","S","Right","Left","Right","D","W","Down"],
200=>["Up","D","Down","Right","Down","Up","Up","X"],
201=>["D","D","W","Right","S","A","Up","X"],
202=>["Up","Up","W","Right","W","Down","Up","D"],
203=>["Left","Up","Left","D","W","Down","X","Q"],
204=>["W","Right","Down","Up","Q","S"],
205=>["A","Up","Down","Up","S","X","W",],
206=>["D","A","Up","Down","Up","S","X","S",],
207=>["Left","Right","Left","Up","S","X","Q"],
208=>["D","W","A","Up","Down","Up","Z",],
209=>["A","Up","Down","Up","Z","Z","Up",],
210=>["Up","D","W","Down","Up","Up","A","S"],
211=>["S","Up","Z","Down","D","Up"],
212=>["D","X","A","Up","Up","Down","Up"],
213=>["Z","Down","S","Q","D","Z"],
214=>["Up","X","Right","Left","Up","D"],
215=>["A","D","S","Left","S","Left"],
216=>["W","Right","A","D","S","Left"],
217=>["X","Left","Right","X","Right","Left","W"],
218=>["Down","Left","Z","W","Right","A","S","Up"],
219=>["X","X","Z","Right","X","Left","Q",],
220=>["Z","W","Left","Down","Down","D"],
221=>["Left","Left","Right","Left","D","A","W"],
222=>["X","X","D","Q","Left","Z","Z"],
223=>["Up","Left","D","W","Up","A","Down","W"],
224=>["Right","Left","Right","Left","X","Right","X"],
225=>["X","Z","Up","Right","Down","Down",],
226=>["X","Z","A","Down"],
227=>["W","Q","Q","Up","Down","D","Z",],
228=>["Z","D","X","Right","Left"],
229=>["Right","Left","Right","Right","Left"],
230=>["Right","Up","Z","Up","Up","A","S",],
231=>["X","Right","Q","Z","Up","D","Z",],
232=>["Up","W","A","Q","Right"],
233=>["W","Down","S","Q","Right","S","A"],
234=>["Down","Right","Down","Right","A"],
235=>["X","X","X","Q","A"],
236=>["X","X","Down","X","Up","W"],
237=>["Left","Right","A","D","Up","X"],
238=>["Q","Q","Up","Down","S","S"],
239=>["Down","Down","A","X","X","Down","Down"],
241=>["Up","Z","Down","D","Z","Left"],
243=>["Right","D","Z","Left","Down","D"],
244=>["Up","Z","Down","Down","Left","Up","Up","X"],
246=>["Up","D","Z","Up","Up","Left","D","W",],
247=>["A","S","Right","Left","Right","D","W","Down"],
249=>["A","Up","X"],
250=>["Up","Up","W","Right","W","Down","Up","D"],
251=>["Left","Up","Left","D","W","Down","X","Q"],
252=>["W","D","X","Down","W","S"],
253=>["Up","Up","Down","Up","Down","Up"],
254=>["D","X","S",],
255=>["Left","Right","Left","Up"],
256=>["D","W","A","Up","Down","Up","Z",],
257=>["A","Up","Down","Up","Z","Z","Up",],
258=>["Up","D","W","Down","Up","Up","A","S"],
259=>["S","Up", "Up", "Down","Up"],
260=>["D","X","A","Up","Up","Down","Up"],
261=>["Q","Up","Q","W","Z","Down"],
262=>["Left","Up","Up"],
263=>["A","D","S","Left","S","Left"],
264=>["W","Right","A","W","S","Left"],
265=>["X","Left","Right","X","Right","Left","W"],
266=>["Down","Left","Z","W","Right","A","S","Up"],
267=>["S","Q","D","Z","Right","X","Left","Q",],
268=>["Z","W","Left","Down","Down","D"],
269=>["Left","Left","Right","Left","D","A","W"],
270=>["Down","Down","A","X","X","Down","Down"],
271=>["X","Q","Left","Z","Z"],
272=>["W","X","Right","Up","A","Down","W"],
273=>["Right","Left","X","Right","X"],
274=>["Up","Z","Down","D","D","Z","D"],
275=>["Up","X","Down","Down"],
276=>["W","D","W","Down","X"],
277=>["Z","D","X","Right","Left"],
278=>["Right","Left","Right","Q","Left"],
279=>["Right","Up","Up","D","W","Down","X","Q"],
280=>["X","Right","Left","Z","Z"],
281=>["Up","W","W","Down","A","Q","Right"],
282=>["Right","S","Q","Right","S","A"],
283=>["Down","X","Up","Right","Up","Up","Down","X"],
284=>["Left","Right","A","Right","Up","X"],
285=>["Down","S","S"],
286=>["Left","Z","Right","Up","Left","Z"],
287=>["Down","Up","Down","Up","Down","Left","Right"],
288=>["A","S","Down","D","Z","D","A","W"],
289=>["X","Down","X","Up","Down","Left","Up"],
290=>["A","Down","W","Left","Right"],
291=>["Up","Z","Down"],
292=>["Down","Down","A","X","X","Down","Down"],
293=>["A","X","X","Down","W","Right"],
294=>["Up","Z","Down","D","Z","Left"],
295=>["X","X","Up","Down","Up","A"],
296=>["Right","D","Z","Left","Down","D"],
297=>["Up","Z","Down","Down","Left","Up","Up","X"],
298=>["Z","W","Up","UP","Left","X","Q"],
299=>["Z","W","Left","Down","S","D"],
300=>["Up","Z","Down","D","D","Up","X","Down","Down"],
301=>["W","Q","Down","D","Z",],
302=>["Z","D","X","Right","Left"],
303=>["Right","Left","Right","Q","Left"],
304=>["Right","Up","Z","Down","D","Z"],
305=>["X","Right","Left","Z","Z"],
306=>["Up","W","W","Down","A","Q","Right"],
307=>["Right","S","A"],
308=>["Down","Right","Down","Right","A"],
309=>["Left","Right","Q","S"],
310=>["X","X","Down","X","Down","X"],
311=>["A","D","D","Q","Left","Right","Up","X"],
312=>["Left","Right","Z","Z","Down","S","S"],
313=>["X","X","D","Q","Left","Z","Z"],
314=>["W","X","Right","Up","A","Down","W"],
315=>["Right","Left","Right","Left","X","Right","X"],
316=>["X","Z","Up","Right","Down","Down",],
317=>["X","Z","A","S","D","Up","X","Down","Down"],
318=>["W","Down","D"],
319=>["Z","D","X","Right","Left"],
320=>["Right","Left","X","Right","Left"],
321=>["Right","Up","Z","Up","Up","A","S",],
322=>["X","Right","Q","Z","Up","D","Z",],
323=>["Up","W","W","Down","A","Q","Right"],
324=>["A","Up","Down","Up","Z","Z","Up",],
325=>["Down","Up","Up","A","S"],
326=>["S","Up", "Up", "Down","Up"],
327=>["Up","Down","Up"],
328=>["Q","Up","D","Down","Z"],
329=>["X","Right","D","W",],
330=>["Up","A","S","Down","Z",],
154=>["W","A","Z","Left","Right"],
999=>["Left","Right","Left","Right","Left","Right","Q","Z","Up","A","S",
"Down","D","Z","Right","Up","Up","Z","W","Left","Down","D","A","W"]
}
#Ativar animação da imagem de fundo.
BACKGROUND_ENABLE = true
#Velocidade de deslize da imagem de fundo.
BACKGROUND_SCROLL_SPEED = [30,0]
#Posição do layout.
BLITZ_POSITION = [0,0]
#Posição do botão.
BUTTON_POSITION = [265,170]
#Posição do medidor de tempo.
METER_POSITION = [63,249]
#Posição do sprite Flash.
FLASH_POSITION = [0,146]
#Posição do ícone.
ICON_POSITION = [0,0]
#Posição do nome da skill
SKILL_NAME_POSITION = [180,140]
#Definição das palavras usadas no sistema blitz.
BLITZ_WORDS = ["Missed!", "Timeover", "Success!"]
#Configuração da fonte.
FONT_SIZE = 22
FONT_COLOR = Color.new(255,255,255)
#Prioridade dos sprites.
BLITZ_Z = 10500
#Som ao acertar.
RIGHT_SE = "Chime1"
#Som ao errar.
WRONG_SE = "Buzzer1"
#Definição do som ao ativar o sistema.
BLITZ_START_SE = "Saint9"
end

#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :blitz_commands
attr_accessor :blitz_commands_phase
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_blits_commands_initialize initialize
def initialize
@blitz_commands = [false,0] ; @blitz_commands_phase = false
mog_blits_commands_initialize
end

end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# ● Use Item
#--------------------------------------------------------------------------
alias mog_blitz_commands_use_item use_item
def use_item
if can_execute_blitz_input?
blitz_before_action
execute_blitz_input
blitz_after_action
unless $game_temp.blitz_commands[1] == nil
return if !$game_temp.blitz_commands[0]
end
end
mog_blitz_commands_use_item
end

#--------------------------------------------------------------------------
# ● Blitz Before Action
#--------------------------------------------------------------------------
def blitz_before_action
record_window_data if $imported[:mog_atb_system]
if $imported[:mog_menu_cursor]
@chain_curor_x = $game_temp.menu_cursor[2]
$game_temp.menu_cursor[2] = -999
force_cursor_visible(false)
end
end

#--------------------------------------------------------------------------
# ● Blitz After ACtion
#--------------------------------------------------------------------------
def blitz_after_action
restore_window_data if $imported[:mog_atb_system]
if $imported[:mog_menu_cursor] and @chain_curor_x != nil
$game_temp.menu_cursor[2] = @chain_curor_x
end
end

#--------------------------------------------------------------------------
# ● Can Execute Blitz Input
#--------------------------------------------------------------------------
def can_execute_blitz_input?
return false if !@subject.is_a?(Game_Actor)
return false if @subject.restriction != 0
return true
end

#--------------------------------------------------------------------------
# ● Execute Blitz Input
#--------------------------------------------------------------------------
def execute_blitz_input
$game_temp.blitz_commands[0] = false
action_id = @subject.current_action.item.note =~ /<Blitz Command>/ ? @subject.current_action.item.id : nil
$game_temp.blitz_commands[1] = action_id
return if action_id == nil
blitz_command_sequence = MOG_BLITZ_COMMANDS::BLITZ_INPUT[action_id]
if $imported[:mog_menu_cursor]
valor_x = $game_temp.menu_cursor[2] ; $game_temp.menu_cursor[2] = -999
force_cursor_visible(false)
end
if blitz_command_sequence != nil
blitz_sq = Blitz_Commands.new(blitz_command_sequence, @subject ,action_id)
loop do
$game_temp.blitz_commands_phase = true
(blitz_sq.update ; Input.update) unless @spriteset.animation?
@spriteset.update ; Graphics.update ; update_info_viewport
break if blitz_sq.phase == 9
end
blitz_sq.dispose
end
$game_temp.menu_cursor[2] = valor_x if $imported[:mog_menu_cursor]
$game_temp.blitz_commands_phase = false
end

end

#==============================================================================
# Game Temp
#==============================================================================
class Game_Temp

attr_accessor :cache_blitz_command

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_blitz_command_initialize initialize
def initialize
mog_blitz_command_initialize
cache_blt_cmd
end

#--------------------------------------------------------------------------
# ● Cache Blt Cmd
#--------------------------------------------------------------------------
def cache_blt_cmd
@cache_blitz_command = []
@cache_blitz_command.push(Cache.system("Blitz_Background"))
@cache_blitz_command.push(Cache.system("IconSet"))
@cache_blitz_command.push(Cache.system("Blitz_Flash"))
@cache_blitz_command.push(Cache.system("Blitz_Meter"))
@cache_blitz_command.push(Cache.system("Blitz_Layout"))
@cache_blitz_command.push(Cache.system("Chain_Battle_Command"))
end

end


#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Spriteset_Battle

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_blitz_commands_initialize initialize
def initialize
$game_temp.cache_blt_cmd
mog_blitz_commands_initialize
end
end
#==============================================================================
# Blitz Commands
#==============================================================================
class Blitz_Commands
include MOG_BLITZ_COMMANDS
attr_accessor :phase

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(sequence, subject,action_id)
@phase = 0 ; @actor = subject ; @skill = $data_skills[action_id]
@skillname = @skill.name ; @action_id = action_id
@chain_command = sequence ; @end = false
duration = @skill.note =~ /<Blitz Speed = (\d+)>/i ? $1.to_i : DEFAULT_INPUT_DURATION
@timer_max = duration * @chain_command.size ; @timer_max = 1 if @timer_max < 1
@timer = @timer_max ; @Com = 0 ; @com_index = 0 ; @new_x = 0
Audio.se_play("Audio/SE/" + BLITZ_START_SE, 100, 100) rescue nil
create_sprites
end

#--------------------------------------------------------------------------
# ● Create Sprites
#--------------------------------------------------------------------------
def create_sprites
create_background ; create_layout ; create_buttons ; create_meter
create_flash ; create_skill_name ; create_icon
end

#--------------------------------------------------------------------------
# ● Create Background
#--------------------------------------------------------------------------
def create_background
@background = Plane.new ; @background.opacity = 0
@background.bitmap = $game_temp.cache_blitz_command[0]
@background.z = BLITZ_Z ; @background.visible = BACKGROUND_ENABLE
end

#--------------------------------------------------------------------------
# ● Create Icon
#--------------------------------------------------------------------------
def create_icon
@icon_image = $game_temp.cache_blitz_command[1]
@icon_sprite = Sprite.new ; @icon_sprite.bitmap = Bitmap.new(24,24)
@icon_sprite.z = BLITZ_Z + 3
@org_x2 = 80 + ICON_POSITION[0] - @Center + SKILL_NAME_POSITION[0]
@icon_sprite.x = @org_x2 ; @icon_sprite.opacity = 0
@icon_sprite.y = ICON_POSITION[1] + SKILL_NAME_POSITION[1]
icon_rect = Rect.new(@skill.icon_index % 16 * 24, @skill.icon_index / 16 * 24, 24, 24)
@icon_sprite.bitmap.blt(0,0, @icon_image, icon_rect)
end

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def create_skill_name
@skill_name = Sprite.new ; @skill_name.bitmap = Bitmap.new(200,32)
@skill_name.bitmap.font.size = FONT_SIZE
@skill_name.z = BLITZ_Z + 3 ; @skill_name.y = SKILL_NAME_POSITION[1]
@skill_name.opacity = 0 ; refresh_skill_name
end

#--------------------------------------------------------------------------
# ● Refresh Skill Name
#--------------------------------------------------------------------------
def refresh_skill_name
cm = @skillname.to_s.split(//).size
@Center = ((200 / @skill_name.bitmap.font.size) * cm / 2) + 5
@org_x = SKILL_NAME_POSITION[0] ; @skill_name.x = @org_x
@skill_name.bitmap.font.color = Color.new(0,0,0)
@skill_name.bitmap.draw_text(1,1,200,32,@skillname.to_s,1)
@skill_name.bitmap.font.color = FONT_COLOR
@skill_name.bitmap.draw_text(0,0,200,32,@skillname.to_s,1)
end

#--------------------------------------------------------------------------
# ● Create Flash
#--------------------------------------------------------------------------
def create_flash
@flash_type = 0 ; @flash_image = $game_temp.cache_blitz_command[2]
@flash_cw = @flash_image.width ; @flash_ch = @flash_image.height / 2
@Flash = Sprite.new ; @flash.bitmap = Bitmap.new(@flash_cw,@flash_ch)
@flash.x = FLASH_POSITION[0] ; @flash.y = FLASH_POSITION[1]
@flash.z = BLITZ_Z + 2 ; @flash.opacity = 0 ; @flash.blend_type = 1
refresh_flash
end

#--------------------------------------------------------------------------
# ● Refresh Flash
#--------------------------------------------------------------------------
def refresh_flash
@flash.bitmap.clear
f_scr = Rect.new(0,@flash_type * @flash_ch,@flash_cw,@flash_ch)
@flash.bitmap.blt(0,0,@flash_image,f_scr)
end

#--------------------------------------------------------------------------
# ● Create Meter
#--------------------------------------------------------------------------
def create_meter
@meter_image = $game_temp.cache_blitz_command[3]
@meter_cw = @meter_image.width ; @meter_ch = @meter_image.height
@meter_sprite = Sprite.new
@meter_sprite.bitmap = Bitmap.new(@meter_cw,@meter_ch)
@meter_sprite.x = METER_POSITION[0] ; @meter_sprite.y = METER_POSITION[1]
@meter_sprite.z = BLITZ_Z + 2 ; @meter_sprite.opacity = 0 ; update_meter
end

#--------------------------------------------------------------------------
# ● Update Meter
#--------------------------------------------------------------------------
def update_meter
return if @meter_sprite == nil
@meter_sprite.bitmap.clear ; m_width = @meter_cw * @timer / @timer_max
m_scr = Rect.new(0,0,m_width,@meter_ch)
@meter_sprite.bitmap.blt(0,0,@meter_image, m_scr)
end

#--------------------------------------------------------------------------
# ● Create Layout
#--------------------------------------------------------------------------
def create_layout
@layout = Sprite.new ; @layout.bitmap = $game_temp.cache_blitz_command[4]
@layout.x = BLITZ_POSITION[0] ; @layout.y = BLITZ_POSITION[1]
@layout.z = BLITZ_Z + 1 ; @layout.opacity = 0
end

#--------------------------------------------------------------------------
# ● Create Buttons
#--------------------------------------------------------------------------
def create_buttons
@image = $game_temp.cache_blitz_command[5]
@image_cw = @image.width / 13 ; @image_ch = @image.height
@image_cw_max = (@image_cw + 5) * @chain_command.size
@sprite = Sprite.new ; @sprite.bitmap = Bitmap.new(@image_cw_max,@image_ch * 2)
if @chain_command.size <= 15
@sprite.x = (Graphics.width / 2) - ((@image_cw + 5) * @chain_command.size) / 2
@new_x = 0
else
@sprite.x = (Graphics.width / 2) ; @new_x = @sprite.x
end
@sprite.x = BUTTON_POSITION[0] ; @sprite.y = BUTTON_POSITION[1]
@sprite.z = BLITZ_Z + 1 ; @sprite.opacity = 0 ; refresh_button
end

#--------------------------------------------------------------------------
# ● Refresh Button
#--------------------------------------------------------------------------
def refresh_button
return if @sprite == nil
@sprite.bitmap.clear
@chain_command.each_with_index do |i, index|
command_list_check(i)
bitmap_src_rect = Rect.new(@Com * @image_cw, 0, @image_cw, @image_ch)
if @com_index == index
@sprite.bitmap.blt(index * (@image_cw + 5) , 0, @image, bitmap_src_rect)
else
@sprite.bitmap.blt(index * (@image_cw + 5) , @image_ch, @image, bitmap_src_rect)
end
end
@new_x = BUTTON_POSITION[0] - ((@image_cw + 5) * @com_index)
end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
dispose_background ; dispose_layout ; dispose_buttons ; dispose_meter
dispose_flash ; dispose_name ; dispose_icon_sprite
end

#--------------------------------------------------------------------------
# ● Dispose Background
#--------------------------------------------------------------------------
def dispose_background
return if @background == nil
@background.dispose ; @background = nil
end

#--------------------------------------------------------------------------
# ● Dispose Icon Sprite
#--------------------------------------------------------------------------
def dispose_icon_sprite
return if @icon_sprite == nil
@icon_sprite.bitmap.dispose ; @icon_sprite.dispose ; @icon_sprite = nil
end

#--------------------------------------------------------------------------
# ● Dispose Name
#--------------------------------------------------------------------------
def dispose_name
return if @skill_name == nil
@skill_name.bitmap.dispose ; @skill_name.dispose ; @skill_name = nil
end

#--------------------------------------------------------------------------
# ● Dispose Flash
#--------------------------------------------------------------------------
def dispose_flash
return if @Flash == nil
@flash.bitmap.dispose ; @flash.dispose ; @Flash = nil
end

#--------------------------------------------------------------------------
# ● Dispose Meter
#--------------------------------------------------------------------------
def dispose_meter
return if @meter_sprite == nil
@meter_sprite.bitmap.dispose ; @meter_sprite.dispose ; @meter_sprite = nil
end

#--------------------------------------------------------------------------
# ● Dispose Buttons
#--------------------------------------------------------------------------
def dispose_buttons
return if @sprite == nil
@sprite.bitmap.dispose ; @sprite.dispose ; @sprite = nil
end

#--------------------------------------------------------------------------
# ● Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose ; @layout = nil
end

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
if @end and @sprite.x == @new_x
update_flash ; update_background ; update_end
return
end
update_background ; update_timer ; update_command ; update_slide_command
update_meter ; update_flash ; update_opacity
end

#--------------------------------------------------------------------------
# ● Update Opacity
#--------------------------------------------------------------------------
def update_opacity
return if @sprite.opacity == nil
@sprite.opacity += 10 ; @layout.opacity += 10
@meter_sprite.opacity += 10 ; @skill_name.opacity += 10
@background.opacity += 10 ; @icon_sprite.opacity += 10
end

#--------------------------------------------------------------------------
# ● Update End
#--------------------------------------------------------------------------
def update_end
fs = 6 ; @icon_sprite.opacity -= fs ; @background.opacity -= fs
@skill_name.opacity -= fs ; @sprite.opacity -= fs ; @layout.opacity -= fs
@meter_sprite.opacity -= fs ; @phase = 9 if @background.opacity == 0
end

#--------------------------------------------------------------------------
# ● Update Background
#--------------------------------------------------------------------------
def update_background
return if @background == nil
@background.ox += BACKGROUND_SCROLL_SPEED[0]
@background.oy += BACKGROUND_SCROLL_SPEED[1]
end

#--------------------------------------------------------------------------
# ● Update Flash
#--------------------------------------------------------------------------
def update_flash
return if @Flash == nil or @flash.opacity == 0
@flash.opacity -= 10
end

#--------------------------------------------------------------------------
# ● Update Timer
#--------------------------------------------------------------------------
def update_timer
return if @timer == 0
@timer -= 1 ; wrong_command(1) if @timer == 0
end

#--------------------------------------------------------------------------
# ● Update Slide Command
#--------------------------------------------------------------------------
def update_slide_command
return if @sprite == nil or @sprite.x == @new_x
slide_speed = 5 + ((@sprite.x - @new_x).abs / 5)
@sprite.x -= slide_speed ; @sprite.x = @new_x if @sprite.x < @new_x
end

end

#==============================================================================
# Blitz Commands
#==============================================================================
class Blitz_Commands

#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
return if @end
if Input.trigger?(Input::X) ; check_command(0)
elsif Input.trigger?:)Z) ; check_command(1)
elsif Input.trigger?:)Y) ; check_command(2)
elsif Input.trigger?:)A) ; check_command(3)
elsif Input.trigger?:)C) ; check_command(4)
elsif Input.trigger?:)B) ; check_command(5)
elsif Input.trigger?:)L) ; check_command(6)
elsif Input.trigger?:)R) ; check_command(7)
elsif Input.trigger?:)RIGHT) ; check_command(8)
elsif Input.trigger?:)LEFT) ; check_command(9)
elsif Input.trigger?:)DOWN) ; check_command(10)
elsif Input.trigger?:)UP) ; check_command(11)
end
end

#--------------------------------------------------------------------------
# ● command_list_check
#--------------------------------------------------------------------------
def command_list_check(command)
case command
when "A" ; @Com = 0
when "D" ; @Com = 1
when "S" ; @Com = 2
when "Shift" ; @Com = 3
when "Z" ; @Com = 4
when "X" ; @Com = 5
when "Q" ; @Com = 6
when "W" ; @Com = 7
when "Right" ; @Com = 8
when "Left" ; @Com = 9
when "Down" ; @Com = 10
when "Up" ; @Com = 11
else ; @Com = 12
end
end

#--------------------------------------------------------------------------
# ● check_command
#--------------------------------------------------------------------------
def check_command(com)
if com != -1
right_input = false
@chain_command.each_with_index do |i, index|
if index == @com_index
command_list_check(i) ; right_input = true if @Com == com
end end
else
command_list_check(@com_index) ; right_input = true
end
if right_input
next_command
else
wrong_command(0)
end
end

#--------------------------------------------------------------------------
# ● Next Command
#--------------------------------------------------------------------------
def next_command
@flash.opacity = 255 ; @flash_type = 0 ; @com_index += 1
Audio.se_play("Audio/SE/" + RIGHT_SE, 100, 100)
refresh_button ; refresh_flash
if @com_index == @chain_command.size
@end = true ; @skill_name.bitmap.clear
@skill_name.bitmap.draw_text(0,0,200,32,BLITZ_WORDS[2].to_s,1)
@icon_sprite.visible = false ; $game_temp.blitz_commands[0] = true
end
end

#--------------------------------------------------------------------------
# ● wrong_command
#--------------------------------------------------------------------------
def wrong_command(type)
Audio.se_play("Audio/SE/" + WRONG_SE, 100, 100) ; @flash.opacity = 255
@flash_type = 1 ;@skill_name.bitmap.clear ; @end = true
wname = type == 0 ? BLITZ_WORDS[0] : BLITZ_WORDS[1]
$game_temp.blitz_commands[0] = false
@skill_name.bitmap.draw_text(0,0,200,32,wname.to_s,1)
@icon_sprite.visible = false ; refresh_flash
end

end
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,319
Reaction score
11,491
First Language
German
Primarily Uses
RMMV
wrong assumptions.

you should consider turning on or off scripts and working on the Ace engine like working on the engine of your car - it can't be done while the car is running at 40mph on the motorway.

the only thing that can be done is if the car has controls installed to use those controls from the inside while driving.
which basically means if the script has a switch installed to turn off its own functions, then you can use that switch with a control switch command.
if such a switch does not exist in the script, then the script can't be turned off while playing, it could only be done by the developer (and then permanently) before sending it out.
 

ddejan90

Regular
Regular
Joined
Oct 5, 2015
Messages
152
Reaction score
33
First Language
Serbo-Croatian
Primarily Uses
wrong assumptions.

you should consider turning on or off scripts and working on the Ace engine like working on the engine of your car - it can't be done while the car is running at 40mph on the motorway.

the only thing that can be done is if the car has controls installed to use those controls from the inside while driving.
which basically means if the script has a switch installed to turn off its own functions, then you can use that switch with a control switch command.
if such a switch does not exist in the script, then the script can't be turned off while playing, it could only be done by the developer (and then permanently) before sending it out.
I was thinking to chose before you start the game. If you want to change you start a new one. Saddly I don't see any script call for turn on/off.
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,319
Reaction score
11,491
First Language
German
Primarily Uses
RMMV
the engine is already running when the title screen appears.

the only thing possible is to ask a programmer to add the neccessary functions if that is possible at all, and the number of programmers still available for an Ace/Ruby/RGSS3script is rather limited.

you can ask in script request or script support for one - there are half a dozen still around, but I don't know if they have time or the required knowledge of moghunters scripts to modify them.
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
You can try adding in a line and adding some code.
*not tested
line 75 add in after it
Ruby:
 # disable script by turning switch on
 ENABLED = 5 # switch id

Line 135 add on && $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
to look like this
Ruby:
  def use_item
      if can_execute_blitz_input? && $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
         execute_blitz_input
 

ddejan90

Regular
Regular
Joined
Oct 5, 2015
Messages
152
Reaction score
33
First Language
Serbo-Croatian
Primarily Uses
You can try adding in a line and adding some code.
*not tested
line 75 add in after it
Ruby:
 # disable script by turning switch on
 ENABLED = 5 # switch id

Line 135 add on && $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
to look like this
Ruby:
  def use_item
      if can_execute_blitz_input? && $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
         execute_blitz_input
Hey Ronin, I didn't have free time for past 2 days and now durring my first job I had some time and checked it out. It works you can turn on and off the script but, now you get two prompt to cast spells
example: I use steal, it shows A A D comands and then instantly shows again A A D for input and if you miss first one but hit second one it works. Could it be because of " execute_blitz_input" at the end?
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
no, that is only called if the statement is true
Maybe we need to put the switch condition into a seperate if statement.
I've seen that sometimes the code doesn't work if they are combined or not in brackets
Code:
  def use_item
    if $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
      if can_execute_blitz_input?
        execute_blitz_input
the other code
      end
    end
    mog_blitz_commands_use_item
  end
 
Last edited:

ddejan90

Regular
Regular
Joined
Oct 5, 2015
Messages
152
Reaction score
33
First Language
Serbo-Croatian
Primarily Uses
no, that is only called if the statement is true
Maybe we need to put the switch condition into a seperate if statement.
I've seen that sometimes the code doesn't work if they are combined or not in brackets
Code:
  def use_item
    if $game_switches[MOG_BLITZ_COMMANDS::ENABLED] == false
      if can_execute_blitz_input?
        execute_blitz_input
the other code
      end
    end
  end
Doing the new edit just crashes the game with the following error. Did I something wrong? I've tried to remove the default

if can_execute_blitz_input?
blitz_before_action
execute_blitz_input
blitz_after_action

with the snipet but nothing changed after I've added the new code still crashes same error
Untitled.png
 

Roninator2

Gamer
Regular
Joined
May 22, 2016
Messages
5,122
Reaction score
1,504
First Language
English
Primarily Uses
RMVXA
you need another end.
before the mog_blitz_commands_use_item
each if statement needs an end. they normally line up to make it easy to match
that's why what I put above is indented the way it is.
but I'll change that to show better since I didn't put the last line in.
 

ddejan90

Regular
Regular
Joined
Oct 5, 2015
Messages
152
Reaction score
33
First Language
Serbo-Croatian
Primarily Uses
Yeah, now it works perfectly fine! Thanks man
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
10,403
Reaction score
6,585
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Any tips? I really like some of the floor designs, but putting stuff on top ruins it.
Hangout.PNG
Oops, my hand slipped and hit the purchase button on MZ. I hate when that happens! Darn!
BCj
New quest system, and I love it! Still WIP and some double data.
dd1acd474eb23630b953ca8ea87b5f82.gif

36a27630874768073d6447e3d1e0c2eb.gif


28d5d3718ab6291c73717611863b4a7f.gif
Gears Of Phantasm Act I & II, on Steam!
store.steampowered.com/app/1810220
Followhttps://twitter.com/ShellPhantom
Contact Me:phantasygears@gmail.com

Forum statistics

Threads
134,929
Messages
1,251,981
Members
177,770
Latest member
SeptFly123
Top