Witam, mam taki problem ze skryptami.
Pierwszy skrypt to chodzenie na ukos, działa mi on tylko w wersji VX.
Problem jest w tym, gdy odpalam grę, nie wywala błędu, tylko jak wchodzę odrazu do gry, nie mogę się ruszać.
O to ten skrypt:
# Skrypt by KGC edited by Ozzma
# www.ultimateam.pl
module KGC
module Dash_8DirMove
# 8 kierunkowe chodzenie true/false
ENABLE_8DIR = true
# 8 klatkowa animacja true/false
ENABLE_8DIR_ANIMATION = false
# Szybkość chodzenia
DEFAULT_WALK_SPEED = 4
# Szybkość podejścia
DASH_SPEED_RATE = 3
end
end
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
$imported = {} if $imported == nil
$imported["Dash_8DirMove"] = true
module KGC::Dash_8DirMove
SLANT_SUFFIX = "#"
end
module KGC
module Commands
module_function
def reset_walk_speed
$game_player.reset_move_speed
end
def set_walk_speed(value)
$game_system.temp_walk_speed = value
end
def set_dash_speed(value)
$game_system.temp_dash_speed = value
end
end
end
class Game_Interpreter
include KGC::Commands
end
class Game_System
attr_accessor :temp_dash_speed
attr_accessor :temp_walk_speed
alias initialize_KGC_Dash_8DirMove initialize
def initialize
initialize_KGC_Dash_8DirMove
@temp_dash_speed = nil
@temp_walk_speed = nil
end
end
# www.ultimateam.pl
class Game_Party < Game_Unit
def decrease_steps
@steps -= 1
end
end
class Game_Character
def direction_8dir
return @direction
end
alias set_direction_KGC_Dash_8DirMove set_direction
def set_direction(direction)
last_dir = @direction
set_direction_KGC_Dash_8DirMove(direction)
if !@direction_fix && direction != 0
@direction_8dir = direction
end
end
alias move_lower_left_KGC_Dash_8DirMove move_lower_left
def move_lower_left
move_lower_left_KGC_Dash_8DirMove
@direction_8dir = 1 unless @direction_fix
end
alias move_lower_right_KGC_Dash_8DirMove move_lower_right
def move_lower_right
move_lower_right_KGC_Dash_8DirMove
@direction_8dir = 3 unless @direction_fix
end
alias move_upper_left_KGC_Dash_8DirMove move_upper_left
def move_upper_left
move_upper_left_KGC_Dash_8DirMove
@direction_8dir = 7 unless @direction_fix
end
alias move_upper_right_KGC_Dash_8DirMove move_upper_right
def move_upper_right
move_upper_right_KGC_Dash_8DirMove
@direction_8dir = 9 unless @direction_fix
end
end
class Game_Player < Game_Character
alias initialize_KGC_Dash_8DirMove initialize
def initialize
initialize_KGC_Dash_8DirMove
reset_move_speed
end
def direction_8dir
@direction_8dir = @direction if @direction_8dir == nil
return @direction_8dir
end
def reset_move_speed
@move_speed = KGC::Dash_8DirMove::DEFAULT_WALK_SPEED
end
# www.ultimateam.pl
if KGC::Dash_8DirMove::ENABLE_8DIR
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
if @reserved_move != nil
case @reserved_move
when :down
move_down if passable_l?(2)
when :left
move_left if passable_l?(4)
when :right
move_right if passable_l?(6)
when :up
move_up if passable_l?(8)
end
@reserved_move = nil
return
end
last_steps = $game_party.steps
case Input.dir8
when 1
if !passable_l?(2) && passable_l?(4)
move_left
@reserved_move = :down
elsif passable_l?(2) && !passable_l?(4)
move_down
@reserved_move = :left
elsif passable_l?(2)
move_down
move_left
end
@direction = 2
when 2
move_down
when 3
if !passable_l?(2) && passable_l?(6)
move_right
@reserved_move = :down
elsif passable_l?(2) && !passable_l?(6)
move_down
@reserved_move = :right
elsif passable_l?(2)
move_down
move_right
end
@direction = 6
when 4
move_left
when 6
move_right
when 7
if !passable_l?(8) && passable_l?(4)
move_left
@reserved_move = :up
elsif passable_l?(8) && !passable_l?(4)
move_up
@reserved_move = :left
elsif passable_l?(8)
move_up
move_left
end
@direction = 4
when 8
move_up
when 9
if !passable_l?(8) && passable_l?(6)
move_right
@reserved_move = :up
elsif passable_l?(8) && !passable_l?(6)
move_up
@reserved_move = :right
elsif passable_l?(8)
move_up
move_right
end
@direction = 8
else
return
end
@direction_8dir = Input.dir8
if $game_party.steps - last_steps == 2
$game_party.decrease_steps
end
end
def passable_l?(d)
if $imported["TilesetExtension"]
return passable?(@x, @y, d)
else
case d
when 1
return passable?(@x-1, @y+1)
when 2
return passable?(@x, @y+1)
when 3
return passable?(@x+1, @y+1)
when 4
return passable?(@x-1, @y)
when 6
return passable?(@x+1, @y)
when 7
return passable?(@x-1, @y-1)
when 8
return passable?(@x, @y-1)
when 9
return passable?(@x+1, @y-1)
end
end
return false
end
end
def update_move
distance = 2 ** @move_speed
if dash?
distance *= KGC::Dash_8DirMove::DASH_SPEED_RATE
if $game_system.temp_dash_speed == nil
@move_speed = KGC::Dash_8DirMove::DASH_SPEED_RATE
else
@move_speed = $game_system.temp_dash_speed
end
else
if $game_system.temp_walk_speed == nil
@move_speed = KGC::Dash_8DirMove::DEFAULT_WALK_SPEED
else
@move_speed = $game_system.temp_walk_speed
end
end
distance = Integer(distance)
@real_x = [@real_x - distance, @x * 256].max if @x * 256 < @real_x
@real_x = [@real_x + distance, @x * 256].min if @x * 256 > @real_x
@real_y = [@real_y - distance, @y * 256].max if @y * 256 < @real_y
@real_y = [@real_y + distance, @y * 256].min if @y * 256 > @real_y
update_bush_depth unless moving?
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
end
if KGC::Dash_8DirMove::ENABLE_8DIR_ANIMATION
class Sprite_Character < Sprite_Base
SLANT_ANIME_TABLE = { 1=>2, 3=>6, 7=>4, 9=>8 }
alias update_bitmap_KGC_Dash_8DirMove update_bitmap
def update_bitmap
name_changed = (@character_name != @character.character_name)
update_bitmap_KGC_Dash_8DirMove
if @tile_id > 0
@enable_slant = false
return
end
return unless name_changed
@enable_slant = true
begin
@character_name_slant = @character_name + KGC::Dash_8DirMove::SLANT_SUFFIX
Cache.character(@character_name_slant)
rescue
@enable_slant = false
end
end
alias update_src_rect_KGC_Dash_8DirMove update_src_rect
def update_src_rect
return if @tile_id > 0
if @enable_slant
update_src_rect_for_slant
else
update_src_rect_KGC_Dash_8DirMove
end
end
def update_src_rect_for_slant
index = @character.character_index
pattern = @character.pattern < 3 ? @character.pattern : 1
sx = (index % 4 * 3 + pattern) * @cw
dir = @character.direction_8dir
case dir % 2
when 0
if @last_slant
self.bitmap = Cache.character(@character_name)
@last_slant = false
end
else
unless @last_slant
self.bitmap = Cache.character(@character_name_slant)
@last_slant = true
end
dir = SLANT_ANIME_TABLE[dir]
end
sy = (index / 4 * 4 + (dir - 2) / 2) * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
end
end
# www.ultimateam.pl
W razie jak by to pomogło, to daję obrazek wszystkich skryptów:
Drugi skrypt to Brak ikonki save w menu.
Problem występuje tylko w VX Ace.
O to skrypt:
#==============================================================================
# ** Skrypt by Ozzma
#------------------------------------------------------------------------------
# www.ultimateam.pl
#==============================================================================
class Scene_Menu < Scene_Base
def initialize(menu_index = 0)
@menu_index = menu_index
end
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
@command_window.index = @menu_index
if $game_party.members.size == 0
@command_window.draw_item(0, false)
@command_window.draw_item(1, false)
@command_window.draw_item(2, false)
@command_window.draw_item(3, false)
end
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_End.new
end
end
end
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
class Scene_End < Scene_Base
def return_scene
$scene = Scene_Menu.new(4)
end
def update
super
update_menu_background
@command_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0
command_to_title
when 1
command_shutdown
when 2
command_cancel
end
end
end
end
Na VX działa normalnie.
Zmieniłem trochę, a mianowicie linijki które niby są błędne:
7 linijka:
Było "class Scene_Menu < Scene_Base"
Teraz jest "class Scene_Menu < Scene_MenuBase"
Linijka 117:
Było "class Scene_End < Scene_Base"
Teraz jest "class Scene_End < Scene_MenuBase"
Nie wiem czy to coś pomaga, ale w tym momencie grę można odpalić.
Kiedy tylko kliknę w czasie gry kliknę X lub Esc, wywala błąd, że w linijce piętnastej jest coś źle napisane, o to błąd:
![[Obrazek: 1c020f58c29c08c9med.jpg]](http://images40.fotosik.pl/2071/1c020f58c29c08c9med.jpg)
Proszę o pomoc, może Ayene wie co zrobić?