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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
| #===============================================================================
# Integrity Checker
# By Jet10985 (Jet)
# Tested by: Kalez238
#===============================================================================
# This script will check commonly used event commands to ensure that the
# integrity of the used parameters are good. Basically it makes sure they are
# possible.
# This script has: 1 customization option.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Scene_Title: start, post_start, terminate, post_terminate, update
#===============================================================================
=begin
Checked event commands:
Show Picture
Add Actor
Change Item, Weapon, Armor
Transfer Player
Play BGM, BGS, SE, ME
Change Battle BGM, Battle End ME
The script will generate a text file in the game's folder with all the details
on failed event commands.
=end
module JetIntegChecker
# Set to false to run the game normally.
RUN_INTEG_CHECKER = true
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Integrity_Checker < Scene_Base
attr_accessor :maps
def start
super
@file = File.new("IntegrityLog.txt", "w+")
create_map_event_hash
check_picture_integ
check_transfer_integ
check_music_integ
check_item_integ
check_actor_integ
@file.close
p "Integrity Check Finished."
exit
end
def create_map_event_hash
@maps = {}
temp = Dir.entries("Data")
temp[0] = nil
temp[1] = nil
for item in temp
next if item.nil?
temp[temp.index(item)] = nil if item[/MAP(\d)/i].nil?
end
temp[temp.size-1] = nil
temp.compact!
i = 1
for item in temp
f = load_data("Data/#{item}")
e = f.events
@maps[i] = e
i += 1
end
end
def check_picture_integ
@file.puts "------[PICTURE INTEGRITY]------"
for event in load_data("Data/CommonEvents.rvdata").compact!
for command in event.list
if command.code == 231
begin
Cache.picture(command.parameters[1])
rescue
@file.puts "Common Event #{event.id}: Picture '#{command.parameters[1]}' does not exist."
end
end
end
end
for map in @maps.keys
for event in @maps[map].values
for page in event.pages
for command in page.list
if command.code == 231
begin
Cache.picture(command.parameters[1])
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Picture '#{command.parameters[1]}' does not exist."
end
end
end
end
end
end
end
def check_transfer_integ
@file.puts "\r\n------[TRANSFER INTEGRITY]------"
for event in load_data("Data/CommonEvents.rvdata").compact!
for command in event.list
if command.code == 201
begin
load_data(sprintf("Data/Map%03d.rvdata", command.parameters[1]))
rescue
@file.puts "Common Event #{event.id}: Transfer to map ID: #{command.parameters[1]} failed."
end
end
end
end
for map in @maps.keys
for event in @maps[map].values
for page in event.pages
for command in page.list
if command.code == 201
begin
load_data(sprintf("Data/Map%03d.rvdata", command.parameters[1]))
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Transfer to map ID: #{command.parameters[1]} failed."
end
end
end
end
end
end
end
def check_music_integ
@file.puts "\r\n------[MUSIC INTEGRITY]------"
for event in load_data("Data/CommonEvents.rvdata").compact!
for command in event.list
case command.code
when 132
begin
RPG::BGM.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: BGM '#{command.parameters[0].name}' does not exist."
end
when 133
begin
RPG::ME.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: ME '#{command.parameters[0].name}' does not exist."
end
when 241
begin
RPG::BGM.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: BGM '#{command.parameters[0].name}' does not exist."
end
when 245
begin
RPG::BGS.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: BGS '#{command.parameters[0].name}' does not exist."
end
when 249
begin
RPG::ME.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: ME '#{command.parameters[0].name}' does not exist."
end
when 250
begin
RPG::SE.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "Common Event #{event.id}: SE '#{command.parameters[0].name}' does not exist."
end
end
end
end
for map in @maps.keys
for event in @maps[map].values
for page in event.pages
for command in page.list
case command.code
when 132
begin
RPG::BGM.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) BGM '#{command.parameters[0].name}' does not exist."
end
when 133
begin
RPG::ME.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) ME '#{command.parameters[0].name}' does not exist."
end
when 241
begin
RPG::BGM.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) BGM '#{command.parameters[0].name}' does not exist."
end
when 245
begin
RPG::BGS.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) BGS '#{command.parameters[0].name}' does not exist."
end
when 249
begin
RPG::ME.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) ME '#{command.parameters[0].name}' does not exist."
end
when 250
begin
RPG::SE.new(command.parameters[0].name, 0, 0).play
rescue
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) SE '#{command.parameters[0].name}' does not exist."
end
end
end
end
end
end
end
def check_actor_integ
@file.puts "\r\n------[ACTOR INTEGRITY]------"
for event in load_data("Data/CommonEvents.rvdata").compact!
for command in event.list
case command.code
when 129
if load_data("Data/Actors.rvdata")[command.parameters[0]].nil?
@file.puts "Common Event #{event.id}: Actor ID #{command.parameters[0]} does not exist."
end
end
end
end
for map in @maps.keys
for event in @maps[map].values
for page in event.pages
for command in page.list
case command.code
when 129
if load_data("Data/Actors.rvdata")[command.parameters[0]].nil?
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Actor ID #{command.parameters[0]} does not exist."
end
end
end
end
end
end
end
def check_item_integ
@file.puts "\r\n------[ITEM INTEGRITY]------"
for event in load_data("Data/CommonEvents.rvdata").compact!
for command in event.list
case command.code
when 126
if load_data("Data/Items.rvdata")[command.parameters[0]].nil?
@file.puts "Common Event #{event.id}: Item ID #{command.parameters[0]} does not exist."
end
when 127
if load_data("Data/Weapons.rvdata")[command.parameters[0]].nil?
@file.puts "Common Event #{event.id}: Weapon ID #{command.parameters[0]} does not exist."
end
when 128
if load_data("Data/Armors.rvdata")[command.parameters[0]].nil?
@file.puts "Common Event #{event.id}: Armor ID #{command.parameters[0]} does not exist."
end
end
end
end
for map in @maps.keys
for event in @maps[map].values
for page in event.pages
for command in page.list
case command.code
when 126
if load_data("Data/Items.rvdata")[command.parameters[0]].nil?
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Item ID #{command.parameters[0]} does not exist."
end
when 127
if load_data("Data/Weapons.rvdata")[command.parameters[0]].nil?
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Weapon ID #{command.parameters[0]} does not exist."
end
when 128
if load_data("Data/Armors.rvdata")[command.parameters[0]].nil?
@file.puts "MAP ID #{map}: #{event.name} (ID: #{event.id.to_s}) Armor ID #{command.parameters[0]} does not exist."
end
end
end
end
end
end
end
end
class Scene_Title
alias jet5921_update update unless $@
def update
jet5921_update unless JetIntegChecker::RUN_INTEG_CHECKER
end
alias jet5921_terminate terminate unless $@
def terminate
jet5921_terminate unless JetIntegChecker::RUN_INTEG_CHECKER
end
alias jet5822_start start unless $@
def start
if JetIntegChecker::RUN_INTEG_CHECKER
$scene = Integrity_Checker.new
else
jet5822_start
end
end
alias jet5821_post_start post_start unless $@
def post_start
jet5821_post_start unless JetIntegChecker::RUN_INTEG_CHECKER
end
alias jet5821_pre_terminate pre_terminate unless $@
def pre_terminate
jet5821_pre_terminate unless JetIntegChecker::RUN_INTEG_CHECKER
end
end |