RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Time-Based Encounters

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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


Code: [Select]
#==============================================================================
#  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


  • modern algebra

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.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: February 11, 2010, 09:50:41 PM by Modern Algebra »

**
Rep: +0/-0Level 84
thanks  :D
I'm happy to see new scripts made by you
I hope you make many others
I don't speak English very well  ;)