-
В общем, реквест выполнен, НО, есть одно большое но. Дело в том, что увеличив количество персонажей в бою, их еще нужно расставить, а мне слишком лень это делать. Поэтому я написал небольшой хелп по-этому делу, который объясняет многие моменты, надеюсь понятно получилось. Его можно найти в демке. Изменения я провел, если я все правильно помню, только в скриптах Scene_SRPG, Window_StatusBar, т.е. при переносе боевки в свою игру их можно просто скопировать и заменить. Ну и не забыть в своем проекте выставить количество персонажей в бою как я тебе это раньше показывал. Всю остальную информацию по расстановке персонажей, можно найти в хелпе.
демка
-
Разве они в демке не расставлены? Запустил ее, все 8 героев в битве участвуют.
Спасибо.
-
они хреново расставлены) Ну смотри сам, если тебя такое устраивает, то ладно)
-
имеется 2 скрипта от Виктора, они работают вместе, но не удается привязать собственную графику для прыжка
один из вариантов было менять положение местами в скриптлисте, но нет, не прокатило
как я понял, скрипт на прыжки использует "свои прыжки", а не стандартные мукеровские
PHP код:
#==============================================================================
# ** Victor Engine - Free Jump
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
# v 1.00 - 2012.07.24 > First release
# v 1.01 - 2013.01.07 > Fixed issue with Terrain States and Moving Platform
#------------------------------------------------------------------------------
# This script adds a jumping system to the game, you can have the character
# to jump when the key set is pressed. While jumping, the character will
# not trigger events and terrain damage.
#------------------------------------------------------------------------------
# Compatibility
# Requires the script 'Victor Engine - Basic Module' v 1.25 or higher
# Requires the script 'Victor Engine - Pixel Movement' v 1.04 or higher
# If used with 'Victor Engine - Moving Platform' place this bellow it.
# If used with 'Victor Engine - Terrain States' place this bellow it.
#
# * Overwrite methods
# class Game_CharacterBase
# def screen_y
#
# * Alias methods
# class Game_Player < Game_Character
# def start_map_event(x, y, triggers, normal)
# def clear_transfer_info
# def dash?
# def update
# def move_by_input
# def update_nonmoving(last_moving)
# def on_damage_floor?
# def on_state_floor?
#
# class Sprite_Character < Sprite_Base
# def set_tile_bitmap
# def update_position
#
#------------------------------------------------------------------------------
# Instructions:
# To instal the script, open you script editor and paste this script on
# a new section bellow the Materials section. This script must also
# be bellow the script 'Victor Engine - Basic'
#
#------------------------------------------------------------------------------
# Comment calls note tags:
# Tags to be used in events comment box, works like a script call.
#
# <enable jump>
# Enable the free jump
#
# <disable jump>
# Disable the free jump
#
#------------------------------------------------------------------------------
# Additional instructions:
#
# Free Jump start DISABLED. Use the comment call to enable jump once you want
# it to be enabled.
#
# IMPORTANT: This mechanic was developed for single player porpouse only.
# It WILL NOT WORK WITH THE FOLLOWERS. Disable the followers visibility on
# where jumping is allowed. I will not make this system works with followers,
# simply don't ask anything about it.
#
#==============================================================================
#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
# Setting module for the Victor Engine
#==============================================================================
module Victor_Engine
#--------------------------------------------------------------------------
# * Jump key
# Setup the key that makes the player jump when pressed
# :A >> keyboard Shift :B >> keyboard X :C >> keyboard Z
# :X >> keyboard A :Y >> keyboard S :Z >> keyboard D
# :L >> keyboard Q :R >> keyboard W
#--------------------------------------------------------------------------
VE_JUMP_KEY = :X
#--------------------------------------------------------------------------
# * Setup moving during jumps
# If true you can control the movement while jumping, if false
# the direction will not change when the jump start.
#--------------------------------------------------------------------------
VE_FREE_MOVE = true
#--------------------------------------------------------------------------
# * required
# This method checks for the existance of the basic module and other
# VE scripts required for this script to work, don't edit this
#--------------------------------------------------------------------------
def self.required(name, req, version, type = nil)
if !$imported[:ve_basic_module]
msg = "The script '%s' requires the script\n"
msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
msg += "Go to [url]http://victorscripts.wordpress.com/[/url] to download this script."
msgbox(sprintf(msg, self.script_name(name), version))
exit
else
self.required_script(name, req, version, type)
end
end
#--------------------------------------------------------------------------
# * script_name
# Get the script name base on the imported value
#--------------------------------------------------------------------------
def self.script_name(name, ext = "VE")
name = name.to_s.gsub("_", " ").upcase.split
name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
name.join(" ")
end
end
$imported ||= {}
$imported[:ve_free_jump] = 1.00
Victor_Engine.required(:ve_free_jump, :ve_basic_module, 1.25, :above)
Victor_Engine.required(:ve_free_jump, :ve_pixel_movement, 1.04, :above)
#==============================================================================
# ** Game_CharacterBase
#------------------------------------------------------------------------------
# This class deals with characters. Common to all characters, stores basic
# data, such as coordinates and graphics. It's used as a superclass of the
# Game_Character class.
#==============================================================================
class Game_CharacterBase
#--------------------------------------------------------------------------
# * Overwrite method: screen_y
#--------------------------------------------------------------------------
def screen_y
$game_map.adjust_y(@real_y) * 32 + 32 - shift_y
end
#--------------------------------------------------------------------------
# * New method: position_adjust
#--------------------------------------------------------------------------
def position_adjust
jump_height
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :jump_enabled
#--------------------------------------------------------------------------
# * Alias method: clear_transfer_info
#--------------------------------------------------------------------------
alias :start_map_event_ve_free_jump :start_map_event
def start_map_event(x, y, triggers, normal)
return if jumping?
start_map_event_ve_free_jump(x, y, triggers, normal)
end
#--------------------------------------------------------------------------
# * Alias method: clear_transfer_info
#--------------------------------------------------------------------------
alias :clear_transfer_info_ve_free_jump :clear_transfer_info
def clear_transfer_info
clear_transfer_info_ve_free_jump
@dash_count = 0
end
#--------------------------------------------------------------------------
# * Alias method: dash?
#--------------------------------------------------------------------------
alias :dash_ve_free_jump? :dash?
def dash?
result = dash_ve_free_jump?
result = @jump_dash if jumping?
result
end
#--------------------------------------------------------------------------
# * Alias method: update
#--------------------------------------------------------------------------
alias :update_ve_free_jump :update
def update
update_ve_free_jump
free_jump if Input.trigger?(VE_JUMP_KEY) && jump_enabled
end
#--------------------------------------------------------------------------
# * Alias method: move_by_input
#--------------------------------------------------------------------------
alias :move_by_input_ve_free_jump :move_by_input
def move_by_input
return update_jump_move if !VE_FREE_MOVE && jumping?
move_by_input_ve_free_jump
end
#--------------------------------------------------------------------------
# * Alias method: update_nonmoving
#--------------------------------------------------------------------------
alias :update_nonmoving_ve_free_jump :update_nonmoving
def update_nonmoving(last_moving)
@dash_count += ((dash? && (last_moving || @moved)) ? 1 : -1)
@dash_count = [[@dash_count, 6].min, 0].max
update_nonmoving_ve_free_jump(last_moving)
end
#--------------------------------------------------------------------------
# * Alias method: on_damage_floor?
#--------------------------------------------------------------------------
alias :on_damage_floor_ve_free_jump? :on_damage_floor?
def on_damage_floor?
on_damage_floor_ve_free_jump? && !jumping?
end
#--------------------------------------------------------------------------
# * Alias method: on_state_floor?
#--------------------------------------------------------------------------
alias :on_state_floor_ve_free_jump? :on_state_floor? if $imported[:ve_terrain_states]
def on_state_floor?
on_state_floor_ve_free_jump? && !jumping?
end
#--------------------------------------------------------------------------
# * New method: update_jump
#--------------------------------------------------------------------------
def update_jump
@free_jump ? update_free_jump : super
end
#--------------------------------------------------------------------------
# * New method: position_adjust
#--------------------------------------------------------------------------
def free_jump
return if $game_map.interpreter.running? || jumping?
diag = $imported[:ve_roatation_turn] && diagonal_enabled? && diagonal?
@jump_peak = 3
@jump_count = @jump_peak * 2
@stop_count = 0
@run_jump = true
@free_jump = true
@end_press = false
@jump_dash = @dash_count == 6
@jump_move = Input.press?(Input.dir4)
rotation = $imported[:ve_roatation_turn]
@jump_dir = rotation ? get_final_direction[0] : @direction
@jump_diag = rotation ? get_final_direction[1] : @diagonal
straighten
end
#--------------------------------------------------------------------------
# * New method: position_adjust
#--------------------------------------------------------------------------
def update_free_jump
@end_press = true if !Input.press?(VE_JUMP_KEY)
jump_pressed = Input.press?(VE_JUMP_KEY) && !@end_press && @jump_peak < 8
@jump_count += 2 if jump_pressed
@jump_peak += 1 if jump_pressed
@jump_count = [@jump_count - 0.8, 0].max
update_move
update_bush_depth
straighten
@free_jump = false if @jump_count == 0
@jump_dash = false if @jump_count == 0
end
#--------------------------------------------------------------------------
# * New method: position_adjust
#--------------------------------------------------------------------------
def update_jump_move
return if moving? || !@jump_move
if !@jump_diag || @jump_diag == 0
move_straight(@jump_dir)
elsif @jump_diag && @jump_diag != 0
diagonal_movement(@jump_diag)
end
end
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Alias method: comment_call
#--------------------------------------------------------------------------
alias :comment_call_ve_free_jump :comment_call
def comment_call
call_jump_enable
comment_call_ve_free_jump
end
#--------------------------------------------------------------------------
# * New method: call_jump_enable
#--------------------------------------------------------------------------
def call_jump_enable
$game_player.jump_enabled = true if note =~ /<ENABLE JUMP>/i
$game_player.jump_enabled = false if note =~ /<DISABLE JUMP>/i
end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# * Alias method: set_tile_bitmap
#--------------------------------------------------------------------------
alias :set_tile_bitmap_ve_free_jump :set_tile_bitmap
def set_tile_bitmap
set_tile_bitmap_ve_free_jump
@cw = 16
@ch = 32
end
#--------------------------------------------------------------------------
# * Alias method: update_position
#--------------------------------------------------------------------------
alias :update_position_ve_free_jump :update_position
def update_position
update_position_ve_free_jump
self.oy = @ch + @character.position_adjust
end
end
PHP код:
#==============================================================================
# ** Victor Engine - Character Control
#------------------------------------------------------------------------------
# Author : Victor Sant
#
# Version History:
# v 1.00 - 2012.01.04 > First release
# v 1.01 - 2012.01.07 > Added Compatibility with Visual Equipment
# v 1.02 - 2012.01.14 > Fixed the positive sign on some Regular Expressions
# v 1.03 - 2012.01.15 > Fixed the Regular Expressions problem with "" and 灯
# v 1.04 - 2012.07.25 > Fixed Compatibility with Visual Equipment and
# > Diagonal Movement
# v 1.05 - 2012.08.02 > Compatibility with Basic Module 1.27
#------------------------------------------------------------------------------
# This script allows to control character chaset animations. You can set
# different graphis for walking, dashing and jumping, also you can display
# pose animations with simple comment call. This allows to animate characters
# on the map without the need of long Move Route event commands.
#------------------------------------------------------------------------------
# Compatibility
# Requires the script 'Victor Engine - Basic Module' v 1.27 or higher
# If used with 'Victor Engine - Multi Frames' place this bellow it.
# If used with 'Victor Engine - Visual Equip' place this bellow it.
# If used with 'Victor Engine - Diagonal Movement' place this bellow it.
#
# * Overwrite methods
# class Game_CharacterBase
# def update_animation
#
# * Alias methods
# class Game_CharacterBase
# def update_animation
# def init_public_members
# def init_private_members
# def update_anime_count
# def update_anime_pattern
# def move_straight(d, turn_ok = true)
# def move_diagonal(horz, vert)
# def update_move
# def update_jump
# def update_stop
#
# class Game_Interpreter
# def comment_call
#
# class Sprite_Character < Sprite_Base
# def graphic_changed?
# def update_character_info
# def set_bitmap_name
# def set_bitmap_position
#
#------------------------------------------------------------------------------
# Comment calls note tags:
# Tags to be used in events comment box, works like a script call.
#
# <actor change pose> <event change pose>
# settings settings
# </actor change pose> </event change pose>
# Display a custom pose, the pose overide any other pose being currently
# played, add the following values to the settings. The ID must be added,
# other values are optional.
# id: x : actor index or event ID
# name: "x" : pose sufix name. ("sufix")
# loop : pose animation loop, if added the pose will repeat.
# lock : position lock, can't move while playing the pose.
# walk : walking pose, if not set the pose will stop if walk.
# speed: x : pose animation speed, higher values makes the animation slow.
# frame: x : number of frams, can't exceed the max frames of the charset.
#
# <actor add pose> <event add pose>
# settings settings
# </actor add pose> </event add pose>
# Display a custom pose, the pose won't be displayed immediately, if there is
# another pose being displayed, it will wait it finish before, you can
# add multiple poses at once to make a long animation, add the following
# values to the settings. The ID must be added, other values are optional.
# id: x : actor index or event ID
# name: "x" : pose sufix name. ("sufix")
# loop : pose animation loop, if added the pose will repeat.
# lock : position lock, can't move while playing the pose.
# walk : walking pose, if not set the pose will stop if walk.
# speed: x : pose animation speed, higher values makes the animation slow.
# frame: x : number of frams, can't exceed the max frames of the charset.
#
# <actor idle stance i: "x"> <event idle stance i: "x">
# <actor walk stance i: "x"> <event walk stance i: "x">
# <actor dash stance i: "x"> <event dash stance i: "x">
# <actor jump stance i: "x"> <event jump stance i: "x">
# Change the stance for one of the default pose for the actor or event.
# i : actor index or event ID
# x : pose sufix name ("sufix")
#
# <actor clear stances: i> <event clear stances: i>
# Clear all changed stances for the actor or event
# i : actor index or event ID
#
# <actor clear pose: i> <event clear pose: i>
# Clear halts the current pose exhibition and clear all pose waiting to be
# played.
# i : actor index or event ID
#
#------------------------------------------------------------------------------
# Additional instructions:
#
# To properly display the poses you will need a character with the poses.
# You will need to make a new charset, with the same filename + the sufix.
#
# So if you have a chaset named "Actor1", you will need a charset named
# "Actor1[wlk]" (or whatever you set as the Walk sufix) if you want
# a custom walking pose.
#
# If a pose graphic don't exist, it will use the default graphic.
#
# If you make a pose loops, it will be displayed continuously until something
# force it to stop. It may be a movement (only if the settings doesn't include
# the 'walk' option), a pose change, or clear pose.
#
# Due to the animated frame, the charset may be off the tile center, you
# can solve that by adding [x*] or [y*] to the filename, where * is a number
# positive or negative,that way the position will be adjusted. it must be
# added before any other sufix
#
# if used with 'Victor Engine - Diagonal Movement' the diagonal movement
# sufix must come before the pose sufix.
#
# The general order for the sufixes is: filename[x*][y*][diag][pose]
#
#==============================================================================
#==============================================================================
# ** Victor Engine
#------------------------------------------------------------------------------
# Setting module for the Victor Engine
#==============================================================================
module Victor_Engine
#--------------------------------------------------------------------------
# * Default waling pose sufix
#--------------------------------------------------------------------------
VE_DEFAULT_WALK_SUFIX = "[wlk]"
#--------------------------------------------------------------------------
# * Default dashing pose sufix
#--------------------------------------------------------------------------
VE_DEFAULT_DASH_SUFIX = "[dsh]"
#--------------------------------------------------------------------------
# * Default jumping pose sufix
#--------------------------------------------------------------------------
VE_DEFAULT_JUMP_SUFIX = "[jmp]"
#--------------------------------------------------------------------------
# * required
# This method checks for the existance of the basic module and other
# VE scripts required for this script to work, don't edit this
#--------------------------------------------------------------------------
def self.required(name, req, version, type = nil)
if !$imported[:ve_basic_module]
msg = "The script '%s' requires the script\n"
msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
msg += "Go to [url]http://victorscripts.wordpress.com/[/url] to download this script."
msgbox(sprintf(msg, self.script_name(name), version))
exit
else
self.required_script(name, req, version, type)
end
end
#--------------------------------------------------------------------------
# * script_name
# Get the script name base on the imported value, don't edit this
#--------------------------------------------------------------------------
def self.script_name(name, ext = "VE")
name = name.to_s.gsub("_", " ").upcase.split
name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
name.join(" ")
end
end
$imported ||= {}
$imported[:ve_character_control] = 1.05
Victor_Engine.required(:ve_character_control, :ve_basic_module, 1.27, :above)
#==============================================================================
# ** Game_CharacterBase
#------------------------------------------------------------------------------
# This class deals with characters. Common to all characters, stores basic
# data, such as coordinates and graphics. It's used as a superclass of the
# Game_Character class.
#==============================================================================
class Game_CharacterBase
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pose_sufix
attr_accessor :pose_list
attr_accessor :idle_stance
attr_accessor :walk_stance
attr_accessor :dash_stance
attr_accessor :jump_stance
#--------------------------------------------------------------------------
# * Overwrite method: update_animation
#--------------------------------------------------------------------------
def update_animation
update_anime_count
if (@pose_speed != 0 && @anime_count > @pose_speed) ||
(@pose_speed == 0 && @anime_count > 18 - real_move_speed * 2)
update_anime_pattern
@anime_count = 0
change_pose(idle_stance) if @pattern == 0 && @playing_pose && !@pose_loop
end
end
#--------------------------------------------------------------------------
# * Alias method: init_public_members
#--------------------------------------------------------------------------
alias :init_public_members_ve_character_control :init_public_members
def init_public_members
init_public_members_ve_character_control
@pose_list = []
@pose_sufix = ""
clear_stances
end
#--------------------------------------------------------------------------
# * Alias method: init_private_members
#--------------------------------------------------------------------------
alias :init_private_members_ve_character_control :init_private_members
def init_private_members
init_private_members_ve_character_control
change_pose(idle_stance)
end
#--------------------------------------------------------------------------
# * Alias method: update_anime_count
#--------------------------------------------------------------------------
alias :update_anime_count_ve_character_control :update_anime_count
def update_anime_count
if @playing_pose
@anime_count += 1.5
else
update_anime_count_ve_character_control
end
end
#--------------------------------------------------------------------------
# * Alias method: update_anime_pattern
#--------------------------------------------------------------------------
alias :update_anime_pattern_ve_character_control :update_anime_pattern
def update_anime_pattern
if @playing_pose
@pattern = (@pattern + 1) % [frames, @pose_frame].min
else
update_anime_pattern_ve_character_control
end
end
#--------------------------------------------------------------------------
# * Alias method: move_straight
#--------------------------------------------------------------------------
alias :move_straight_ve_character_control :move_straight
def move_straight(d, turn_ok = true)
return if @pose_lock
move_straight_ve_character_control(d, turn_ok)
set_fixed_direction if @pose_direction
end
#--------------------------------------------------------------------------
# * Alias method: move_diagonal
#--------------------------------------------------------------------------
alias :move_diagonal_ve_character_control :move_diagonal
def move_diagonal(horz, vert)
return if @pose_lock
move_diagonal_ve_character_control(horz, vert)
set_fixed_direction if @pose_direction
end
#--------------------------------------------------------------------------
# * Alias method: update_move
#--------------------------------------------------------------------------
alias :update_move_ve_character_control :update_move
def update_move
moving_pose
update_move_ve_character_control
end
#--------------------------------------------------------------------------
# * Alias method: update_jump
#--------------------------------------------------------------------------
alias :update_jump_ve_character_control :update_jump
def update_jump
jumping_pose
update_jump_ve_character_control
end
#--------------------------------------------------------------------------
# * Alias method: update_stop
#--------------------------------------------------------------------------
alias :update_stop_ve_character_control :update_stop
def update_stop
update_stop_ve_character_control
resting_pose
end
#--------------------------------------------------------------------------
# * New method: resting_pose
#--------------------------------------------------------------------------
def resting_pose
return if @stop_count <= 1 || @playing_pose
change_pose(idle_stance) if pose_sufix != idle_stance
end
#--------------------------------------------------------------------------
# * New method: jumping_pose
#--------------------------------------------------------------------------
def jumping_pose
return if @pose_lock || @pose_walk
change_pose(jump_stance) if pose_sufix != jump_stance
end
#--------------------------------------------------------------------------
# * New method: moving_pose
#--------------------------------------------------------------------------
def moving_pose
return if @pose_lock || @pose_walk
@pose_list.clear
change_pose(walk_stance) if pose_sufix != walk_stance && !dash?
change_pose(dash_stance) if pose_sufix != dash_stance && dash?
end
#--------------------------------------------------------------------------
# * New method: change_pose
#--------------------------------------------------------------------------
def change_pose(sufix)
@playing_pose = false
reset_fixed_pose if @pose_direction
value = {sufix: sufix, anim: 0, speed: 0, frame: frames}
update_pose(value)
end
#--------------------------------------------------------------------------
# * New method: reset_pose_index
#--------------------------------------------------------------------------
def reset_pose_index
@character_index = @real_index
@pose_index = nil
end
#--------------------------------------------------------------------------
# * New method: reset_fixed_pose
#--------------------------------------------------------------------------
def reset_fixed_pose
@direction = @real_direction
@diagonal = @real_diagonal if $imported[:ve_diagonal_move]
@current_direction = @direction - 2 if $imported[:ve_roatation_turn]
@final_direction = @direction - 2 if $imported[:ve_roatation_turn]
update_direction if $imported[:ve_roatation_turn]
@pose_direction = nil
end
#--------------------------------------------------------------------------
# * New method: update_pose
#--------------------------------------------------------------------------
def update_pose(pose = default_pose.dup)
pose = get_next_pose(pose)
@pose_sufix = pose[:sufix]
@pose_speed = pose[:speed]
@pose_frame = pose[:frame]
@pose_walk = pose[:walk]
@pose_loop = pose[:loop]
@pose_lock = pose[:lock] && @playing_pose
@pose_direction = pose[:line] * 2 if pose[:line]
@real_direction = @direction
@real_diagonal = @diagonal if $imported[:ve_diagonal_move]
@anime_count = 0 unless move_pose?
@pattern = @playing_pose ? 0 : @original_pattern
set_fixed_direction if @pose_direction
end
#--------------------------------------------------------------------------
# * New method: set_fixed_direction
#--------------------------------------------------------------------------
def set_fixed_direction
@direction = @pose_direction
@diagonal = 0 if $imported[:ve_diagonal_move]
@current_direction = @direction - 2 if $imported[:ve_roatation_turn]
@final_direction = @direction - 2 if $imported[:ve_roatation_turn]
end
#--------------------------------------------------------------------------
# * New method: get_next_pose
#--------------------------------------------------------------------------
def get_next_pose(pose)
if pose == default_pose && !@pose_list.empty?
pose = @pose_list.shift
@playing_pose = true
end
pose
end
#--------------------------------------------------------------------------
# * New method: move_pose?
#--------------------------------------------------------------------------
def move_pose?
[walk_stance, dash_stance, jump_stance].include?(pose_sufix)
end
#--------------------------------------------------------------------------
# * New method: default_pose
#--------------------------------------------------------------------------
def default_pose
{sufix: @idle_stance, anim: 0, speed: 0, frame: frames}
end
#--------------------------------------------------------------------------
# * New method: start_pose
#--------------------------------------------------------------------------
def start_pose(pose)
clear_poses
@pose_list.push(pose)
update_pose
end
#--------------------------------------------------------------------------
# * New method: add_pose
#--------------------------------------------------------------------------
def add_pose(pose)
@pose_list.push(pose)
update_pose unless @playing_pose
end
#--------------------------------------------------------------------------
# * New method: clear_poses
#--------------------------------------------------------------------------
def clear_poses
@pose_list.clear
change_pose(idle_stance)
end
#--------------------------------------------------------------------------
# * New method: clear_stances
#--------------------------------------------------------------------------
def clear_stances
@idle_stance = ""
@walk_stance = VE_DEFAULT_WALK_SUFIX
@dash_stance = VE_DEFAULT_DASH_SUFIX
@jump_stance = VE_DEFAULT_JUMP_SUFIX
end
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Alias method: comment_call
#--------------------------------------------------------------------------
alias :comment_call_ve_character_control :comment_call
def comment_call
call_clear_pose("EVENT")
call_clear_pose("ACTOR")
call_change_stance("EVENT")
call_change_stance("ACTOR")
call_change_pose("EVENT", "ADD POSE")
call_change_pose("ACTOR", "ADD POSE")
call_change_pose("EVENT", "CHANGE POSE")
call_change_pose("ACTOR", "CHANGE POSE")
comment_call_ve_character_control
end
#--------------------------------------------------------------------------
# * New method: call_clear_pose
#--------------------------------------------------------------------------
def call_clear_pose(type)
note.scan(/<#{type} CLEAR POSE: (\d+)>/i) do
subject = $game_map.events[$1.to_i] if type == "EVENT"
subject = $game_map.actors[$1.to_i] if type == "ACTOR"
next unless subject
subject.clear_poses
end
end
#--------------------------------------------------------------------------
# * New method: call_clear_stances
#--------------------------------------------------------------------------
def call_clear_stances(type)
note.scan(/<#{type} CLEAR STANCES: (\d+)>/i) do
subject = $game_map.events[$1.to_i] if type == "EVENT"
subject = $game_map.actors[$1.to_i] if type == "ACTOR"
next unless subject
subject.clear_stances
end
end
#--------------------------------------------------------------------------
# * New method: call_change_stance
#--------------------------------------------------------------------------
def call_change_stance(type)
regexp = /<#{type} (\w+) STANCE (\d+): #{get_filename}>/i
note.scan(regexp) do |move, id, value|
subject = $game_map.events[id.to_i] if type == "EVENT"
subject = $game_map.actors[id.to_i] if type == "ACTOR"
next unless subject
subject.idle_stance = value if move.upcase == "IDLE"
subject.walk_stance = value if move.upcase == "WALK"
subject.dash_stance = value if move.upcase == "DASH"
subject.jump_stance = value if move.upcase == "JUMP"
end
end
#--------------------------------------------------------------------------
# * New method: call_change_pose
#--------------------------------------------------------------------------
def call_change_pose(type, add)
note.scan(get_all_values("#{type} #{add}")) do
value = $1.dup
if value =~ /ID: (\d+)/i
subject = $game_map.events[$1.to_i] if type == "EVENT"
subject = $game_map.actors[$1.to_i] if type == "ACTOR"
next unless subject
stance = subject.idle_stance
pose = {}
pose[:sufix] = value =~ /NAME: #{get_filename}/i ? $1 : stance
pose[:loop] = value =~ /LOOP/i
pose[:lock] = value =~ /LOCK/i
pose[:walk] = value =~ /WALK/i
pose[:speed] = value =~ /SPEED: (\d+)/i ? $1.to_i : 0
pose[:line] = value =~ /LINE: ([1234])/i ? $1.to_i : nil
pose[:frame] = value =~ /FRAMES: (\d+)/i ? $1.to_i : subject.frames
subject.start_pose(pose) if add.upcase == "CHANGE POSE"
subject.add_pose(pose) if add.upcase == "ADD POSE"
end
end
end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# * Alias method: graphic_changed?
#--------------------------------------------------------------------------
alias :graphic_changed_ve_character_control? :graphic_changed?
def graphic_changed?
graphic_changed_ve_character_control? ||
@pose_sufix != @character.pose_sufix
end
#--------------------------------------------------------------------------
# * Alias method: update_character_info
#--------------------------------------------------------------------------
alias :update_character_info_ve_character_control :update_character_info
def update_character_info
update_character_info_ve_character_control
@pose_sufix = @character.pose_sufix
end
#--------------------------------------------------------------------------
# * Alias method: set_bitmap_name
#--------------------------------------------------------------------------
alias :set_bitmap_name_ve_character_control :set_bitmap_name
def set_bitmap_name
sufix = ($imported[:ve_diagonal_move] ? diagonal_sufix : "") + @pose_sufix
if $imported[:ve_visual_equip]
return set_bitmap_name_ve_character_control
elsif character_exist?(@character_name + sufix)
return @character_name + sufix
elsif character_exist?(@character_name + @pose_sufix)
return @character_name + @pose_sufix
else
return set_bitmap_name_ve_character_control
end
end
#--------------------------------------------------------------------------
# * Alias method: set_bitmap_position
#--------------------------------------------------------------------------
alias :set_bitmap_position_ve_character_control :set_bitmap_position
def set_bitmap_position
set_bitmap_position_ve_character_control
self.ox -= (@character_name[/\[x([+-]?\d+)\]/i] ? $1.to_i : 0)
self.oy -= (@character_name[/\[y([+-]?\d+)\]/i] ? $1.to_i : 0)
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Alias method: draw_character
#--------------------------------------------------------------------------
alias :draw_character_ve_character_control :draw_character
def draw_character(character_name, character_index, x, y, parts = nil)
return unless character_name
x += (character_name[/\[x([+-]?\d+)\]/i] ? $1.to_i : 0)
y += (character_name[/\[y([+-]?\d+)\]/i] ? $1.to_i : 0)
args = [character_name, character_index, x, y]
args.push(parts) if $imported[:ve_visual_equip]
draw_character_ve_character_control(*args)
end
end
https://drive.google.com/folderview?...lk&usp=sharing
-
Довольно таки забавно читать свои посты 6-ти летней давности..) круто, что общество живет.
-
имеется скрипт
PHP код:
# Fullscreen++ v2.2 for VX and VXace by Zeus81
# Free for non commercial and commercial use
# Licence : [url]http://creativecommons.org/licenses/by-sa/3.0/[/url]
# Contact : [email]zeusex81@gmail.com[/email]
# (fr) Manuel d'utilisation : [url]http://pastebin.com/raw.php?i=1TQfMnVJ[/url]
# (en) User Guide : [url]http://pastebin.com/raw.php?i=EgnWt9ur[/url]
$imported ||= {}
$imported[:Zeus_Fullscreen] = __FILE__
class << Graphics
Disable_VX_Fullscreen = true
CreateWindowEx = Win32API.new('user32' , 'CreateWindowEx' , 'ippiiiiiiiii', 'i')
GetClientRect = Win32API.new('user32' , 'GetClientRect' , 'ip' , 'i')
GetDC = Win32API.new('user32' , 'GetDC' , 'i' , 'i')
GetSystemMetrics = Win32API.new('user32' , 'GetSystemMetrics' , 'i' , 'i')
GetWindowRect = Win32API.new('user32' , 'GetWindowRect' , 'ip' , 'i')
FillRect = Win32API.new('user32' , 'FillRect' , 'ipi' , 'i')
FindWindow = Win32API.new('user32' , 'FindWindow' , 'pp' , 'i')
ReleaseDC = Win32API.new('user32' , 'ReleaseDC' , 'ii' , 'i')
SendInput = Win32API.new('user32' , 'SendInput' , 'ipi' , 'i')
SetWindowLong = Win32API.new('user32' , 'SetWindowLong' , 'iii' , 'i')
SetWindowPos = Win32API.new('user32' , 'SetWindowPos' , 'iiiiiii' , 'i')
ShowWindow = Win32API.new('user32' , 'ShowWindow' , 'ii' , 'i')
SystemParametersInfo = Win32API.new('user32' , 'SystemParametersInfo' , 'iipi' , 'i')
UpdateWindow = Win32API.new('user32' , 'UpdateWindow' , 'i' , 'i')
GetPrivateProfileString = Win32API.new('kernel32', 'GetPrivateProfileString' , 'ppppip' , 'i')
WritePrivateProfileString = Win32API.new('kernel32', 'WritePrivateProfileString', 'pppp' , 'i')
CreateSolidBrush = Win32API.new('gdi32' , 'CreateSolidBrush' , 'i' , 'i')
DeleteObject = Win32API.new('gdi32' , 'DeleteObject' , 'i' , 'i')
unless method_defined?(:zeus_fullscreen_update)
HWND = FindWindow.call('RGSS Player', 0)
BackHWND = CreateWindowEx.call(0x08000008, 'Static', '', 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0)
alias zeus_fullscreen_resize_screen resize_screen
alias zeus_fullscreen_update update
end
private
def initialize_fullscreen_rects
@borders_size ||= borders_size
@fullscreen_rect ||= screen_rect
@workarea_rect ||= workarea_rect
end
def borders_size
GetWindowRect.call(HWND, wrect = [0, 0, 0, 0].pack('l4'))
GetClientRect.call(HWND, crect = [0, 0, 0, 0].pack('l4'))
wrect, crect = wrect.unpack('l4'), crect.unpack('l4')
Rect.new(0, 0, wrect[2]-wrect[0]-crect[2], wrect[3]-wrect[1]-crect[3])
end
def screen_rect
Rect.new(0, 0, GetSystemMetrics.call(0), GetSystemMetrics.call(1))
end
def workarea_rect
SystemParametersInfo.call(0x30, 0, rect = [0, 0, 0, 0].pack('l4'), 0)
rect = rect.unpack('l4')
Rect.new(rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1])
end
def hide_borders() SetWindowLong.call(HWND, -16, 0x14000000) end
def show_borders() SetWindowLong.call(HWND, -16, 0x14CA0000) end
def hide_back() ShowWindow.call(BackHWND, 0) end
def show_back
ShowWindow.call(BackHWND, 3)
UpdateWindow.call(BackHWND)
dc = GetDC.call(BackHWND)
rect = [0, 0, @fullscreen_rect.width, @fullscreen_rect.height].pack('l4')
brush = CreateSolidBrush.call(0)
FillRect.call(dc, rect, brush)
ReleaseDC.call(BackHWND, dc)
DeleteObject.call(brush)
end
def resize_window(w, h)
if @fullscreen
x, y, z = (@fullscreen_rect.width-w)/2, (@fullscreen_rect.height-h)/2, -1
else
w += @borders_size.width
h += @borders_size.height
x = @workarea_rect.x + (@workarea_rect.width - w) / 2
y = @workarea_rect.y + (@workarea_rect.height - h) / 2
z = -2
end
SetWindowPos.call(HWND, z, x, y, w, h, 0)
end
def release_alt
inputs = [1,18,2, 1,164,2, 1,165,2].pack('LSx2Lx16'*3)
SendInput.call(3, inputs, 28)
end
public
def load_fullscreen_settings
buffer = [].pack('x256')
section = 'Fullscreen++'
filename = './Game.ini'
get_option = Proc.new do |key, default_value|
l = GetPrivateProfileString.call(section, key, default_value, buffer, buffer.size, filename)
buffer[0, l]
end
@fullscreen = get_option.call('Fullscreen' , '0') == '1'
@fullscreen_ratio = get_option.call('FullscreenRatio', '0').to_i
@windowed_ratio = get_option.call('WindowedRatio' , '1').to_i
toggle_vx_fullscreen if Disable_VX_Fullscreen and vx_fullscreen?
fullscreen? ? fullscreen_mode : windowed_mode
end
def save_fullscreen_settings
section = 'Fullscreen++'
filename = './Game.ini'
set_option = Proc.new do |key, value|
WritePrivateProfileString.call(section, key, value.to_s, filename)
end
set_option.call('Fullscreen' , @fullscreen ? '1' : '0')
set_option.call('FullscreenRatio', @fullscreen_ratio)
set_option.call('WindowedRatio' , @windowed_ratio)
end
def fullscreen?
@fullscreen or vx_fullscreen?
end
def vx_fullscreen?
rect = screen_rect
rect.width == 640 and rect.height == 416
end
def toggle_fullscreen
fullscreen? ? windowed_mode : fullscreen_mode
end
def toggle_vx_fullscreen
windowed_mode if @fullscreen and !vx_fullscreen?
inputs = [1,18,0, 1,13,0, 1,13,2, 1,18,2].pack('LSx2Lx16'*4)
SendInput.call(4, inputs, 28)
zeus_fullscreen_update
self.ratio += 0 # refresh window size
end
def vx_fullscreen_mode
return if vx_fullscreen?
toggle_vx_fullscreen
end
def fullscreen_mode
return if vx_fullscreen?
initialize_fullscreen_rects
show_back
hide_borders
@fullscreen = true
self.ratio += 0 # refresh window size
end
def windowed_mode
toggle_vx_fullscreen if vx_fullscreen?
initialize_fullscreen_rects
hide_back
show_borders
@fullscreen = false
self.ratio += 0 # refresh window size
end
def toggle_ratio
return if vx_fullscreen?
self.ratio += 1
end
def ratio
return 1 if vx_fullscreen?
@fullscreen ? @fullscreen_ratio : @windowed_ratio
end
def ratio=(r)
return if vx_fullscreen?
initialize_fullscreen_rects
r = 0 if r < 0
if @fullscreen
@fullscreen_ratio = r
w_max, h_max = @fullscreen_rect.width, @fullscreen_rect.height
else
@windowed_ratio = r
w_max = @workarea_rect.width - @borders_size.width
h_max = @workarea_rect.height - @borders_size.height
end
if r == 0
w, h = w_max, w_max * height / width
h, w = h_max, h_max * width / height if h > h_max
else
w, h = width * r, height * r
return self.ratio = 0 if w > w_max or h > h_max
end
resize_window(w, h)
save_fullscreen_settings
end
def update
release_alt if Disable_VX_Fullscreen and Input.trigger?(:kALT) and Input.trigger?(:kLALT)
zeus_fullscreen_update
toggle_fullscreen if Input.trigger?(Input::F5)
toggle_ratio if Input.trigger?(Input::F6)
end
def resize_screen(width, height)
zeus_fullscreen_resize_screen(width, height)
self.ratio += 0 # refresh window size
end
end
Graphics.load_fullscreen_settings
из него хочу вывести переменные @fullscreen, @fullscreen_ratio, @windowed_ratio
собственно вывести через мукер, переменная = скрипту @fullscreen/../.. не удается, значение так и остаются равными 0
пытался дописать в сам скрипт $game_variables[N] = @fullscreen/../.. так же не проканало(
-
Так, а зачем тебе эти переменные, т.е. что ты с ними хочешь делать? Просто иметь возможность проверять их значение во время игры? если да, то самый просто вариант - вставить $game_variables[N] = @fullscreen/../.. в метод update.
-
А по первому запросу про прыжки, то просто добавь в free jump скрипт в конец метода update_free_jump (строка 250) - jumping_pose
-
Если скрипт начинает обрабатываться с самого запуска игры, то вставка $game_variables[N] = @fullscreen/../.. в метод update приведет к ошибке, так как (по крайне мере в АСЕ) переменные $game_variables создаются после выбора новой игры или загрузки сэйва с восстановлением их значений.
-
Нет, это класс графикс и апдейт в нем. Грубо говоря, это есть обновление картинки на экране в целом, т.е. оно динамическое(и грузит позже остальных) и ошибок не будет. Тестил же)
И переменные и переключатели не грузятся так поздно, они идут раньше, т.е. они грузят вместе со всеми скриптами, просто некоторые скрипты загружаются раньше. Можешь, ради интереса, в этот же апдейт который я указал пихнуть SceneManager.call(Scene_Debug) if $TEST && Input.press?(:F9), и вызвать дебаг окно еще в майн меню, до старта игры. Все свитчи и переменные будут на месте) Первыми подгружаются модули и переменные вне классов, а потом идут уже классы, т.е. пихнув game_variables где-то вне классов или в модуле - ты поймаешь ошибку, а если это уже в классе, то проблем нету.