Please Credit real owner of scripts if listed if not then noone to credit
Good luck script hunting :lol:
Zelda Map Scroll
By Yeyinde
http://www.mediafire.com/?z00lsyj5uht
Animation On lvl up
By SG[Sand Golem]
http://www.mediafire.com/?pu39jktgeen
Call Map event
By SG[Sand Golem]
http://www.mediafire.com/?xwedwwp4umd
Ap Hud Advanced
By Gando
http://www.mediafire.com/?wt2ctxjzmwt
Action over game screen display
By Unknown
http://www.mediafire.com/?efhevnoenfu
Actor Customization 5.0
By Sythesize
http://www.mediafire.com/?ybudj313nah
Advanced Event triggers
By Near Fantastica
Actor move frame speed
By Uknown
Analog input
By Near Fantastica
Mouse input Module
By Near Fantastica
Cone of view
By unkown
Custom Pause animation
By SlipKnot
http://i129.photobucket.com/albums/p240 ... es_but.png[/img]
I Dont remember were you put the picture so expiriment
Good luck script hunting :lol:
Zelda Map Scroll
By Yeyinde
http://www.mediafire.com/?z00lsyj5uht
Animation On lvl up
By SG[Sand Golem]
http://www.mediafire.com/?pu39jktgeen
Call Map event
By SG[Sand Golem]
http://www.mediafire.com/?xwedwwp4umd
Ap Hud Advanced
By Gando
http://www.mediafire.com/?wt2ctxjzmwt
Action over game screen display
By Unknown
http://www.mediafire.com/?efhevnoenfu
Actor Customization 5.0
By Sythesize
http://www.mediafire.com/?ybudj313nah
Advanced Event triggers
By Near Fantastica
=begin
The below describes how you create additional triggers within events. This is done by creating 'Comments' within the map event's 'Event Code' like below:
Comment: Event Trigger
Comment: Logic NUMBER
Comment: SCRIPT TEST
Comment: EndTrigger
Boolean Logic
NUMBER = 0 :: NO Logic
NUMBER = 1 :: AND Logic
NUMBER = 2 :: OR Logic
NUMBER = 3 :: NOR Logic
NUMBER = 4 :: NAND Logic
NUMBER = 5 :: XOR Logic
NUMBER = 6 :: XNOR Logic
SCRIPT TEST :: is the script you want to test
Take Care,
Near
=end
#================================
# ¦ Advanced Event Triggers
#================================
# By: Near Fantastica
# Date: 11.07.05
# Version: 1
#================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
def script_trigger?(string)
result = false
begin
result = eval(string)
return true if result == true
return false if result == false
rescue SyntaxError, NameError => einterpreted
print "String Can not be interpreted: " + einterpreted
rescue StandardError => erun
print "Error running script: " + erun
end
end
#--------------------------------------------------------------------------
def check_trigger?(list)
triggers = []
logic = 0
for line in list
index = list.index(line)
next if not list[index].parameters[0].is_a?(String)
next if list[index].parameters[0] != "Event Trigger"
index += 1
command = list[index].parameters[0]
string = command.split
logic = string[1].to_i
loop do
index += 1
string = list[index].parameters[0]
break if string == "End Trigger"
triggers.push(true) if script_trigger?(string)
triggers.push(false) if not script_trigger?(string)
end
end
case logic
when 0
return false if triggers[0] == false
when 1 # AND
return false if triggers.include?(false)
when 2 # OR
array = triggers.uniq
return false if array.size == 1 and array.include?(false)
when 3 # NOR
array = triggers.uniq
return false if not (array.size == 1 and array.include?(false))
when 4 # NAND
array = triggers.uniq
return false if (array.size == 1 and triggers.include?(true))
when 5 # XOR
return false if not (triggers.include?(false) and triggers.include?(true))
when 6 # XNOR
return false if triggers.include?(false) and triggers.include?(true)
end
return true
end
#--------------------------------------------------------------------------
def refresh
new_page = nil
unless @erased
for page in @event.pages.reverse
c = page.condition
if c.switch1_valid
if $game_switches[c.switch1_id] == false
next
end
end
if c.switch2_valid
if $game_switches[c.switch2_id] == false
next
end
end
if c.variable_valid
if $game_variables[c.variable_id] < c.variable_value
next
end
end
if c.self_switch_valid
key = [@map_id, @event.id, c.self_switch_ch]
if $game_self_switches[key] != true
next
end
end
next if not check_trigger?(page.list)
new_page = page
break
end
end
if new_page == @page
return
end
@page = new_page
clear_starting
if @page == nil
@tile_id = 0
@character_name = ""
@character_hue = 0
@move_type = 0
@through = true
@trigger = nil
@list = nil
@interpreter = nil
return
end
@tile_id = @page.graphic.tile_id
@character_name = @page.graphic.character_name
@character_hue = @page.graphic.character_hue
if @original_direction != @page.graphic.direction
@direction = @page.graphic.direction
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != @page.graphic.pattern
@pattern = @page.graphic.pattern
@original_pattern = @pattern
end
@opacity = @page.graphic.opacity
@blend_type = @page.graphic.blend_type
@move_type = @page.move_type
@move_speed = @page.move_speed
@move_frequency = @page.move_frequency
@move_route = @page.move_route
@move_route_index = 0
@move_route_forcing = false
@walk_anime = @page.walk_anime
@step_anime = @page.step_anime
@direction_fix = @page.direction_fix
@through = @page.through
@always_on_top = @page.always_on_top
@trigger = @page.trigger
@list = @page.list
@interpreter = nil
if @trigger == 4
@interpreter = Interpreter.new
end
check_event_trigger_auto
end
end
class Game_CommonEvent
#--------------------------------------------------------------------------
def script_trigger?(string)
result = false
begin
result = eval(string)
return true if result == true
return false if result == false
rescue SyntaxError, NameError => einterpreted
print "String Can not be interpreted: " + einterpreted
rescue StandardError => erun
print "Error running script: " + erun
end
end
#--------------------------------------------------------------------------
def check_trigger?(list)
triggers = []
logic = 0
for line in list
index = list.index(line)
next if not list[index].parameters[0].is_a?(String)
next if list[index].parameters[0] != "Event Trigger"
index += 1
command = list[index].parameters[0]
string = command.split
logic = string[1].to_i
loop do
index += 1
string = list[index].parameters[0]
break if string == "End Trigger"
triggers.push(true) if script_trigger?(string)
triggers.push(false) if not script_trigger?(string)
end
end
case logic
when 0
return false if triggers[0] == false
when 1 # AND
return false if triggers.include?(false)
when 2 # OR
array = triggers.uniq
return false if array.size == 1 and array.include?(false)
when 3 # NOR
array = triggers.uniq
return false if not (array.size == 1 and array.include?(false))
when 4 # NAND
array = triggers.uniq
return false if (array.size == 1 and triggers.include?(true))
when 5 # XOR
return false if not (triggers.include?(false) and triggers.include?(true))
when 6 # XNOR
return false if triggers.include?(false) and triggers.include?(true)
end
return true
end
#--------------------------------------------------------------------------
def get_trigger
return true if self.trigger == 2 and $game_switches[self.switch_id] == true
temp = list
return true if check_trigger?(temp) == true
return false
end
#--------------------------------------------------------------------------
def refresh
if get_trigger == true
if @interpreter == nil
@interpreter = Interpreter.new
end
else
@interpreter = nil
end
end
end
The below describes how you create additional triggers within events. This is done by creating 'Comments' within the map event's 'Event Code' like below:
Comment: Event Trigger
Comment: Logic NUMBER
Comment: SCRIPT TEST
Comment: EndTrigger
Boolean Logic
NUMBER = 0 :: NO Logic
NUMBER = 1 :: AND Logic
NUMBER = 2 :: OR Logic
NUMBER = 3 :: NOR Logic
NUMBER = 4 :: NAND Logic
NUMBER = 5 :: XOR Logic
NUMBER = 6 :: XNOR Logic
SCRIPT TEST :: is the script you want to test
Take Care,
Near
=end
#================================
# ¦ Advanced Event Triggers
#================================
# By: Near Fantastica
# Date: 11.07.05
# Version: 1
#================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
def script_trigger?(string)
result = false
begin
result = eval(string)
return true if result == true
return false if result == false
rescue SyntaxError, NameError => einterpreted
print "String Can not be interpreted: " + einterpreted
rescue StandardError => erun
print "Error running script: " + erun
end
end
#--------------------------------------------------------------------------
def check_trigger?(list)
triggers = []
logic = 0
for line in list
index = list.index(line)
next if not list[index].parameters[0].is_a?(String)
next if list[index].parameters[0] != "Event Trigger"
index += 1
command = list[index].parameters[0]
string = command.split
logic = string[1].to_i
loop do
index += 1
string = list[index].parameters[0]
break if string == "End Trigger"
triggers.push(true) if script_trigger?(string)
triggers.push(false) if not script_trigger?(string)
end
end
case logic
when 0
return false if triggers[0] == false
when 1 # AND
return false if triggers.include?(false)
when 2 # OR
array = triggers.uniq
return false if array.size == 1 and array.include?(false)
when 3 # NOR
array = triggers.uniq
return false if not (array.size == 1 and array.include?(false))
when 4 # NAND
array = triggers.uniq
return false if (array.size == 1 and triggers.include?(true))
when 5 # XOR
return false if not (triggers.include?(false) and triggers.include?(true))
when 6 # XNOR
return false if triggers.include?(false) and triggers.include?(true)
end
return true
end
#--------------------------------------------------------------------------
def refresh
new_page = nil
unless @erased
for page in @event.pages.reverse
c = page.condition
if c.switch1_valid
if $game_switches[c.switch1_id] == false
next
end
end
if c.switch2_valid
if $game_switches[c.switch2_id] == false
next
end
end
if c.variable_valid
if $game_variables[c.variable_id] < c.variable_value
next
end
end
if c.self_switch_valid
key = [@map_id, @event.id, c.self_switch_ch]
if $game_self_switches[key] != true
next
end
end
next if not check_trigger?(page.list)
new_page = page
break
end
end
if new_page == @page
return
end
@page = new_page
clear_starting
if @page == nil
@tile_id = 0
@character_name = ""
@character_hue = 0
@move_type = 0
@through = true
@trigger = nil
@list = nil
@interpreter = nil
return
end
@tile_id = @page.graphic.tile_id
@character_name = @page.graphic.character_name
@character_hue = @page.graphic.character_hue
if @original_direction != @page.graphic.direction
@direction = @page.graphic.direction
@original_direction = @direction
@prelock_direction = 0
end
if @original_pattern != @page.graphic.pattern
@pattern = @page.graphic.pattern
@original_pattern = @pattern
end
@opacity = @page.graphic.opacity
@blend_type = @page.graphic.blend_type
@move_type = @page.move_type
@move_speed = @page.move_speed
@move_frequency = @page.move_frequency
@move_route = @page.move_route
@move_route_index = 0
@move_route_forcing = false
@walk_anime = @page.walk_anime
@step_anime = @page.step_anime
@direction_fix = @page.direction_fix
@through = @page.through
@always_on_top = @page.always_on_top
@trigger = @page.trigger
@list = @page.list
@interpreter = nil
if @trigger == 4
@interpreter = Interpreter.new
end
check_event_trigger_auto
end
end
class Game_CommonEvent
#--------------------------------------------------------------------------
def script_trigger?(string)
result = false
begin
result = eval(string)
return true if result == true
return false if result == false
rescue SyntaxError, NameError => einterpreted
print "String Can not be interpreted: " + einterpreted
rescue StandardError => erun
print "Error running script: " + erun
end
end
#--------------------------------------------------------------------------
def check_trigger?(list)
triggers = []
logic = 0
for line in list
index = list.index(line)
next if not list[index].parameters[0].is_a?(String)
next if list[index].parameters[0] != "Event Trigger"
index += 1
command = list[index].parameters[0]
string = command.split
logic = string[1].to_i
loop do
index += 1
string = list[index].parameters[0]
break if string == "End Trigger"
triggers.push(true) if script_trigger?(string)
triggers.push(false) if not script_trigger?(string)
end
end
case logic
when 0
return false if triggers[0] == false
when 1 # AND
return false if triggers.include?(false)
when 2 # OR
array = triggers.uniq
return false if array.size == 1 and array.include?(false)
when 3 # NOR
array = triggers.uniq
return false if not (array.size == 1 and array.include?(false))
when 4 # NAND
array = triggers.uniq
return false if (array.size == 1 and triggers.include?(true))
when 5 # XOR
return false if not (triggers.include?(false) and triggers.include?(true))
when 6 # XNOR
return false if triggers.include?(false) and triggers.include?(true)
end
return true
end
#--------------------------------------------------------------------------
def get_trigger
return true if self.trigger == 2 and $game_switches[self.switch_id] == true
temp = list
return true if check_trigger?(temp) == true
return false
end
#--------------------------------------------------------------------------
def refresh
if get_trigger == true
if @interpreter == nil
@interpreter = Interpreter.new
end
else
@interpreter = nil
end
end
end
By Uknown
class Game_Temp
attr_accessor :new_frame_count
alias more_frame_temp_init initialize
def initialize
more_frame_temp_init
@new_frame_count = 10
end
end
class Game_Character
def update
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
if @anime_count > 18 - @move_speed * 10
if not @step_anime and @stop_count > 0
@pattern = @original_pattern
else
if self.is_a?(Game_Event)
@pattern = (@pattern + 1) % 4
else
@pattern = (@pattern + 1) % $game_temp.new_frame_count
end
end
@anime_count = 0
end
if @wait_count > 0
@wait_count -= 1
return
end
if @move_route_forcing
move_type_custom
return
end
if @starting or lock?
return
end
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
case @move_type
when 1
move_type_random
when 2
move_type_toward_player
when 3
move_type_custom
end
end
end
end
class Sprite_Character < RPG::Sprite
def update
super
# If tile ID, file name, or hue are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# If tile ID value is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
if @character.is_a?(Game_Event)
@cw = bitmap.width / 4
else
@cw = bitmap.width / $game_temp.new_frame_count
end
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
# Set rectangular transfer
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
class Interpreter
def upgrade_frames
$game_temp.new_frame_count = 6
end
def downgrade_frames
$game_temp.new_frame_count = 4
end
end
attr_accessor :new_frame_count
alias more_frame_temp_init initialize
def initialize
more_frame_temp_init
@new_frame_count = 10
end
end
class Game_Character
def update
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
if @anime_count > 18 - @move_speed * 10
if not @step_anime and @stop_count > 0
@pattern = @original_pattern
else
if self.is_a?(Game_Event)
@pattern = (@pattern + 1) % 4
else
@pattern = (@pattern + 1) % $game_temp.new_frame_count
end
end
@anime_count = 0
end
if @wait_count > 0
@wait_count -= 1
return
end
if @move_route_forcing
move_type_custom
return
end
if @starting or lock?
return
end
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
case @move_type
when 1
move_type_random
when 2
move_type_toward_player
when 3
move_type_custom
end
end
end
end
class Sprite_Character < RPG::Sprite
def update
super
# If tile ID, file name, or hue are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# If tile ID value is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
if @character.is_a?(Game_Event)
@cw = bitmap.width / 4
else
@cw = bitmap.width / $game_temp.new_frame_count
end
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
# Set rectangular transfer
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
class Interpreter
def upgrade_frames
$game_temp.new_frame_count = 6
end
def downgrade_frames
$game_temp.new_frame_count = 4
end
end
Analog input
By Near Fantastica
#==============================================================================
# ** Anlog Movment
#------------------------------------------------------------------------------
# Near Fantastica
# Version 1
# 01.03.06
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Anlog Movment", "Near Fantastica", 1, "01.03.06")
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Anlog Movment") == true
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
alias nf_anlogmovement_scene_map_main_loop main_loop
#--------------------------------------------------------------------------
# * Main Loop
#--------------------------------------------------------------------------
def main_loop
#Update Mouse
Mouse.update
nf_anlogmovement_scene_map_main_loop
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
alias nf_anlogmovement_game_character_update_movement update_movement
#--------------------------------------------------------------------------
# * Update Movement
#--------------------------------------------------------------------------
def update_movement
nf_anlogmovement_game_character_update_movement
# If stop count exceeds a certain value (computed from move frequency)
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
# Branch by move type
case @move_type
when 4 # move_toward_target
x,y = Mouse.grid
return if x == nil or y == nil
move_toward_target(x, y)
end
end
end
#--------------------------------------------------------------------------
# * Move object toward target
#--------------------------------------------------------------------------
def move_toward_target(x, y)
# Get difference in player coordinates
sx = @x - x
sy = @y - y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
# Get absolute value of difference
abs_sx = sx.abs
abs_sy = sy.abs
# If horizontal and vertical distances are equal
if abs_sx == abs_sy
# Increase one of them randomly by 1
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
# If horizontal distance is longer
if abs_sx > abs_sy
# Move towards player, prioritize left and right directions
sx > 0 ? move_left : move_right
if not moving? and sy != 0
sy > 0 ? move_up : move_down
end
# If vertical distance is longer
else
# Move towards player, prioritize up and down directions
sy > 0 ? move_up : move_down
if not moving? and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
alias nf_anlogmovement_game_player_update_player_movement update_player_movement
#--------------------------------------------------------------------------
# * Player Movement Update
#--------------------------------------------------------------------------
def update_player_movement
anlog_movement
nf_anlogmovement_game_player_update_player_movement
end
#--------------------------------------------------------------------------
# * Anlog Movement
#--------------------------------------------------------------------------
def anlog_movement
@move_type = 4
x,y = Mouse.grid
return if x == nil or y == nil
sx = @x - x
sy = @y - y
abs_sx = sx.abs
abs_sy = sy.abs
distance = (abs_sx + abs_sy) / 2
case distance
when 0..1
@move_speed = 3
when 2..8
@move_speed = 4
end
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
# ** Anlog Movment
#------------------------------------------------------------------------------
# Near Fantastica
# Version 1
# 01.03.06
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Anlog Movment", "Near Fantastica", 1, "01.03.06")
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Anlog Movment") == true
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
alias nf_anlogmovement_scene_map_main_loop main_loop
#--------------------------------------------------------------------------
# * Main Loop
#--------------------------------------------------------------------------
def main_loop
#Update Mouse
Mouse.update
nf_anlogmovement_scene_map_main_loop
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
alias nf_anlogmovement_game_character_update_movement update_movement
#--------------------------------------------------------------------------
# * Update Movement
#--------------------------------------------------------------------------
def update_movement
nf_anlogmovement_game_character_update_movement
# If stop count exceeds a certain value (computed from move frequency)
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
# Branch by move type
case @move_type
when 4 # move_toward_target
x,y = Mouse.grid
return if x == nil or y == nil
move_toward_target(x, y)
end
end
end
#--------------------------------------------------------------------------
# * Move object toward target
#--------------------------------------------------------------------------
def move_toward_target(x, y)
# Get difference in player coordinates
sx = @x - x
sy = @y - y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
# Get absolute value of difference
abs_sx = sx.abs
abs_sy = sy.abs
# If horizontal and vertical distances are equal
if abs_sx == abs_sy
# Increase one of them randomly by 1
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
# If horizontal distance is longer
if abs_sx > abs_sy
# Move towards player, prioritize left and right directions
sx > 0 ? move_left : move_right
if not moving? and sy != 0
sy > 0 ? move_up : move_down
end
# If vertical distance is longer
else
# Move towards player, prioritize up and down directions
sy > 0 ? move_up : move_down
if not moving? and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
alias nf_anlogmovement_game_player_update_player_movement update_player_movement
#--------------------------------------------------------------------------
# * Player Movement Update
#--------------------------------------------------------------------------
def update_player_movement
anlog_movement
nf_anlogmovement_game_player_update_player_movement
end
#--------------------------------------------------------------------------
# * Anlog Movement
#--------------------------------------------------------------------------
def anlog_movement
@move_type = 4
x,y = Mouse.grid
return if x == nil or y == nil
sx = @x - x
sy = @y - y
abs_sx = sx.abs
abs_sy = sy.abs
distance = (abs_sx + abs_sy) / 2
case distance
when 0..1
@move_speed = 3
when 2..8
@move_speed = 4
end
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
Mouse input Module
By Near Fantastica
#==============================================================================
# ** Mouse Input Module
#------------------------------------------------------------------------------
# Near Fantastica
# Version 5
# 01.03.06
#------------------------------------------------------------------------------
# This module defines mouse input
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Mouse Input", "Near Fantastica", 5, "01.03.06")
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Mouse Input") == true
module Mouse
@position
GSM = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
Cursor_Pos= Win32API.new('user32', 'GetCursorPos', 'p', 'i')
Scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
Client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
#--------------------------------------------------------------------------
def Mouse.grid
return nil if @pos == nil
offsetx = $game_map.display_x / 4
offsety = $game_map.display_y / 4
x = (@pos[0] + offsetx) / 32
y = (@pos[1] + offsety) / 32
return [x, y]
end
#--------------------------------------------------------------------------
def Mouse.position
return @pos == nil ? [0, 0] : @pos
end
#--------------------------------------------------------------------------
def Mouse.global_pos
pos = [0, 0].pack('ll')
if Cursor_Pos.call(pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.pos
x, y = Mouse.screen_to_client(*Mouse.global_pos)
width, height = Mouse.client_size
begin
if (x >= 0 and y >= 0 and x < width and y < height)
return x, y
else
return nil
end
rescue
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.update
@pos = Mouse.pos
end
#--------------------------------------------------------------------------
def Mouse.screen_to_client(x, y)
return nil unless x and y
pos = [x, y].pack('ll')
if Scr2cli.call(Mouse.hwnd, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.hwnd
game_name = "\0" * 256
Readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return Findwindow.call('RGSS Player',game_name)
end
#--------------------------------------------------------------------------
def Mouse.client_size
rect = [0, 0, 0, 0].pack('l4')
Client_rect.call(Mouse.hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
# ** Mouse Input Module
#------------------------------------------------------------------------------
# Near Fantastica
# Version 5
# 01.03.06
#------------------------------------------------------------------------------
# This module defines mouse input
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Mouse Input", "Near Fantastica", 5, "01.03.06")
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Mouse Input") == true
module Mouse
@position
GSM = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
Cursor_Pos= Win32API.new('user32', 'GetCursorPos', 'p', 'i')
Scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
Client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
#--------------------------------------------------------------------------
def Mouse.grid
return nil if @pos == nil
offsetx = $game_map.display_x / 4
offsety = $game_map.display_y / 4
x = (@pos[0] + offsetx) / 32
y = (@pos[1] + offsety) / 32
return [x, y]
end
#--------------------------------------------------------------------------
def Mouse.position
return @pos == nil ? [0, 0] : @pos
end
#--------------------------------------------------------------------------
def Mouse.global_pos
pos = [0, 0].pack('ll')
if Cursor_Pos.call(pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.pos
x, y = Mouse.screen_to_client(*Mouse.global_pos)
width, height = Mouse.client_size
begin
if (x >= 0 and y >= 0 and x < width and y < height)
return x, y
else
return nil
end
rescue
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.update
@pos = Mouse.pos
end
#--------------------------------------------------------------------------
def Mouse.screen_to_client(x, y)
return nil unless x and y
pos = [x, y].pack('ll')
if Scr2cli.call(Mouse.hwnd, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
#--------------------------------------------------------------------------
def Mouse.hwnd
game_name = "\0" * 256
Readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return Findwindow.call('RGSS Player',game_name)
end
#--------------------------------------------------------------------------
def Mouse.client_size
rect = [0, 0, 0, 0].pack('l4')
Client_rect.call(Mouse.hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
Cone of view
By unkown
#the switch to be activated when the event see the hero. false if none
SWITCH = false
class Game_Character
attr_reader :cone
attr_reader :prev_x
attr_reader :prev_y
attr_reader :prev_dir
attr_accessor :sight
alias conesys_gamecharacter_initialize initialize
def initialize
@cone = []
@sight = 0
conesys_gamecharacter_initialize
end
def get_cone(sight = 7)
cone = []
@sight = sight
#This algorithim makes the cone using a 2d array
case self.direction
when 2 #down
#adds the first square
line = 1
cone.push([self.x,self.y + 1])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x,self.y + line])
1.upto(factor) do |a|
cone.push([self.x - a,self.y + line])
cone.push([self.x + a,self.y + line])
end
factor += 1
end
when 4 #left
line = 1
cone.push([self.x - 1,self.y])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x - line,self.y])
1.upto(factor) do |a|
cone.push([self.x - line,self.y - a])
cone.push([self.x - line,self.y + a])
end
factor += 1
end
when 6 #right
line = 1
cone.push([self.x + 1,self.y])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x + line,self.y])
1.upto(factor) do |a|
cone.push([self.x + line,self.y - a])
cone.push([self.x + line,self.y + a])
end
factor += 1
end
when 8 #up
#adds the first square
line = 1
cone.push([self.x,self.y + 1])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x,self.y - line])
1.upto(factor) do |a|
cone.push([self.x - a,self.y - line])
cone.push([self.x + a,self.y - line])
end
factor += 1
end
end
cone_obstacles(cone)
end
#here any tile that is covered by an obstacle is removed
#from the cone
def cone_obstacles(cone)
for i in 0..cone.length
if cone != nil
if !$game_map.passable?(cone[0], cone[1], 0)
case self.direction
when 2 #down
#the diference between the sight and the obstacle position
limit = self.sight - (cone[1] - self.y)
position = 1
#to make the read easier
index = cone.index([cone[0],cone[1] + 1])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0],cone[1] + position])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - a,cone[1] + position])
cone[index] = nil if index != nil
index = cone.index([cone[0] + a,cone[1] + position])
cone[index] = nil if index != nil
end
factor += 1
end
when 4 #left
#the diference between the sight and the obstacle position
limit = self.sight - (self.x - cone[0])
position = 1
#to make the read easier
index = cone.index([cone[0] - 1,cone[1]])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0] - position,cone[1]])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - position,cone[1] - a])
cone[index] = nil if index != nil
index = cone.index([cone[0] - position,cone[1] + a])
cone[index] = nil if index != nil
end
factor += 1
end
when 6 #right
#the diference between the sight and the obstacle position
limit = self.sight - (cone[0] - self.x)
position = 1
#to make the read easier
index = cone.index([cone[0] + 1,cone[1]])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0] + position,cone[1]])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] + position,cone[1] - a])
cone[index] = nil if index != nil
index = cone.index([cone[0] + position,cone[1] + a])
cone[index] = nil if index != nil
end
factor += 1
end
when 8 #up
#the diference between the sight and the obstacle position
limit = self.sight - (self.y - cone[1])
position = 1
#to make the read easier
index = cone.index([cone[0],cone[1] - 1])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0],cone[1] - position])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - a,cone[1] - position])
cone[index] = nil if index != nil
index = cone.index([cone[0] + a,cone[1] - position])
cone[index] = nil if index != nil
end
factor += 1
end
end
end
end
end
#update the variables used to check the need of a refresh
@prev_x = self.x
@prev_y = self.y
@prev_dir = self.direction
@cone = cone
end
def in_cone
#return false if the event do not have a cone
if cone != []
#now it checks if the actual position of the hero is inside the cone
for i in 0...cone.length
if cone != nil
if $game_player.x == cone[0] && $game_player.y == cone[1]
$game_switches[SWITCH] = true if SWITCH
$game_map.need_refresh = true
move_toward_player
end
end
end
end
end
def move_toward_player
# Get difference in player coordinates
sx = @x - $game_player.x
sy = @y - $game_player.y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
#Now the 8-direction following
#diagonal movements
if sx > 0 && sy > 0; move_upper_left
elsif sx > 0 && sy < 0; move_lower_left
elsif sx < 0 && sy > 0; move_upper_right
elsif sx < 0 && sy < 0; move_lower_right
#normal movement
elsif sx < 0 && sy == 0; move_right
elsif sx > 0 && sy == 0; move_left
elsif sx == 0 && sy < 0; move_down
elsif sx == 0 && sy > 0; move_up
end
end
#these modifications make the "hero touch" work better
#thanks Linkin_T for the help
def check_event_trigger_touch(x, y)
return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
old_touch(x, y)
end
def check_event_trigger_auto
return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
old_auto
end
end
class Game_Event < Game_Character
attr_reader :has_cone
alias conesys_gameevent_initialize initialize
alias old_touch check_event_trigger_touch
alias old_auto check_event_trigger_auto
def initialize(map_id, event)
#a flag that tells if the event is cone-following-enabled or not
@has_cone = false
conesys_gameevent_initialize(map_id, event)
end
#start the cone routine.
def add_cone(sight = 7)
@has_cone = true
get_cone(sight)
end
#stop the "cone following"
def stop_cone
@has_cone = false
end
end
class Game_Player < Game_Character
alias conesys_gameplayer_update update
def update
check_cone
conesys_gameplayer_update
end
def check_cone
#check if the event has a cone
for i in $game_map.events.keys
event = $game_map.events
if event.has_cone && $scene.is_a?(Scene_Map)
#check if the player is inside the cone of vision and make the
#event follow him
event.in_cone
#update the cone if the event moved or the direction is different
if event.x != event.prev_x || event.y != event.prev_y || event.direction != event.prev_dir
event.get_cone(event.sight)
end
end
end
end
end
=begin
Instructions
To make an event use the cone to follow you, all you gotta do is set this in an "call script".
Code:$game_map.events[event id].add_cone(sight)
The default sight is 7, if you want to use this, just use "add_cone".
to make him stop, use
Code:$game_map.events[event id].stop_cone
You can activate a switch too, set the SWITCH constant in the top of the code to the switch ID that you want to be activated
=end
SWITCH = false
class Game_Character
attr_reader :cone
attr_reader :prev_x
attr_reader :prev_y
attr_reader :prev_dir
attr_accessor :sight
alias conesys_gamecharacter_initialize initialize
def initialize
@cone = []
@sight = 0
conesys_gamecharacter_initialize
end
def get_cone(sight = 7)
cone = []
@sight = sight
#This algorithim makes the cone using a 2d array
case self.direction
when 2 #down
#adds the first square
line = 1
cone.push([self.x,self.y + 1])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x,self.y + line])
1.upto(factor) do |a|
cone.push([self.x - a,self.y + line])
cone.push([self.x + a,self.y + line])
end
factor += 1
end
when 4 #left
line = 1
cone.push([self.x - 1,self.y])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x - line,self.y])
1.upto(factor) do |a|
cone.push([self.x - line,self.y - a])
cone.push([self.x - line,self.y + a])
end
factor += 1
end
when 6 #right
line = 1
cone.push([self.x + 1,self.y])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x + line,self.y])
1.upto(factor) do |a|
cone.push([self.x + line,self.y - a])
cone.push([self.x + line,self.y + a])
end
factor += 1
end
when 8 #up
#adds the first square
line = 1
cone.push([self.x,self.y + 1])
factor = 1
#now comes the routine to make the cone
while line < sight
line += 1
cone.push([self.x,self.y - line])
1.upto(factor) do |a|
cone.push([self.x - a,self.y - line])
cone.push([self.x + a,self.y - line])
end
factor += 1
end
end
cone_obstacles(cone)
end
#here any tile that is covered by an obstacle is removed
#from the cone
def cone_obstacles(cone)
for i in 0..cone.length
if cone != nil
if !$game_map.passable?(cone[0], cone[1], 0)
case self.direction
when 2 #down
#the diference between the sight and the obstacle position
limit = self.sight - (cone[1] - self.y)
position = 1
#to make the read easier
index = cone.index([cone[0],cone[1] + 1])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0],cone[1] + position])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - a,cone[1] + position])
cone[index] = nil if index != nil
index = cone.index([cone[0] + a,cone[1] + position])
cone[index] = nil if index != nil
end
factor += 1
end
when 4 #left
#the diference between the sight and the obstacle position
limit = self.sight - (self.x - cone[0])
position = 1
#to make the read easier
index = cone.index([cone[0] - 1,cone[1]])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0] - position,cone[1]])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - position,cone[1] - a])
cone[index] = nil if index != nil
index = cone.index([cone[0] - position,cone[1] + a])
cone[index] = nil if index != nil
end
factor += 1
end
when 6 #right
#the diference between the sight and the obstacle position
limit = self.sight - (cone[0] - self.x)
position = 1
#to make the read easier
index = cone.index([cone[0] + 1,cone[1]])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0] + position,cone[1]])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] + position,cone[1] - a])
cone[index] = nil if index != nil
index = cone.index([cone[0] + position,cone[1] + a])
cone[index] = nil if index != nil
end
factor += 1
end
when 8 #up
#the diference between the sight and the obstacle position
limit = self.sight - (self.y - cone[1])
position = 1
#to make the read easier
index = cone.index([cone[0],cone[1] - 1])
cone[index] = nil if index != nil
factor = 1
#now comes the routine to remove the bloked tiles
while position < limit
position += 1
index = cone.index([cone[0],cone[1] - position])
cone[index] = nil if index != nil
1.upto(factor) do |a|
index = cone.index([cone[0] - a,cone[1] - position])
cone[index] = nil if index != nil
index = cone.index([cone[0] + a,cone[1] - position])
cone[index] = nil if index != nil
end
factor += 1
end
end
end
end
end
#update the variables used to check the need of a refresh
@prev_x = self.x
@prev_y = self.y
@prev_dir = self.direction
@cone = cone
end
def in_cone
#return false if the event do not have a cone
if cone != []
#now it checks if the actual position of the hero is inside the cone
for i in 0...cone.length
if cone != nil
if $game_player.x == cone[0] && $game_player.y == cone[1]
$game_switches[SWITCH] = true if SWITCH
$game_map.need_refresh = true
move_toward_player
end
end
end
end
end
def move_toward_player
# Get difference in player coordinates
sx = @x - $game_player.x
sy = @y - $game_player.y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
#Now the 8-direction following
#diagonal movements
if sx > 0 && sy > 0; move_upper_left
elsif sx > 0 && sy < 0; move_lower_left
elsif sx < 0 && sy > 0; move_upper_right
elsif sx < 0 && sy < 0; move_lower_right
#normal movement
elsif sx < 0 && sy == 0; move_right
elsif sx > 0 && sy == 0; move_left
elsif sx == 0 && sy < 0; move_down
elsif sx == 0 && sy > 0; move_up
end
end
#these modifications make the "hero touch" work better
#thanks Linkin_T for the help
def check_event_trigger_touch(x, y)
return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
old_touch(x, y)
end
def check_event_trigger_auto
return if not @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
old_auto
end
end
class Game_Event < Game_Character
attr_reader :has_cone
alias conesys_gameevent_initialize initialize
alias old_touch check_event_trigger_touch
alias old_auto check_event_trigger_auto
def initialize(map_id, event)
#a flag that tells if the event is cone-following-enabled or not
@has_cone = false
conesys_gameevent_initialize(map_id, event)
end
#start the cone routine.
def add_cone(sight = 7)
@has_cone = true
get_cone(sight)
end
#stop the "cone following"
def stop_cone
@has_cone = false
end
end
class Game_Player < Game_Character
alias conesys_gameplayer_update update
def update
check_cone
conesys_gameplayer_update
end
def check_cone
#check if the event has a cone
for i in $game_map.events.keys
event = $game_map.events
if event.has_cone && $scene.is_a?(Scene_Map)
#check if the player is inside the cone of vision and make the
#event follow him
event.in_cone
#update the cone if the event moved or the direction is different
if event.x != event.prev_x || event.y != event.prev_y || event.direction != event.prev_dir
event.get_cone(event.sight)
end
end
end
end
end
=begin
Instructions
To make an event use the cone to follow you, all you gotta do is set this in an "call script".
Code:$game_map.events[event id].add_cone(sight)
The default sight is 7, if you want to use this, just use "add_cone".
to make him stop, use
Code:$game_map.events[event id].stop_cone
You can activate a switch too, set the SWITCH constant in the top of the code to the switch ID that you want to be activated
=end
Custom Pause animation
By SlipKnot
MessagePause_Image: Filename of the picture, must be in the Pictures folder, its dimensions are: 64x16 (16x16 per frame)
MessagePause_x: x position of the graphic. Based on this formula: message x + message width - pause x
MessagePause_y: y position of the graphic. Based on this formula: message y + message height - pause y
MessagePause_Frames: Total frames for each animation frame.
#==============================================================================
# ** Custom Message Pause
#------------------------------------------------------------------------------
# Slipknot (dubealex.com/asylum)
# Version 1.0
# September 19, 2006
#==============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
MessagePause_Image = 'mes_but'
MessagePause_x = 32
MessagePause_y = 32
MessagePause_Frames = 20
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias slipknot_messagepause_init initialize
alias slipknot_messagepause_upd update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
slipknot_messagepause_init
@pause_g = Sprite.new
@pause_g.bitmap = RPG::Cache.picture(MessagePause_Image)
@pause_g.src_rect.set(0, 0, 16, 16)
@pause_g.visible = false
@pause_g.z = z + 3
@pause_g_frame = 0
end
#--------------------------------------------------------------------------
# * Set Pause
#--------------------------------------------------------------------------
def pause=(arg)
@pause_g.visible = arg
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if @pause_g.visible
@pause_g.x = x + width - MessagePause_x
@pause_g.y = y + height - MessagePause_y
f = MessagePause_Frames / 4
case @pause_g_frame
when 0..(f - 1)
@pause_g.src_rect.set(0, 0, 16, 16)
when f..(f * 2 - 1)
@pause_g.src_rect.set(16, 0, 16, 16)
when (f * 2)..(f * 3 - 1)
@pause_g.src_rect.set(32, 0, 16, 16)
else
@pause_g.src_rect.set(48, 0, 16, 16)
end
@pause_g_frame += 1
@pause_g_frame %= MessagePause_Frames
end
slipknot_messagepause_upd
end
end
MessagePause_x: x position of the graphic. Based on this formula: message x + message width - pause x
MessagePause_y: y position of the graphic. Based on this formula: message y + message height - pause y
MessagePause_Frames: Total frames for each animation frame.
#==============================================================================
# ** Custom Message Pause
#------------------------------------------------------------------------------
# Slipknot (dubealex.com/asylum)
# Version 1.0
# September 19, 2006
#==============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
MessagePause_Image = 'mes_but'
MessagePause_x = 32
MessagePause_y = 32
MessagePause_Frames = 20
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias slipknot_messagepause_init initialize
alias slipknot_messagepause_upd update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
slipknot_messagepause_init
@pause_g = Sprite.new
@pause_g.bitmap = RPG::Cache.picture(MessagePause_Image)
@pause_g.src_rect.set(0, 0, 16, 16)
@pause_g.visible = false
@pause_g.z = z + 3
@pause_g_frame = 0
end
#--------------------------------------------------------------------------
# * Set Pause
#--------------------------------------------------------------------------
def pause=(arg)
@pause_g.visible = arg
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if @pause_g.visible
@pause_g.x = x + width - MessagePause_x
@pause_g.y = y + height - MessagePause_y
f = MessagePause_Frames / 4
case @pause_g_frame
when 0..(f - 1)
@pause_g.src_rect.set(0, 0, 16, 16)
when f..(f * 2 - 1)
@pause_g.src_rect.set(16, 0, 16, 16)
when (f * 2)..(f * 3 - 1)
@pause_g.src_rect.set(32, 0, 16, 16)
else
@pause_g.src_rect.set(48, 0, 16, 16)
end
@pause_g_frame += 1
@pause_g_frame %= MessagePause_Frames
end
slipknot_messagepause_upd
end
end
I Dont remember were you put the picture so expiriment