Kain Nobel
Member
Map : Change Encounters
Version: 3.5
By: Kain Nobel
Introduction
I just created this so you can change map encounter list and step values... normally, you'd probably find yourself copy/pasting duplicate maps to have different encounters, but now you don't have to! It'll give your project just a little less weight, as far as 'duplicate maps' go...
Features
Script
Compatibility
Wow, this doesn't require SDK? How cool... however, this corrupts old save files, just to let'cha know!
Donno if this works for VX but maybe it does? I do recall VX using "areas" to define encounters, so I'm guessing that could be an issue, but I'm just making a general assumption that for some reason it might not work in VX. Either way, I have VX so if you need a version made for it then I'll see what I can do for ya!
Credit and Thanks
Armor King 108 : Reporting some issues I overlooked in the first couple of posts, thank you! :thumb:
Author's Notes
I want at least ONE reply, even if you find no bugs whatsoever and think this is great one reply will make me want to post more simple mini-scripts! If I get more replies on stuff, I'll start posting the more extravagant stuff I've been holding out on
Terms and Conditions
Another "Free to use in commercial and non-commercial releases" script, but credit is required thanks
Version: 3.5
By: Kain Nobel
Introduction
I just created this so you can change map encounter list and step values... normally, you'd probably find yourself copy/pasting duplicate maps to have different encounters, but now you don't have to! It'll give your project just a little less weight, as far as 'duplicate maps' go...
Features
- $game_map.encounter_list = [...] will change encounter list on current map
- $game_map.encounter_step = number will change encounter steps on current map
- $game_map.encounter_list = nil will reset encounter list to default
- $game_map.encounter_step = nil will reset encounter step to default
- $game_map.encounters[map_id].list = [...] will change encounter list on specified map
- $game_map.encounters[map_id].step = number will change encounter steps on specified map
- $game_map.encounters[map_id].list = nil will reset specified map's encounter list to default
- $game_map.encounters[map_id].step = nil will reset specified map's encounter step to default
- Changes to encounters and steps are effective the second you call it!
- Enough said... wow the features are your instructions, how odd?
Script
Code:
#===============================================================================
# ** Map : Change Encounters
#===============================================================================
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
if Object.const_defined?(:SDK)
SDK.log('Map.ChangeEncounters', 'Kain Nobel ©', 3.5, '2009.06.17')
end
#===============================================================================
# ** Game_Map::Encounter_List
#===============================================================================
class Game_Map::Encounters
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_accessor :list
attr_accessor :step
#-----------------------------------------------------------------------------
# * Object Initialization
#-----------------------------------------------------------------------------
def initialize
@list = nil
@step = nil
end
end
#===============================================================================
# ** Game_Map
#===============================================================================
class Game_Map
#-----------------------------------------------------------------------------
# * Public Instance Variables
#-----------------------------------------------------------------------------
attr_reader :encounters
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :chgencounters_gmmap_setup, :setup
alias_method :chgencounters_gmmap_encounterlist, :encounter_list
alias_method :chgencounters_gmmap_encounterstep, :encounter_step
#-----------------------------------------------------------------------------
# * Setup
#-----------------------------------------------------------------------------
def setup(map_id)
@encounters ||= Hash.new
chgencounters_gmmap_setup(map_id)
@encounters[map_id] ||= Game_Map::Encounters.new
end
#-----------------------------------------------------------------------------
# * Reset Encounters
#-----------------------------------------------------------------------------
def reset_encounters
encounter_list = @map.encounter_list
encounter_step = @map.encounter_step
end
#-----------------------------------------------------------------------------
# * Encounter List
#-----------------------------------------------------------------------------
def encounter_list
unless @encounters[map_id].list.is_a?(Array)
old_list = chgencounters_gmmap_encounterlist
@encounters[map_id].list = old_list
end
@encounters[map_id].list
end
#-----------------------------------------------------------------------------
# * Encounter Step
#-----------------------------------------------------------------------------
def encounter_step
unless @encounters[map_id].step.is_a?(Numeric)
old_step = chgencounters_gmmap_encounterstep
@encounters[map_id].step = old_step
$game_player.make_encounter_count
end
@encounters[map_id].step
end
#-----------------------------------------------------------------------------
# * Encounter List = (list)
#-----------------------------------------------------------------------------
def encounter_list=(list)
unless list.is_a?(Array) || list.is_a?(NilClass)
err = "Wrong argument for changing $game_map.encounter_list\n\nThe argum"
err += "ent must be an :Array: (or :NilClass: object to reset), not a "
err += ":#{list.class}:"
raise ArgumentError.new(err)
end
@encounters[map_id].list = list
end
#-----------------------------------------------------------------------------
# * Encounter Step = (step)
#-----------------------------------------------------------------------------
def encounter_step=(step)
unless step.is_a?(Numeric) || step.is_a?(NilClass)
err = "Wrong argument for changing $game_map.encounter_step\n\nThe argum"
err += "ent must be a :Numeric: (or :NilClass: object to reset), not a "
err += ":#{step.class}:"
raise ArgumentError.new(err)
end
@encounters[map_id].step = step
$game_player.make_encounter_count
end
end
Compatibility
Wow, this doesn't require SDK? How cool... however, this corrupts old save files, just to let'cha know!
Game_Map.encounter_list
Game_Map.encounter_step
Game_Map.encounter_step
Game_Map.encounter_list=
Game_Map.encounter_step=
Game_Map.encounter_step=
Donno if this works for VX but maybe it does? I do recall VX using "areas" to define encounters, so I'm guessing that could be an issue, but I'm just making a general assumption that for some reason it might not work in VX. Either way, I have VX so if you need a version made for it then I'll see what I can do for ya!
Credit and Thanks
Armor King 108 : Reporting some issues I overlooked in the first couple of posts, thank you! :thumb:
Author's Notes
I want at least ONE reply, even if you find no bugs whatsoever and think this is great one reply will make me want to post more simple mini-scripts! If I get more replies on stuff, I'll start posting the more extravagant stuff I've been holding out on
Terms and Conditions
Another "Free to use in commercial and non-commercial releases" script, but credit is required thanks