1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
#=============================================================================#
# Battleback by map by Fflo #
#=============================================================================#
#-----------------------------------------------------------------------------#
# What does this script do? #
#-----------------------------------------------------------------------------#
# Replaces tileset-specific battlebacks by map-specific battlebacks #
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# How to use that script: #
#-----------------------------------------------------------------------------#
# * Copy-paste the whole script into a new slot, under "Materials" #
# * If you want to know what I've changed, scroll and stop each time you find #
# "FFLO" (without quotes) #
# * Add a line to the example array for each map you'd like to add a #
# battleback #
# * If no valid mapId is found in the array, a rescue battleback will be #
# displayed instead of throwing an error #
# * The script should work without any modification #
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# Terms of use: #
#-----------------------------------------------------------------------------#
# * Free to use in commercial projects #
# * Give credit to Fflo #
#-----------------------------------------------------------------------------#
module Fflo_Script_Config
module Game_Map_Battleback
Default = "Stallion.png" # FFLO - Emergency case, for not existing mapId
Battlebacks = [] # FFLO - Do not remove this line!
# FFLO - Add entries
Battlebacks[0] = [1, "Cave.png"] # FFLO - [map_id, filename]
Battlebacks[1] = [2, "Stallion.png"]
Battlebacks[2] = [7, "Ecole.png"]
Battlebacks[3] = [8, "Classe.png"]
end
end
class Game_Map
alias gm_setup setup
def setup(map_id)
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
tileset = $data_tilesets[@map.tileset_id]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
# FFLO - Search Battlebacks if an array with index 0 = map_id exists
@current_map_battleback = Fflo_Script_Config::Game_Map_Battleback::Battlebacks
@current_map_battleback = @current_map_battleback.detect{|m|
m[0] == @map_id
}
# FFLO - Assign battleback if mapId exists, else use rescue battleback
@battleback_name = @current_map_battleback.nil? ?
Fflo_Script_Config::Game_Map_Battleback::Default :
@current_map_battleback[1]
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
@display_x = 0
@display_y = 0
@need_refresh = false
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
@fog_ox = 0
@fog_oy = 0
@fog_tone = Tone.new(0, 0, 0, 0)
@fog_tone_target = Tone.new(0, 0, 0, 0)
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 60
end
end
|