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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
| #==============================================================================
# ** Actor Battler Graphics
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 03-01-2008
# RGSS2
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This system permits you to include 'Actor Battler' graphics that were not
# included in the RPGMaker VX system. This script mimics many of the lost
# features, and includes a new one: Actor Battler Centering.
#
#------------------------------------------------------------------------------
#
# USAGE:
#
# --Positioning--
# A nice feature to this system is the ability to adjust the left/right &
# up/down position of your battlers.
#
# Actually, the vertical up/down position can be adjusted by changing the
# value of the SCREEN_Y variable. The left/right positioning is a little
# different.
#
# The CENTER_X value is a true/false value that sets whether the battlers
# line up from the left and space themselves out in the manner of the de-
# fault RPGMaker XP or whether the system calculates and centers them ac-
# ross the screen.
#
# The DEFAULT_X value establishes how many actors are typically shown in
# the battlefield. While this is the default value, the maximum value used
# can be changed with a script call.
#
# Finally, the TRANSPARENT value is another true/false value that you can
# use to make the battlers lightly transparent until they're about to per-
# form an attack. Another feature from RPGMaker XP.
#
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
# --The Actor List--
# This system DOES require you to edit the configuration system to list all
# of the 'actor' battlers that you are using. It is assumed that these
# battlers will be in the 'Graphics\Battlers' folder with the rest of the
# enemy battlers.
#
# Each value in the ACTOR array holds two values: filename and hue. This
# not only allows you to add battle graphics for your heroes, but adjusts
# the character's hue as well. If you do not include the hue setting, it
# goes to the default setting of '0'.
#
#------------------------------------------------------------------------------
#
# SCRIPT CALLS:
#
# There's only two script calls that you need to know.
#
# --Changing Battlers--
# Given that this system allows you to use 'Actor' battlers, you may find a
# need to 'change' the battler in-game. Unfortunately, this cannot be done
# with a pre-rendered map event, so I had to make a script call:
#
# $game_actors[ID].set_battler("filename", hue)
#
# By using this call, you can change the graphic and hue of a battler while
# the game is running.
#
# As an example: $game_actors[1].set_battler("Ylva")
#
# ...would set actor #1's battler to use "Ylva.png" as the graphic desired.
# You may note that the 'hue' was not included in this call. The default
# value of '0' was used.
#
# NOTE: Just calling $game_actors[2].set_battler() would erase the battler
# from actor #2, rendering it invisible on the battlefield.
#
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
# --Changing Position Value--
# This script allows you to have the battlers centered in the battlefield
# and spaced out evenly. Under most circumstances, you have four members
# in your party. But what if you want to increase the number of members
# to 5 or 6?
#
# Now, this system does not increase the number of members in your party,
# but it is already set up to adjust the spacing of your members in the
# battlefield. With a simple script call:
#
# $game_system.actorbattler_max = 7
#
# You can make the system space the battlers on the field with the under-
# standing that up to 7 members are in the party.
#
#------------------------------------------------------------------------------
#
# EDITS AND MODIFICATIONS:
#
# This system Aliases the following methods:
# * initialize (RPG::Actor)
# * initialize (Game_Temp)
# * initialize (Game_System)
# * initialize (Game_Actor)
# * update (Sprite_Battler)
# * start (Scene_Battle)
# * start_party_command_selection (Scene_Battle)
# * process_victory (Scene_Battle)
# * execute_action (Scene_Battle)
#
# This system redefines the following methods:
# * use_sprite? (Game_Actor)
# * create_actors (Spriteset_Battle)
# * update_actors (Spriteset_Battle)
#
#
#------------------------------------------------------------------------------
#
# TERMS AND CONDITIONS:
#
# Free to use, even in commercial projects. Just note that I need some form
# of due credit... even a mere mention in some end titles.
#
#==============================================================================
# ** Actor_Battler Module
#------------------------------------------------------------------------------
# A module containing configurable data for the Actor Battler Graphic system.
#==============================================================================
module Actor_Battler
# Actor battler array
ACTOR = Array.new # Do not touch -_^
#========================================================================
# ** C O N F I G U R A T I O N S Y S T E M ** #
#========================================================================
# --Positioning--
# Actor Battler positioning system
#
CENTER_X = true # If true, centers actors rather than default lineup.
DEFAULT_X = 5 # Default party Max
SCREEN_Y = 400 # Vertical height of battlers
TRANSPARENT = true # If true, makes lightly transparent until attacking.
# --Actor List--
# Add your actor battlers here
#
# Actor# Filename, Hue (optional)
ACTOR[1] = ["Kurea"]
ACTOR[2] = ["Safi"]
ACTOR[3] = ["Rain", 0]
ACTOR[4] = ["Ylva", 0]
ACTOR[5] = ["Lawrence", 0]
ACTOR[6] = ["Oscar", 0]
ACTOR[7] = ["Vera", 0]
ACTOR[8] = ["Elmer", 0]
#========================================================================
# ** E N D O F C O N F I G U R A T I O N ** #
#========================================================================
end
#==============================================================================
# ** RPG Module
#------------------------------------------------------------------------------
# A module containing RPGVX Data Structures.
#==============================================================================
module RPG
#============================================================================
# ** Actor
#----------------------------------------------------------------------------
# Data class for actors
#============================================================================
class Actor
#------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------
alias actorbattler_init initialize
#------------------------------------------------------------------------
# * Object Initialization
#------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_init
@battler_name = ""
@battler_hue = 0
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_main_phase # battle flag: main phase
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_initialize
# Set the main phase flag to false
@battle_main_phase = false
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actorbattler_max # Max. size for centered battlers
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_initialize
# Set 'Centered' battler max to 4 (default)
@actorbattler_max = Actor_Battler:[img]smileys/grincant.gif[/img]EFAULT_X
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor [img]smileys/louche.gif[/img]creen_x # battle screen X coordinate
attr_accessor [img]smileys/louche.gif[/img]creen_y # battle screen Y coordinate
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
# actor_id : actor ID
#--------------------------------------------------------------------------
def initialize(actor_id)
# Perform the original call
actorbattler_init(actor_id)
# Apply battler graphic
@battler_name = Actor_Battler::ACTOR[actor_id][0]
# Apply battler hue if exists, else default of '0'
if Actor_Battler::ACTOR[actor_id][1] != nil
@battler_hue = Actor_Battler::ACTOR[actor_id][1]
else
@battler_hue = 0
end
end
#--------------------------------------------------------------------------
# * Change Battler
# battler_name : new battler graphic filename
# battler_hue : new battler hue setting (default = 0)
#--------------------------------------------------------------------------
def set_battler(battler_name = "", battler_hue = 0)
@battler_name = battler_name
@battler_hue = battler_hue
end
#--------------------------------------------------------------------------
# * Use Sprites?
#--------------------------------------------------------------------------
def use_sprite?
return true
end
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
if Actor_Battler::CENTER_X
# Return after calculating x-coords of centered party members
return self.index * (544 / $game_system.actorbattler_max) +
($game_system.actorbattler_max - $game_party.members.size) *
(272 / $game_system.actorbattler_max) +
(272 / $game_system.actorbattler_max)
else
# Return after calculating x-coords of default-aligned party members
return self.index * 136 + 68
end
else
return 0
end
end
#--------------------------------------------------------------------------
# * Get Battle Screen Y-Coordinate
#--------------------------------------------------------------------------
def screen_y
return Actor_Battler::SCREEN_Y
end
#--------------------------------------------------------------------------
# * Get Battle Screen Z-Coordinate
#--------------------------------------------------------------------------
def screen_z
# Return after calculating z-coordinate by order of members in party
if self.index != nil
return $game_party.members.size - self.index
else
return 0
end
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Perform the original call
actorbattler_update
# If the actor battlers are lightly transparent until they act
if Actor_Battler::TRANSPARENT == true
# If the battler is a visible actor battler
if @battler.is_a?(Game_Actor) and @battler_visible
# Bring opacity level down a bit when not in main phase
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
end
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within the
# Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Create Actor Sprite
# Removes the 'empty' battler image used by the default system and
# replaces it. It also observes the actual size of the party and
# not a predetermined 4-party limit.
#--------------------------------------------------------------------------
def create_actors
@actor_sprites = []
for actor in $game_party.members.reverse
@actor_sprites.push(Sprite_Battler.new(@viewport2, actor))
end
end
#--------------------------------------------------------------------------
# * Update Actor Sprite
#--------------------------------------------------------------------------
def update_actors
# Reset actor battler sprites if party size increases
if $game_party.members.size > @actor_sprites.size
dispose_actors
create_actors
end
for sprite in @actor_sprites
sprite.update
end
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_s start
alias actorbattler_spcs start_party_command_selection
alias actorbattler_pv process_victory
alias actorbattler_ea execute_action
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
actorbattler_s
$game_temp.battle_main_phase = false
end
#--------------------------------------------------------------------------
# * Start party command selection
#--------------------------------------------------------------------------
def start_party_command_selection
actorbattler_spcs
if $game_temp.in_battle
$game_temp.battle_main_phase = false
end
end
#--------------------------------------------------------------------------
# * Victory Processing
#--------------------------------------------------------------------------
def process_victory
$game_temp.battle_main_phase = false
actorbattler_pv
end
#--------------------------------------------------------------------------
# * Start Execution of Battle Processing
#--------------------------------------------------------------------------
def execute_action
actorbattler_ea
$game_temp.battle_main_phase = true
end
end |