PYRODOOM'S PROFILE

Bleh. Weee... it's Julie. Woo. Yay.
SMBX designer
On technical hiatus(barely posting but still around)
SRW2: Yoshi's Archipelag...
More Islands = Better

Search

Filter

[RMVX] Tracer Script Crash

Update: I am looking for a new stealth script. Please help.

Post an insane lie about the person above you

Benos's mind isn't full of fuck.

[RMVX] Tracer Script Crash

author=Trihan
It has to be push and pull events; it's the only script there that's trying to add to a variable. I have a suspicion of what part is causing it, but can I ask that you disable that script and see if it stops the error occurring?
I found out it was the tracer system itself. :|
Yeah...I felt it wasn't the push and pull script, so I was checking other scripts, and the one that stopped the switch error where it apparently wouldn't allow the switch to end the intro cutscene, was when I removed the tracer stealth system. :(
And I have no GOOD way of getting it back...wait...there is this page. I'll check it here then update to see if I find anything.
Edit: It was apparently the push and pull events that kept the tracer script from crashing before the title screen. In other words, it didn't work. The push and pull script was definetly not it. This can be locked now, my problem is fixed.

Super RMN World

Well Hali, it's my job to fix things that don't need to be fixed.

*falcon punches Halibabica to the next universe*

Post an insane lie about the person above you

Memories over here is Seiromem's evil twin brother. And guess what, I'm Memories. *takes off my hedgehog mask*

author=LockeZ
Pyrodoom once travelled to a parallel universe just so he could make out with himself.


Actually that was true. You know me too well. :3

Super RMN World

author=DarklordKeinor
author=seiromem
I'm still voting for Super Dr Toadly World.

Dr. Toadly needs to be lynched.

No. XD DON'T LYNCH HIM.
He's a character. HE CAN BE DEVELOPED.

Post an insane lie about the person above you

Seiemom secretly LOVES to be called Memories

Horror Developers

Do these games count?
Yume Nikki
IB
The Witch's House

[RMXP] Conditional Branches

author=Trihan
If he's still having problems tell him to zip up the project and send me a link to it; I'll take a look and let him know what's wrong with it.
OK!

[RMVX] Tracer Script Crash

Push and Pull events

#==============================================================================
# ** TDS Push & Pull Events
# Ver: 1.0
#------------------------------------------------------------------------------
# * Description:
# This script allows you to push and pull events on the map.
#------------------------------------------------------------------------------
# * Features:
# Can push or pull tagged events on the map.
# Can set to only push or pull events.
#------------------------------------------------------------------------------
# * Instructions:
# To make an event be pushed or pulled it must include in it's name:
#
#
#
# It must also include a comment in it's "List of command events" with the
# following:
#
# CAN_PUSH, CAN_PULL
#
# Both are not needed and they do not have to be in a specific order to work.
# They are simply the pushing and pulling options, if "CAN_PUSH" is not
# included then the player will not be able to push that event.
#------------------------------------------------------------------------------
# * Notes:
# Depending on the kind of event being pushed or pulled it might be necessary
# to fix it's direction.
#
# To lock an event inside an area you could use invisible events to limit
# where the event can be pushed or pulled.
#------------------------------------------------------------------------------
# * New Methods:
# New Methods here
# Class_Name:
# - push_pull_events_xy(x, y)
# ^ Used to determine events at X, Y coordinates.
#
# Game_Character:
# - can_be_pushed_or_pulled?
# ^ Used to determine if character can be pushed or pulled.
# - collide_with_events?(x, y)
# ^ Used to determine collision with other events and not with the player.
#
# Game_Event:
# - setup_event_push_pull
# ^ Used to setup push and pull settings.
#
# Game_Player:
# - can_push_or_pull_event?
# ^ Used to determine if player can push or pull event.
# - update_event_holding
# ^ Used to determine and select event to hold for pushing or pulling.
# - push_or_pull_held_event(dir)
# ^ Used to Push or Pull event based on input direction.
#------------------------------------------------------------------------------
# * Aliased Methods:
# Aliased methods here
# Game_Map:
# - setup_events
# ^ Aliased to setup movable events and save time when iterating events.
#
# Game_Character:
# - initialize
# ^ Aliased to initialize push and pull flags.
#
# Game_Event:
# - setup(new_page)
# ^ Aliased to start push and pull setup.
#
# Game_Player:
# - update
# ^ Aliased to update pushing and pulling input.
# - move_by_input
# ^ Aliased to push or pull any held event when possible.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#==============================================================================


#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_event_push_pull_game_map_setup_events setup_events
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :push_pull_events # Push or Pull events
#--------------------------------------------------------------------------
# * Event Setup
#--------------------------------------------------------------------------
def setup_events
# Run Original Method
tds_event_push_pull_game_map_setup_events
# Clear Push and Pull Events
@push_pull_events =
# Go Through Events in map and add push and pull events to array
$game_map.events.values.each {|event| @push_pull_events << event if event.can_be_pushed_or_pulled?}
end
#--------------------------------------------------------------------------
# * Get array of push and pull event at designated coordinates
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def push_pull_events_xy(x, y)
# Results Array
result =
# Go Through Push Pull Events in map and add push and pull events to array
$game_map.push_pull_events.each {|event| result.push(event) if event.pos?(x, y)}
# Return Results
return result
end
end


#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass of the
# Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :move_speed # Read Character Move Speed
attr_accessor :can_be_pushed # Can be Pushed Flag
attr_accessor :can_be_pulled # Can be Pulled Flag
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_event_push_pull_game_character_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Run Original Method
tds_event_push_pull_game_character_initialize
# Set Can be Pushed Flag to False (Default)
@can_be_pushed = false
# Set Can be Pulled Flag to False (Default)
@can_be_pulled = false
end
#--------------------------------------------------------------------------
# * Determine if character can be pushed or pulled
#--------------------------------------------------------------------------
def can_be_pushed_or_pulled?
# Return true if Can be pushed or Can be pulled
return true if @can_be_pushed or @can_be_pulled
# Return false by default
return false
end
#--------------------------------------------------------------------------
# * Determine Character Collision
# x : x-coordinate
# y : y-coordinate
# Detects normal character collision, including vehicles.
#--------------------------------------------------------------------------
def collide_with_events?(x, y)
for event in $game_map.events_xy(x, y) # Matches event position
unless event.through # Passage OFF?
return true if self.is_a?(Game_Event) # Self is event
return true if event.priority_type == 1 # Target is normal char
end
end
if @priority_type == 1 # Self is normal char
return true if $game_map.boat.pos_nt?(x, y) # Matches boat position
return true if $game_map.ship.pos_nt?(x, y) # Matches ship position
end
return false
end
end


#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_event_push_pull_game_event_setup setup
#--------------------------------------------------------------------------
# * Event page setup
#--------------------------------------------------------------------------
def setup(new_page)
# Run Original Method
tds_event_push_pull_game_event_setup(new_page)
# If event name includes Pop Up text Flag
if @event.name.include?("")
# Setup Push & Pull Event Properties
setup_event_push_pull
end
end
#--------------------------------------------------------------------------
# * Setup Event Push & Pull Properties
#--------------------------------------------------------------------------
def setup_event_push_pull
# Set Can be Pushed Flag to False
@can_be_pushed = false
# Set Can be Pulled Flag to False
@can_be_pulled = false
# Go Through Events Commands List
@list.each do |command|
# If Command code is 108 (Comment Start) or 408 (Comment Line)
if command.code == 108 or command.code == 408
# Set Can be Pushed Flag
@can_be_pushed = true if command.parameters.include?("CAN_PUSH")
# Set Can be Pulled Flag
@can_be_pulled = true if command.parameters.include?("CAN_PULL")
end
end
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 :holding_event # Event being held by the player
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_event_push_pull_game_player_update update
alias tds_event_push_pull_game_player_move_by_input move_by_input
#--------------------------------------------------------------------------
# * Determine if Player can Push or Pull Events
#--------------------------------------------------------------------------
def can_push_or_pull_event?
return false if @holding_event.nil?
return false if @holding_event.moving?
return false if $game_map.interpreter.running?
return false if !movable?
return true
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Run Original Method
tds_event_push_pull_game_player_update
# Update Event Holding
update_event_holding
end
#--------------------------------------------------------------------------
# * Update Event Holding
#--------------------------------------------------------------------------
def update_event_holding
# If Event is not nil and Not pressing C (Confirm)
if !@holding_event.nil? and !Input.press?(Input::C)
# Set Holding Event to nil
@holding_event = nil
return
end
# If Input Press C (Confirm) and not moving
if Input.press?(Input::C) and !moving? and @holding_event.nil?
# Get Front X Position
front_x = $game_map.x_with_direction(@x, @direction)
# Get Front Y Position
front_y = $game_map.y_with_direction(@y, @direction)
# Get Holding Event
@holding_event = $game_map.push_pull_events_xy(front_x, front_y).first
return
end
end
#--------------------------------------------------------------------------
# * Processing of Movement via input from the Directional Buttons
#--------------------------------------------------------------------------
def move_by_input
# If Can Push or Pull Event and trying to move in any direction
if can_push_or_pull_event? and Input.dir4 != 0
# Process Push or Pull of held event
push_or_pull_held_event(Input.dir4)
return
end
# Run Original Method
tds_event_push_pull_game_player_move_by_input
end
#--------------------------------------------------------------------------
# * Processing of Movement via input from the Directional Buttons
#--------------------------------------------------------------------------
def push_or_pull_held_event(dir)
# Return if Holding Event is nil
return if @holding_event.nil?
return if (dir == 2 or dir == 8) and self.x != @holding_event.x
return if (dir == 4 or dir == 6) and self.y != @holding_event.y
# Event Pushing Speed
push_speed = @holding_event.move_speed
# Player Speed Before Pushing
recover_speed = @move_speed
# Player Move Route
pmove_route = RPG::MoveRoute.new
pmove_route.wait = true
pmove_route.skippable = false
pmove_route.repeat = false
# Held Event Move Route
emove_route = RPG::MoveRoute.new
emove_route.wait = true
emove_route.skippable = false
emove_route.repeat = false
case dir
when 2 # Push or Pull Down
# If Above the Event (Push)
if self.y < @holding_event.y and @holding_event.can_be_pushed and (passable?(@x, @y + 2) and @holding_event.passable?(@x, @y + 2))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(1), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(1))
end
# If Below the Event (Pull)
if self.y > @holding_event.y and @holding_event.can_be_pulled and (passable?(@x, @y + 1) and !@holding_event.collide_with_events?(@x, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(13), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(1))
end
when 4 # Push or Pull Left
# If to the Right the Event (Push)
if self.x > @holding_event.x and @holding_event.can_be_pushed and (passable?(@x - 2, @y) and !@holding_event.collide_with_events?(@x - 2, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(12), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(2))
end
# If to the Left the Event (Pull)
if self.x < @holding_event.x and @holding_event.can_be_pulled and (passable?(@x - 1, @y) and !@holding_event.collide_with_events?(@x, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(13), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(2))
end
when 6 # Push or Pull Right
# If to the Left the Event (Push)
if self.x < @holding_event.x and @holding_event.can_be_pushed and (passable?(@x + 2, @y) and !@holding_event.collide_with_events?(@x + 2, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(12), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(3))
end
# If to the Right the Event (Pull)
if self.x > @holding_event.x and @holding_event.can_be_pulled and (passable?(@x + 1, @y) and !@holding_event.collide_with_events?(@x, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(13), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(3))
end
when 8 # Push or Pull Up
# If Below the Event (Push)
if self.y > @holding_event.y and @holding_event.can_be_pushed and (passable?(@x, @y - 2) and @holding_event.passable?(@x, @y - 2))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(4), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(4))
end
# If Above the Event (Pull)
if self.y < @holding_event.y and @holding_event.can_be_pulled and (passable?(@x, @y - 1) and !@holding_event.collide_with_events?(@x, @y))
# Set Player Move Route
pmove_route.list.push(RPG::MoveCommand.new(29, ), RPG::MoveCommand.new(13), RPG::MoveCommand.new(29, ))
# Set Event Move Route
emove_route.list.push(RPG::MoveCommand.new(4))
end
end
# Reverse Move Route Lists (They are executed in reverse)
pmove_route.list.reverse!
emove_route.list.reverse!
# Force Player Move Route
force_move_route(pmove_route)
# Force Held Event Move Route
@holding_event.force_move_route(emove_route)
end
end


TALES OF PHANTASIA LIKE MAIN MENU

#==============================================================================
# ** TDS Tales of Phantasia Like CMS - Main
# Ver: 1.0
#------------------------------------------------------------------------------
# * Description:
# A simple plug and play menu that looks like the tales of phantasia menu.
#------------------------------------------------------------------------------
# * Features:
# Changes menu interface.
#------------------------------------------------------------------------------
# * Instructions:
# None.
#------------------------------------------------------------------------------
# * Notes:
# None.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#==============================================================================


#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
# Menu Index
@menu_index = menu_index
# Make Empty Actor Status Windows Array
@actor_status_windows =
# Set Actor Status Selection Index
@actor_status_index = -1
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
# Create Menu Background
create_menu_background
# Create Command Window
create_command_window
# Create Actor Status Windows
create_actor_status_windows
# Create Game Stats Window
@stats_window = Window_Game_Stats.new(0, 336)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
# Dispose of Actor Status Windows
@actor_status_windows.each {|window| window.dispose}
# Dispose of Game Stats Window
@stats_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# Updat Menu Background
update_menu_background
# Update Command Window
@command_window.update
# Update Game Stats Window
@stats_window.update
# If Command Window is Active
if @command_window.active
# Update Command Selection
update_command_selection
elsif @actor_status_index >= 0
# Update Actor Selection
update_actor_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(544, , 4)
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Create Actor Status Window
#--------------------------------------------------------------------------
def create_actor_status_windows
# Actor Status Windows Array
@actor_status_windows =
# Go through Party Members Array and Make Status Windows
for i in 0...4
# Get Actor Object
actor = $game_party.members.at(i)
# Get Window X Position
x = (i % 2 ) * 272
# Get Window Y Position
y = 80 + (i / 2) * 128
# Make Actor Status Window
@actor_status_windows = Window_Actor_Menu_Status.new(actor, x, y)
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
# Deactivate Command Window
@command_window.active = false
if $game_party.last_actor_index < $game_party.members.size
@actor_status_index = $game_party.last_actor_index
else
@actor_status_index = 0
end
# Set Selected Actor Status Window
@actor_status_windows.selected(true)
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
# Activate Command Window
@command_window.active = true
# Set Actor Status Selection Index
@actor_status_index = -1
# Un Select All Actor Status Windows
@actor_status_windows.each {|window| window.selected(false)}
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
# Update Actor Status Windows
@actor_status_windows.each {|window| window.update}
# Update Actor Selection Cursor Input
update_actor_selection_cursor_input
# If Input Trigger B (Cancel)
if Input.trigger?(Input::B)
# Play Cancel SE
Sound.play_cancel
# End Actor Selection
end_actor_selection
# If Input Trigger C (Confirm)
elsif Input.trigger?(Input::C)
# Set Game Party Last Actor Index
$game_party.last_actor_index = @actor_status_index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@actor_status_index)
when 2 # equipment
$scene = Scene_Equip.new(@actor_status_index)
when 3 # status
$scene = Scene_Status.new(@actor_status_index)
end
end
end
#--------------------------------------------------------------------------
# * Update Actor Selection Cursor Input
#--------------------------------------------------------------------------
def update_actor_selection_cursor_input
# If Input Trigger or Repeat Up
if Input.trigger?(Input::UP) or Input.repeat?(Input::UP)
# De Select Actor Status Window
@actor_status_windows.selected(false)
# Decrease Actor Status Select Index
@actor_status_index -= 2
@actor_status_index %= $game_party.members.size
# Select Actor Status Window
@actor_status_windows.selected(true)
return
end
# If Input Trigger or Repeat Down
if Input.trigger?(Input::DOWN) or Input.repeat?(Input::DOWN)
# De Select Actor Status Window
@actor_status_windows.selected(false)
# Increase Actor Status Select Index
@actor_status_index += 2
@actor_status_index %= $game_party.members.size
# Select Actor Status Window
@actor_status_windows.selected(true)
return
end
# If Input Trigger or Repeat Right
if Input.trigger?(Input::RIGHT) or Input.repeat?(Input::RIGHT)
# De Select Actor Status Window
@actor_status_windows.selected(false)
# Increase Actor Status Select Index
@actor_status_index += 1
@actor_status_index %= $game_party.members.size
# Select Actor Status Window
@actor_status_windows.selected(true)
return
end
# If Input Trigger or Repeat Left
if Input.trigger?(Input::LEFT) or Input.repeat?(Input::LEFT)
# De Select Actor Status Window
@actor_status_windows.selected(false)
# Decrease Actor Status Select Index
@actor_status_index -= 1
@actor_status_index %= $game_party.members.size
# Select Actor Status Window
@actor_status_windows.selected(true)
return
end
end
end


#==============================================================================
# ** Window_Actor_Menu_Status
#------------------------------------------------------------------------------
# This window displays actor status on the menu screen.
#==============================================================================

class Window_Actor_Menu_Status < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor object
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(actor, x, y)
super(x, y, 272, 128)
# Set Actor Object
@actor = actor
# Refresh Window Contents
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Clear Window Contents
self.contents.clear
# Return if Actor is nil
return if @actor.nil?
# Draw Actor Face
draw_actor_face(@actor, 0, 0)
# Draw Actor Name
draw_actor_name(@actor, 105, 0)
# Draw Actor Level
draw_actor_level(@actor, 192, 0)
# Draw Actor State
draw_actor_state(@actor, 105, 26, 120)
# Draw Actor HP
draw_actor_hp(@actor, 105, 26 + WLH * 1, 135)
# Draw Actor MP
draw_actor_mp(@actor, 105, 26 + WLH * 2, 135)
end
#--------------------------------------------------------------------------
# * Set Selected
# select : selected (true = selected, false = unselected)
#--------------------------------------------------------------------------
def selected(select)
# If Selected
if select then self.cursor_rect = Rect.new(-10, -10, self.width-12, self.height-12) else self.cursor_rect.empty end
end
#--------------------------------------------------------------------------
# * Draw Level
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 24, y, 24, WLH, actor.level, 2)
end
end


#==============================================================================
# ** Window_Game_Stats
#------------------------------------------------------------------------------
# This window displays the game stats such as play time, location and gold.
#==============================================================================

class Window_Game_Stats < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 544, 80)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Set Font Color
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 120, 24, "Play time:")
self.contents.draw_text(0, 24, 120, 24, "Location:")
# Draw Currency
draw_currency_value($game_party.gold, 390, 0, 120)
# Set Font Color
self.contents.font.color = normal_color
# Get Map Name
map = load_data("Data/MapInfos.rvdata")
map_name = map.name
# Draw Map Name
self.contents.draw_text(85, 24, 300, 24, map_name)
# Draw Playtime
draw_playtime(95, 0)
# Update Self
update
end
#--------------------------------------------------------------------------
# * Draw Playtime
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def draw_playtime(x, y)
self.contents.clear_rect(x, y, 100, 24)
# Get Total Seconds Value
total_sec = Graphics.frame_count / Graphics.frame_rate
# Adjust Time
hour = total_sec / 60 / 60
min = total_sec / 60 % 60
sec = total_sec % 60
# Get Sprinf Format Text
text = sprintf("%02d:%02d:%02d", hour, min, sec)
# Set Font Color
self.contents.font.color = normal_color
# Draw Time Text
self.contents.draw_text(x, y, 149, 24, text)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Draw Playtime
draw_playtime(95, 0)
end
end


Confusion Walk

#==============================================================================
# ** TDS Confusion Walk
# Ver: 1.0
#------------------------------------------------------------------------------
# * Description:
# Movement of the character in the map is changed when afflicted with certain
# status effects.
#------------------------------------------------------------------------------
# * Features:
# Switches the movement on the map to opposites when a character is inflicted
# with a confuse state.
#
# Also allows to randomize the amounts of steps needed for the effect to wear
# off.
#------------------------------------------------------------------------------
# * Instructions:
# To use add the confusion step effect add the following a state's note box.
#
# CONFUSION_STEPS: DUR
#
# DUR = Number of steps that the effect will be active for.
#
# Example:
#
# CONFUSION_STEPS: 30
#
# To randomize the number of steps for the effect add the following to a
# state's notebox.
#
# RAND_CONFUSION_STEPS: S_MIN E_MAX
#
# S_MIN = Starting minimun value of steps that the effect will be active for.
# E_MAX = Ending maximun value of steps that the effect will be active for.
#
# Example:
#
# RAND_CONFUSION_STEPS: 10 50
#
# * The confusion steps effect would last between 10 to 50 steps. *
#------------------------------------------------------------------------------
# * Notes:
# None.
#------------------------------------------------------------------------------
# * Overwritten Methods:
# Game_Player:
# - move_by_input
# ^ Overwritten to add opposite input effect while confused effect is active.
#------------------------------------------------------------------------------
# * New Methods:
# RPG::State Module:
# - confusion_steps
# ^ Method used to read confusion steps values and return randomize values
# when needed.
#
# Game_Actor:
# - decrease_confusion_counter
# ^ Method used to decrease confusion steps values and remove them when needed.
#
# Game_Player:
# - confused?
# ^ Method used to determine if character is under the confused steps effect.
#------------------------------------------------------------------------------
# * Aliased Methods:
# Game_Battler:
# - add_state(state_id)
# ^ Aliased to add check states for the confusion states effect and apply it.
# - remove_state(state_id)
# ^ Aliased to check states for confusion steps and remove effect.
#
# Game_Actor:
# - setup(actor_id)
# ^ Aliased to add and initialize confusion steps counter hash.
#
# Game_Player:
# - increase_steps
# ^ Aliased to modify confusion steps effect values.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#==============================================================================

#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_confusion_walk_game_battler_add_state add_state unless $@
alias tds_confusion_walk_game_battler_remove_state remove_state unless $@
#--------------------------------------------------------------------------
# * Add State
# state_id : state ID
#--------------------------------------------------------------------------
def add_state(state_id)
# Run Original Method
tds_confusion_walk_game_battler_add_state(state_id)
# Get state data
state = $data_states
# Step Counter value
step_counter = state.confusion_steps
# If self is a Game Actor and confusion steps value is no false
if self.is_a?(Game_Actor) and step_counter != false
# Set Confusion Counter Value
self.confusion_counter = step_counter
end
end
#--------------------------------------------------------------------------
# * Remove State
# state_id : state ID
#-------------------------------------------------------------------------
def remove_state(state_id)
# Run Original Method
tds_confusion_walk_game_battler_remove_state(state_id)
# If self is a Game Actor and State is included in the confusion counter hash
if self.is_a?(Game_Actor) and self.confusion_counter.include?(state_id)
# Delete Confusion Counter State ID from the hash
self.confusion_counter.delete(state_id)
end
end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :confusion_counter # Confusion Walking Counter
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_confusion_walk_game_actor_setup setup unless $@
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
def setup(actor_id)
# Confusion Counter Hash
@confusion_counter = {}
# Run Original Method
tds_confusion_walk_game_actor_setup(actor_id)
end
#--------------------------------------------------------------------------
# * Decrease Confusion Steps Values
#--------------------------------------------------------------------------
def decrease_confusion_counter
# Return if confusion counter hash is empty
return if @confusion_counter.empty?
# Reduce the values of the confusion counter hash and remove states when they reach 0
@confusion_counter.each_key {|state_id| @confusion_counter -= 1 ;
remove_state(state_id) if @confusion_counter <= 0}
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
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_confusion_walk_game_player_increase_steps increase_steps unless $@
#--------------------------------------------------------------------------
# * Determine if Character is Confused
#--------------------------------------------------------------------------
def confused?
# Return false if confusion counter hash is empty
return false if $game_party.members.confusion_counter.empty?
# Return false if main actor confusion counter max value is less or equal to 0
return false if $game_party.members.confusion_counter.values.max <= 0
# Return true by default
return true
end
#--------------------------------------------------------------------------
# * Increase Steps
#--------------------------------------------------------------------------
def increase_steps
# Run Original Method
tds_confusion_walk_game_player_increase_steps
# Return if move route forcing (Moving by event command)
return if @move_route_forcing
# Decrease Confusion Counter Values
$game_party.members.decrease_confusion_counter
end
#--------------------------------------------------------------------------
# * Processing of Movement via input from the Directional Buttons
#--------------------------------------------------------------------------
def move_by_input
# Return if cannot move
return unless movable?
# Return if game map interpreter is running
return if $game_map.interpreter.running?
case Input.dir4
when 2; confused? ? move_up : move_down
when 4; confused? ? move_right : move_left
when 6; confused? ? move_left : move_right
when 8; confused? ? move_down : move_up
end
end
end

#==============================================================================
# ** RPG::State Module
#------------------------------------------------------------------------------
# This module handles state information.
#==============================================================================

module RPG
class State
#--------------------------------------------------------------------------
# * Get Confusion Steps value
#--------------------------------------------------------------------------
def confusion_steps
# If Notes Include Random Confusion Steps
if self.note.include?("RAND_CONFUSION_STEPS:")
# Check for Random Confusion Steps Information
self.note[/RAND_CONFUSION_STEPS: (+) (+)/]
# If minimun and maximun matches are not nil
if ($1 or $2) != nil then return .min end
end
# Check for confusion steps information
self.note[/CONFUSION_STEPS: (+)/]
# Return value
return $1 == nil ? false : $1.to_i
end
end
end


Vehichle Maps

#==============================================================================
# ** TDS Vehicle Maps
# Ver: 1.0
#------------------------------------------------------------------------------
# * Description:
# This script gives vehicles a map that can be accessed while on the vehicle.
#------------------------------------------------------------------------------
# * Features:
# Gives vehicles a map.
# Vehicle maps can be changed at any time.
# Allows you to return directly to the vehicle from a map.
#------------------------------------------------------------------------------
# * Instructions:
# To set a Vehicle map use this in a script call from an event:
#
# set_vehicle_map(vehicle, map_id, x, y, direction = 2)
#
# vehicle = Vehicle type (0: boat, 1: ship, 2: airship)
# map_id = map id
# x = x-coordinate
# y = y-coordinate
# direction = direction (2,4,6,8)
#
# Example:
#
# set_vehicle_map(1, 9, 8, 5, 2)
#
#
# To return to a vehicle use this in a script call from an event.
#
# return_to_vehicle(vehicle)
#
# vehicle = Vehicle type (0: boat, 1: ship, 2: airship)
#
# Example:
#
# return_to_vehicle(2)
#
#
# To remove a vehicle map information, use this in a script call from an event:
#
# clear_vehicle_map(vehicle)
#
# vehicle : Vehicle type (-1: all 0: boat, 1: ship, 2: airship)
#
# Example:
#
# clear_vehicle_map(1)
#------------------------------------------------------------------------------
# * Notes:
# To access a Vehicle Map press the "Shift" key.
#------------------------------------------------------------------------------
# * New Methods:
# Game_Vehicle:
# - current_location
# ^ Method used to get a vehicles current location.
#
# Game_Player:
# - can_transfer_to_vehicle_map?
# ^ Method used to determine if it's possible to go to a vehicle map.
# - setup_vehicle_map_transfer
# ^ Method used to setup a transfer from the vehicle to it's map.
# - return_to_vehicle_transfer(vehicle)
# ^ Method used to return the player to a vehicle from a map.
#
# Game_Interpreter:
# - set_vehicle_map(vehicle, map_id, x, y, direction = 2)
# ^ Method used to set a vehicles map and placing information.
# - clear_vehicle_map(vehicle)
# ^ Method used to remove vehicle map information.
# - return_to_vehicle(vehicle)
# ^ Method used to return the player to a vehicle from a map.
#
# Scene_Map:
# - update_vehicle_map_transfer
# ^ Method that waits for input to transfer player to a vehicle map.
# - update_transfer_to_vehicle
# ^ Method to smoothly transfer into a vehicle from a map.
#------------------------------------------------------------------------------
# * Aliased Methods:
# Game_Player:
# - initialize
# ^ Aliased to initialize vehicle map values hash
#
# Scene_Map:
# - update
# ^ Aliased to wait for input to transfer into a Vehicle map.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#==============================================================================

#==============================================================================
# ** Game_Vehicle
#------------------------------------------------------------------------------
# This class handles vehicles. It's used within the Game_Map class. If there
# are no vehicles on the current map, the coordinates is set to (-1,-1).
#==============================================================================

class Game_Vehicle < Game_Character
#--------------------------------------------------------------------------
# * Get Vehicle Current Position Values
#--------------------------------------------------------------------------
def current_location
# Return Vehicle Map ID, X and Y Values
return @map_id, @x, @y, @direction
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 :vehicle_maps # Vehicle Maps Properties Hash
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_vehicle_map_game_player_initialize initialize unless $@
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Run Original Method
tds_vehicle_map_game_player_initialize
# Vehicle Maps Properties Hash
@vehicle_maps = {}
end
#--------------------------------------------------------------------------
# * Determine if it's possible to transfer into a vehicle map
#--------------------------------------------------------------------------
def can_transfer_to_vehicle_map?
# Return False if moving
return false if moving?
# Return false if not in vehicle
return false if !in_vehicle?
# Return false if Vehicle Map Information is nil
return false if @vehicle_maps == nil
# Return true
return true
end
#--------------------------------------------------------------------------
# * Setup Vehicle Map Transfer
#--------------------------------------------------------------------------
def setup_vehicle_map_transfer
# Get off Vehicle processing
$game_map.vehicles.get_off
# Transfer information
t_inf = @vehicle_maps
# Erase vehicle type
@vehicle_type = -1
# Reserve Player Map Transfter
reserve_transfer(t_inf, t_inf, t_inf, t_inf)
# Remove transparency
@transparent = false
# Passage OFF
@through = false
# Reset Move Speed to normal walking
@move_speed = 4
end
#--------------------------------------------------------------------------
# * Return to Vehicle Transfer
# vehicle : Vehicle type (0: boat, 1: ship, 2: airship)
#--------------------------------------------------------------------------
def return_to_vehicle_transfer(vehicle)
# Map Transfer Information
t_inf = $game_map.vehicles.current_location
# Reserve Player Map Transfter
reserve_transfer(t_inf, t_inf, t_inf, t_inf)
# Vehicle Case
case vehicle
when 0 ; get_on_boat
when 1 ; get_on_ship
when 2 ; get_on_airship
end
# Set Walking BGM to map BGM
@walking_bgm = load_data(sprintf("Data/Map%03d.rvdata", t_inf)).bgm
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
#--------------------------------------------------------------------------
# * Set a Map for a Vehicle
# vehicle : Vehicle type (0: boat, 1: ship, 2: airship)
# map_id : map id
# x : x-coordinate
# y : y-coordinate
# direction : direction (2,4,6,8)
#--------------------------------------------------------------------------
def set_vehicle_map(vehicle, map_id, x, y, direction = 2)
# Set Vehicle Map Information
$game_player.vehicle_maps =
end
#--------------------------------------------------------------------------
# * Removes Vehicle Map Information
# vehicle : Vehicle type (-1: all 0: boat, 1: ship, 2: airship)
#--------------------------------------------------------------------------
def clear_vehicle_map(vehicle)
# If Vehicle type is less than 0 (Remove All)
if vehicle < 0
# Remove all Vehicle Map Information
$game_player.vehicle_maps.clear
else
# Remove Vehicle Information From Hash
$game_player.vehicle_maps.delete(vehicle)
end
end
#--------------------------------------------------------------------------
# * Return to a Vehicle
# vehicle : Vehicle type (0: boat, 1: ship, 2: airship)
#--------------------------------------------------------------------------
def return_to_vehicle(vehicle)
# If on Scene Map
if $scene.is_a?(Scene_Map)
# Fadeout Screen
$scene.fadeout(30)
# Return Player to Vehicle Process
$game_player.return_to_vehicle_transfer(vehicle)
# Loop 25 times(Frames)
(25).times do
# Update Basic
$scene.update_basic
# Update Game Player
$game_player.update
# Update Transfer to Vehicle
$scene.update_transfer_to_vehicle
end
# Fade In Screen
$scene.fadein(30)
end
end
end


#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================

class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tds_vehicle_map_scene_map_update update unless $@
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Run Original Method
tds_vehicle_map_scene_map_update
# Update Vehnicle Map Transfer
update_vehicle_map_transfer
end
#--------------------------------------------------------------------------
# * Update Vehicle Map Transfer
#--------------------------------------------------------------------------
def update_vehicle_map_transfer
# Return if displaying a message
return if $game_message.visible
# Return if Game Map Interpreter is running
return if $game_map.interpreter.running?
# Return if Game Player cannot transfer into a vehicle map
return if !$game_player.can_transfer_to_vehicle_map?
# If Input Trigger Shift
if Input.trigger?(Input::A)
# Fadeout Screen
fadeout(30)
# Transfer Player to Vehicle Map
$game_player.setup_vehicle_map_transfer
# Loop 20 times(Frames)
(20).times do
# Update Basic
update_basic
# Update Player Map Transfer
update_transfer_player
end
# Fade In Screen
fadein(30)
end
end
#--------------------------------------------------------------------------
# * Player Transfer to Vehicle Processing
#--------------------------------------------------------------------------
def update_transfer_to_vehicle
return unless $game_player.transfer?
@spriteset.dispose # Dispose of sprite set
$game_player.perform_transfer # Execute player transfer
$game_map.update
Graphics.wait(15)
@spriteset = Spriteset_Map.new # Recreate sprite set
Input.update
end
end


Trace Stealth System
module Trace # <= don't touch this
#==============================================================================
# ■ ᴿᴹ-VX ◦ Trace Stealth System ◦ version 2.2 ◦ Pʀơϝ. ʍԑơⱳ ʍԑơⱳ
#------------------------------------------------------------------------------
# 1.0
# ◦ Initial release
# 1.1
# ◦ Alert no longer counts down while a message is displayed
# ◦ Revised the trace method, slimming it down and fixing the following bugs:
# ◦ Fixed a bug where tracers' vision would sometimes be blocked by itself
# ◦ Fixed a bug where tracers would see through Same As Characters events
# 2.0
# ◦ Added the sound stealth system
# ◦ Changed the way the trace range is handled
# ◦ Added ability to disable a tracer's senses
# 2.1
# ◦ Patched minors bugs
# 2.2
# ◦ Rewrote trace method using Bresenham's Line Algorithm
#==============================================================================
# ● Tracing With Style - please read everything!
#------------------------------------------------------------------------------
# Tracer (n): Anything that is searching for the player, e.g., a guard.
# Designate which events are a tracer by including "tracer" in its name.
# When a tracer event sees the player, the Alert Switch it turned ON.
# When the Alert Switch is turned on, a countdown begins. If the player
# remains out of site for 1800 frames, the Alert Switch is turned OFF.
ALERT_SWITCH = 1 # any game switch
ALERT_COUNTDOWN = 1800 # frames (60 frames is 1 second; 1800 frames is 30 sec)
#==============================================================================
# ● Change How Far Your Guards Can See
#------------------------------------------------------------------------------
# By default, tracers have an average range of vision: 5 tiles.
# A tracer's range should be odd: 3, 5, 7, 9, etc.
# An even value will be the next odd number, e.g., 4 will be a range of 5.
TRACE_RANGE_DEFAULT = 5 # any odd value
# You can change the range at any time by calling this line:
# ► $game_system.trace_range = n where n is the new sight range
# You may want to change the trace range when the lighting changes:
# ◦ For a dark room, or during the night, use 3 or 5.
# ◦ For a lit room, or during the day, use 5 or higher.
#==============================================================================
# ● Three Ways To Hide The Player From Sight
#------------------------------------------------------------------------------
# There are three methods that can be used to hide the player:
# ◦ Make the player transparent
# ◦ Make the player's opacity to HIDE_OPACITY or lower
# ◦ Change the Hide Switch to ON
HIDE_OPACITY = 100 # 0~255 (for realism, keep it low)
HIDE_SWITCH = 2 # any game switch
#==============================================================================
# ● 2.0 Feature ◦ Making a Ruckus: a guide to sound stealth ♫
#------------------------------------------------------------------------------
# All noises have a loudness value which is it's range. For example, a
# noise with a loudness of 4 will be heard by all guards within 4 tiles.
# To make a noise, call the following line from within a Move Route command:
# ► tss_noise(n) where n is the range of the noise
# When a tracer hears a noise, its Caution Self Swith is set ON.
# To have the tracer move toward the source the sound, call the following
# line from within it's custom autonomous movement:
# ► tss_investigate
# Once the tracer reaches the source, its Caution Self Switch is set OFF.
CAUTION_SELF_SWITCH = "C" # "A", "B", "C", or "D"
# When the player sprints, he or she makes some noise!
# You can change how much noise is made at any time by calling this line:
# ► $game_player.sprint_noise = n where n is the range of the noise
DEFAULT_SPRINT_NOISE = 3 # any value (set this to 0 to disable)
# Here are some example of noises and their estimated range:
# ◦ Creaking Floor............ 1~2
# ◦ Carefully Closing a Door.. 2~3
# ◦ Sneezing or Coughing...... 4~5
# ◦ Bumping Into Something.... 4~5
# ◦ Tripping Over Furniture... 6~7
# ◦ Breaking Glass............ 8~9
# Sprinting:
# ◦ Thief Sprinting........... 2~3
# ◦ Civilian Sprinting........ 4~6
# ◦ Soldier Sprinting......... 7~9
# Dialogue:
# ◦ Whispering................ 2~3
# ◦ Talking................... 4~6
# ◦ Shouting.................. 7~9
#==============================================================================
# ● 2.0 Feature ◦ Two Ways To Disable a Tracer's Senses
#------------------------------------------------------------------------------
# There are two methods that can be used to disable a tracer's "senses":
# ◦ Erase the tracer event
# ◦ Change it's Disabling Self Switch to ON
# Prof tip: "D" is for many things- dead, disabled.... When you knock out a
# guard, erase or turn it's "D" self switch ON so he can't see or hear you!
ALLOW_SELF_SWITCH_DISABLING = true # true~false
DISABLING_SELF_SWITCH = "D" # "A", "B", "C", or "D"
#==============================================================================
# ● Special Effects
#------------------------------------------------------------------------------
# When a guard sees you, an ! appears above all heads and an ME plays.
SHOW_ALERT = true # Do you want the ! to display? true~false
PLAY_ALERT = true # Do you want an ME to play? true~false
ALERT_ME = "Audio/ME/Shock" # Which ME do you want to play? any ME
ALERT_VOLUME = 100 # At what volume? 0~100
ALERT_PITCH = 100 # At what pitch? 50~150
# When the guards call off the search, a ? appears above all heads.
SHOW_QUIT = true # Do you want the ? to display? true~false
# 2.0 Feature ◦ When a guards hears a noise, a ? appears above it's head
# and an ME plays.
SHOW_CAUTION = true # Do you want the ? to display? true~false
PLAY_CAUTION = true # Do you want an ME to play? true~false
CAUTION_ME = "Audio/ME/Mystery" # Which ME do you want to play? any ME
CAUTION_VOLUME = 100 # At what volume? 0~100
CAUTION_PITCH = 100 # At what pitch? 50~150
#==============================================================================
# ● 2.0 Feature ◦ Something For Fun
#------------------------------------------------------------------------------
# You can call huh? or hey! through an event script to display '?' or '!'
# above all active tracer heads!
#==============================================================================
# ■ DO NOT TOUCH ANYTHING BELOW THIS POINT - this is for your own safety!
#==============================================================================
CHECK_INTERVAL = 16 # 16
end
#==============================================================================
# Game System
#==============================================================================
class Game_System
#----------------------------------------------------------------------------
# Local Variables
#----------------------------------------------------------------------------
attr_accessor :trace_range
attr_accessor :alert_countdown
#----------------------------------------------------------------------------
# Initialize
#----------------------------------------------------------------------------
alias trace_system_initialize initialize unless $@
def initialize
trace_system_initialize
@trace_range = Trace::TRACE_RANGE_DEFAULT
@alert_countdown = 0
end
#----------------------------------------------------------------------------
# Update
#----------------------------------------------------------------------------
alias trace_system_update update unless $@
def update
trace_system_update
if @alert_countdown > 0 and !$game_message.visible
@alert_countdown -= 1
elsif @alert_countdown <= 0 and $game_switches
if Trace::SHOW_QUIT
for i in $game_map.events.keys
event = $game_map.events
if event.name.include?("tracer") and !event.erased
next if Trace::ALLOW_SELF_SWITCH_DISABLING and
event.get_self_switch(Trace::DISABLING_SELF_SWITCH)
event.balloon_id = 2
end
end
end
$game_switches = false
$game_map.need_refresh = true
end
end
end
#==============================================================================
# Game Character
#==============================================================================
class Game_Character
#----------------------------------------------------------------------------
# Local Variables
#----------------------------------------------------------------------------
attr_accessor :old_x
attr_accessor :old_y
attr_accessor :old_player_x
attr_accessor :old_player_y
attr_accessor :attention_x
attr_accessor :attention_y
#----------------------------------------------------------------------------
# Initialize
#----------------------------------------------------------------------------
alias trace_initialize initialize unless $@
def initialize
trace_initialize
@old_x = @x
@old_y = @y
@old_player_x = 0
@old_player_y = 0
@attention_x = @x
@attention_y = @y
end
#----------------------------------------------------------------------------
# Update
#----------------------------------------------------------------------------
alias trace_update update unless $@
def update
trace_update
if @id > 0 # if an event
if name.include?("tracer") and not @erased
if @old_x != @x or @old_y != @y or
@old_player_x != $game_player.x or @old_player_y != $game_player.y
if !$game_switches
if tss_trace
if Trace::PLAY_ALERT
name = Trace::ALERT_ME
volume = Trace::ALERT_VOLUME
pitch = Trace::ALERT_PITCH
Audio.me_play(name, volume, pitch)
end
if Trace::SHOW_ALERT
for event in $game_map.events.values
if event.name.include?("tracer") and !event.erased
next if Trace::ALLOW_SELF_SWITCH_DISABLING and
event.get_self_switch(Trace::DISABLING_SELF_SWITCH)
event.balloon_id = 1
end
end
end
$game_switches = true
$game_system.alert_countdown = Trace::ALERT_COUNTDOWN
$game_map.need_refresh = true
end
end
@old_x = @x
@old_y = @y
@old_player_x = $game_player.x
@old_player_y = $game_player.y
end
if .max < 2 and
get_self_switch(Trace::CAUTION_SELF_SWITCH)
@balloon_id = 2 if Trace::SHOW_QUIT
set_self_switch(Trace::CAUTION_SELF_SWITCH, false)
end
end
end
end
#----------------------------------------------------------------------------
# Trace
#----------------------------------------------------------------------------
def tss_trace(range = $game_system.trace_range)
return false if Trace::ALLOW_SELF_SWITCH_DISABLING and
get_self_switch(Trace::DISABLING_SELF_SWITCH)
return false if $game_player.transparent
return false if $game_switches
return false if $game_player.opacity <= Trace::HIDE_OPACITY
return false if range > 0 and !player_in_sight_field?
x0, y0 = @x * 32 + 16, @y * 32 + 16
x1, y1 = $game_player.x * 32 + 16, $game_player.y * 32 + 16
line_points = get_line(x0, y0, x1, y1)
check_countdown = Trace::CHECK_INTERVAL
line_points.each do |point|
if check_countdown > 0
check_countdown -= 1
else
check_countdown = Trace::CHECK_INTERVAL
x, y = point/32, point/32
return true if $game_player.pos?(x, y)
break if !$game_player.passable?(x, y) and !pos?(x, y)
end
end
return false
end
#----------------------------------------------------------------------------
# Player In Sight Field?
#----------------------------------------------------------------------------
def player_in_sight_field?
# Find the center of the range because the range is radial
range = 1 + $game_system.trace_range / 2
# Find the center of the field of vision
center_vision_x = @x
center_vision_y = @y
center_vision_y += range if @direction == 2
center_vision_x -= range if @direction == 4
center_vision_x += range if @direction == 6
center_vision_y -= range if @direction == 8
# Calculate the X & Y distances between the center of vision and player
sx = center_vision_x - $game_player.x
sy = center_vision_y - $game_player.y
# Return true if the player is within the field of vision
return true if .max < range
# Otherwise, return false
return false
end
#----------------------------------------------------------------------------
# Noise
#----------------------------------------------------------------------------
def tss_noise(range = 0)
if $game_switches == false
for event in $game_map.events.values
if event.name.include?("tracer") and !event.erased
next if Trace::ALLOW_SELF_SWITCH_DISABLING and
event.get_self_switch(Trace::DISABLING_SELF_SWITCH)
sx = event.x - @x
sy = event.y - @y
if .max <= range
if Trace::PLAY_CAUTION
name = Trace::CAUTION_ME
volume = Trace::CAUTION_VOLUME
pitch = Trace::CAUTION_PITCH
Audio.me_play(name, volume, pitch)
end
event.attention_x = @x
event.attention_y = @y
event.balloon_id = 2 if Trace::SHOW_CAUTION
event.set_self_switch(Trace::CAUTION_SELF_SWITCH, true)
end
end
end
end
end
#--------------------------------------------------------------------------
# * Investigate
#--------------------------------------------------------------------------
def tss_investigate
sx = @x - @attention_x
sy = @y - @attention_y
if sx.abs + sy.abs >= 20
move_random
else
case rand(6)
when 0..3; move_toward_position(@attention_x,@attention_y)
when 4; move_random
when 5; move_forward
end
end
end
#--------------------------------------------------------------------------
# * Move Toward Position
#--------------------------------------------------------------------------
def move_toward_position(x,y)
sx = @x - x
sy = @y - y
if sx != 0 or sy != 0
if sx.abs > sy.abs # Horizontal distance is longer
sx > 0 ? move_left : move_right # Prioritize left-right
if @move_failed and sy != 0
sy > 0 ? move_up : move_down
end
else # Vertical distance is longer
sy > 0 ? move_up : move_down # Prioritize up-down
if @move_failed and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
#----------------------------------------------------------------------------
# Get Self Switch
#----------------------------------------------------------------------------
def get_self_switch(switch)
key =
return $game_self_switches
end
#----------------------------------------------------------------------------
# Set Self Switch
#----------------------------------------------------------------------------
def set_self_switch(switch,true_false)
key =
$game_self_switches = true_false
$game_map.need_refresh = true
end
#----------------------------------------------------------------------------
# Get Line
#----------------------------------------------------------------------------
# Algorithm by.. Bresenham
# Written by.... RogueBasin
#----------------------------------------------------------------------------
def get_line(x0,y0,x1,y1)
original_x0, original_y0 = x0, y0
points =
steep = ((y1-y0).abs) > ((x1-x0).abs)
if steep
x0,y0 = y0,x0
x1,y1 = y1,x1
end
if x0 > x1
x0,x1 = x1,x0
y0,y1 = y1,y0
end
deltax = x1-x0
deltay = (y1-y0).abs
error = (deltax / 2).to_i
y = y0
ystep = nil
if y0 < y1
ystep = 1
else
ystep = -1
end
for x in x0..x1
if steep
points << {:x => y, :y => x}
else
points << {:x => x, :y => y}
end
error -= deltay
if error < 0
y += ystep
error += deltax
end
end
if original_x0 != points or original_y0 != points
points.reverse!
end
return points
end
end
#==============================================================================
# Game Event
#==============================================================================
class Game_Event < Game_Character
#----------------------------------------------------------------------------
# Name (get name)
#----------------------------------------------------------------------------
def name
return @event.name
end
#----------------------------------------------------------------------------
# Erased (get erased)
#----------------------------------------------------------------------------
def erased
return @erased
end
end
#==============================================================================
# Game Player
#==============================================================================
class Game_Player < Game_Character
#----------------------------------------------------------------------------
# Local Variables
#----------------------------------------------------------------------------
attr_accessor :old_steps
attr_accessor :sprint_noise
#----------------------------------------------------------------------------
# Initialize
#----------------------------------------------------------------------------
alias trace_player_initialize initialize unless $@
def initialize
trace_player_initialize
@old_steps = 0
@sprint_noise = Trace::DEFAULT_SPRINT_NOISE
end
#----------------------------------------------------------------------------
# Update
#----------------------------------------------------------------------------
alias trace_player_update update unless $@
def update
trace_player_update
if $game_party.steps > @old_steps + 5 and moving? and dash?
tss_noise(@sprint_noise)
@old_steps = $game_party.steps
end
end
end
#==============================================================================
# Game Interpreter
#==============================================================================
class Game_Interpreter
#----------------------------------------------------------------------------
# Huh?
#----------------------------------------------------------------------------
def huh?
for event in $game_map.events.values
if event.name.include?("tracer") and !event.erased
next if Trace::ALLOW_SELF_SWITCH_DISABLING and
event.get_self_switch(Trace::DISABLING_SELF_SWITCH)
event.balloon_id = 2 # display ?
end
end
end
#----------------------------------------------------------------------------
# Hey!
#----------------------------------------------------------------------------
def hey!
for event in $game_map.events.values
if event.name.include?("tracer") and !event.erased
next if Trace::ALLOW_SELF_SWITCH_DISABLING and
event.get_self_switch(Trace::DISABLING_SELF_SWITCH)
event.balloon_id = 1 # display !
end
end
end
end