Timed Encounter Rates
Version: 1.0
Author: modern algebra
Date: April 20, 2009
Version History
- <Version 1.0> 04.20.2009 - Original Release
Description
This script allows it so that encounters are not based on step count, but rather on seconds.
Features
- Can use seconds rather than steps to determine random encounters
- Can be toggled on and off easily, allowing for some maps to have this feature while others are step-based.
Screenshots
Not necessary or useful
Instructions
See inside the header for instructions
Script
#==============================================================================
# Timed Encounter Rates
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: April 20, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
# This script sets it so that encounters are not based on step count, but
# rather on seconds.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
# Insert this script above Main and below other custom scripts.
#
# The encounter rate determines the average number of seconds until an
# an encounter, and encounters will occur whether or not the player is
# moving.
#
# To turn it back to regular encounters by steps, all that is necessary is
# to type the following into a call script:
#
# $game_player.change_encounter_type (x)
#
# where x is either true or false, true being time-based encounters and
# false being step-based encounters. If you do not include x, it will simply
# toggle between the two.
#==============================================================================
#==============================================================================
# ** Game_Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - initialize, make_encounter_count, update
# new method - change_encounter_type
#==============================================================================
class Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias odrngb_wl65_tmencounters_int_2b54 initialize
def initialize (*args)
# Run Original Method
odrngb_wl65_tmencounters_int_2b54 (*args)
# Initialize time_encounter boolean
@time_encounters = true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Make Encounter Count
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias magbra_w3565_mkencnt_tmdenrs_4r3bt make_encounter_count
def make_encounter_count (*args)
# Run Original Method
magbra_w3565_mkencnt_tmdenrs_4r3bt (*args)
# Make encounter count by frames
@encounter_count *= 60 if @time_encounters
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_wltr_upd_timed_encounters_74b6 update
def update (*args)
# Run Original Method
modalg_wltr_upd_timed_encounters_74b6 (*args)
# Reduce @encounter_count
update_encounter if @time_encounters && !moving?
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Change Encounter Type
# boolean : true => time encounters; false => step encounters
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def change_encounter_type (boolean = nil)
@time_encounters = boolean == nil ? !@time_encounters : boolean
make_encounter_count
end
end
Credit
Thanks
- wltr3565, for requesting the script
Support
Please post in this topic for the swiftest response.
Known Compatibility Issues
No currently known compatibility issues.
Demo
No demo is necessary. Please see the script.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.