keetarin du'owain
Member
Before anyone says anything, these scripts do not belong to me, they belong to OS!
I need help combining his plug-ins for his random weather generator so that they remain compatible with it, specifically i want to combine these two:
Use code tags, please.
-Regi
I need help combining his plug-ins for his random weather generator so that they remain compatible with it, specifically i want to combine these two:
Code:
module OS
W_Regions = {
#Region => [[Maps],[Weathers]]
"Plains" => [[1,2],[1,2,3]]
}
class Weather
# Initialize
def initialize
# Type
@type = 0
# Power
@power = 0
# Memorized Weather Effects
@memorized = []
# Weathers available in the current map
@weathers = []
# The current map id
@map_id = 0
# Randomly selected frame count using W_MacCount
@count = rand(W_MaxCount - 1) + 1
# Weather Affects Allowed
@allowed = true
# Regional Data
for i in 0..W_Regions.keys.size - 1
if W_Regions.values[i][0].includes?(@map_id)
reg = W_Regions.values[i]
@region = [W_Regions.keys[i],reg[1]]
break
end
end
end
# Update
def update
# If weather effects are allowed
if @allowed == true
# And if the map id is different than the current map
if @map_id != $game_map.map_id
# Fix the map id and current weathers
@map_id = $game_map.map_id
@weathers = @region[1]
end
# Count Down
@count -= 1
# If count reaches 0
if @count <= 0
# Reset Count randomly
@count = rand(W_MaxCount - 1) + 1
# Generate Weather
gen_weather
end
# Fixes power so it isn't above 50
fix_power
# Fix Tone (Not perfect yet)
fix_tone
# Set weather effects
$game_screen.weather(@type,@power,rand(19) + 1)
end
return
end
end
# Region?
def region?
return @region[0]
end
end
Code:
module OS
W_Seasons = {
#Region => [[Maps],[Weathers]]
"Summer" => [],
"Autumn" => [1,2],
"Winter" => [3],
"Spring" => [1,2]
}
class Weather
# Initialize
def initialize
# Type
@type = 0
# Power
@power = 0
# Memorized Weather Effects
@memorized = []
# Weathers available in the current map
@weathers = []
# The current map id
@map_id = 0
# Randomly selected frame count using W_MacCount
@count = rand(W_MaxCount - 1) + 1
# Weather Affects Allowed
@allowed = true
# Seasonal Data
sea = W_Seasons[current_season?]
@season = [current_season?,sea]
end
# Update
def update
# If weather effects are allowed
if @allowed == true
# And if the map id is different than the current map
if @map_id != $game_map.map_id
# Fix the map id and current weathers and Season
sea = W_Seasons[current_season?]
@season = [current_season?,sea]
@map_id = $game_map.map_id
@weathers = @season[1]
end
# Count Down
@count -= 1
# If count reaches 0
if @count <= 0
# Reset Count randomly
@count = rand(W_MaxCount - 1) + 1
# Generate Weather
gen_weather
end
# Fixes power so it isn't above 50
fix_power
# Fix Tone (Not perfect yet)
fix_tone
# Set weather effects
$game_screen.weather(@type,@power,rand(19) + 1)
end
return
end
end
# Current Season?
def current_season?
if $game_time != nil
return $game_time.season?
elsif $game_world != nil
return $game_world.time.season?
else
return W_Season.keys[rand(W_Season.size - 1)]
end
end
# Season?
def season?
return @season[0]
end
end
Use code tags, please.
-Regi