02-05-2007, 01:00 PM
ISB (Improved Sprites Battlers)
By Samo, the thief
V 1.0
Feb 5 2007
This doesn't add any feauture to battle system, this puts the battlers actors
in positions to make it look like a side-view-battle-system, but it doesn't have
those engines. You may use this together with another battle system.
The actors will be like in FF1,2,3,4,5 and many more, but they will be battlers.
also, you need battlebacks of 640x480, like the oldies of RM2k, or RM2K3.
CODE:
-----
here it is:
Enjoy the script and give me the credit. Replies please! What do you think of this?
Samo, the thief.
By Samo, the thief
V 1.0
Feb 5 2007
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
This doesn't add any feauture to battle system, this puts the battlers actors
in positions to make it look like a side-view-battle-system, but it doesn't have
those engines. You may use this together with another battle system.
The actors will be like in FF1,2,3,4,5 and many more, but they will be battlers.
also, you need battlebacks of 640x480, like the oldies of RM2k, or RM2K3.
CODE:
-----
here it is:
CODE
Code:
#==============================================================================
#
# ISB (Improved Sprites Battlers) v1.0 by Samo, the thief.
#
#
# -Just place this script above main, all the work will be done. But it is better
# if you read customizing part.
#
#
# What the heck this script does? Simple! First, you must have battle backgrounds
# of 640x480(like the RPGM2k, or 2k3, the oldies!). The script will make status_battle
# window transparent, command window will be put in another coordinates and battlers
# of actors will be drawed like this:
# SCREEN
#--------------------#
#- -#
#- A1 E -#
#- A2 E -#
#- A3 E -#
#- A4 E -#
#- -#
#--------------------#
#
#
# A is the actor and E is the enemy
# A will be drawn in the screen depending on hisc class position (Like Advanced Guard
#, behind, middle).
#
#
#
# CUSTOMIZING:
# ------------
#
# - You could do battler of Actors looking at right, and enemies looking at left
# - You could draw a shadow by yourself in the battlers to improve it.
# - Don't Forget about putting enemies on positions not above from actors.
# - If you want to change the positions of the actors, search the lines with the comment
#EDITABLE. and read the instructions there
#<><><><><>>><>>>>>>>>>>>>><<<<<<<<<<<<<<<>>>>>>>>>>>>><<<<<<<<<<<<<<<>>>>>>>><<<
#GIve me the credit if you use it. Enjoy!
# Samo, the thief.
#==============================================================================
#------------------------------------------------------------------------------
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# In this class, the battlers and his coordinates are modified.
# Only the #EDITABLE may be changed.
# Ok, let's proceed.
#
#--------------------------------------------------------------------------
def update
super
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
if @battler.is_a?(Game_Actor) and @battler_visible
if $game_temp.battle_main_phase
self.opacity += 0 if self.opacity < 255
else
self.opacity -= 0 if self.opacity > 255
end
end
if @battler.blink
blink_on
else
blink_off
end
unless @battler_visible
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
end
if @battler_visible
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
if @battler.white_flash
whiten
@battler.white_flash = false
end
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
else
$game_system.se_play($data_system.actor_collapse_se)
end
collapse
@battler_visible = false
end
end
# >>>>EDITABLE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if @battler != nil and @battler == $game_party.actors[0] or @battler == $game_party.actors[1] or @battler == $game_party.actors[2] or @battler == $game_party.actors[3]
case $data_classes[@battler.class_id].position
when 0
self.x = 255 # when pos is advanced, x
when 1
self.x = 145# when pos is middle, x
when 2
self.x = 60# when pos is behind, x
end# This x may be changed if you want
else
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
if @battler == $game_party.actors[0]
self.y = 240 #ACTOR 1 Y
elsif @battler == $game_party.actors[1]
self.y = 300#ACTOR 1 Y
elsif @battler == $game_party.actors[2]
self.y = 360#ACTOR 1 Y
elsif @battler == $game_party.actors[3]
self.y = 420#ACTOR 1 Y
end#This y may be changed if you want
end
#<<<<<<<<<<<EDITABLE.
end
#------------------------------
#Here we finish this class, now we sall go to...
#
#
#------------------------------
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#----------------------------
#This window. Modifying the opacity, a litle change
#
#-----------------------------
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
end
#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
#
#--------------------------------------------------
#Why this class now? Because the battlers have more z than self, but we will change
#it to....
#
#---------------------------------------------------
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures)
@exp = exp
@gold = gold
@treasures = treasures
super(160, 0, 320, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.y = 160 - height / 2
self.back_opacity = 160
self.z = 10000 #10000, big uh?
self.visible = false
refresh
end
#--------------------------------------------------------------------------
end
#-----------------------------------------------------------
#Now a important mod...
#Changing backgroung at 640 x 480.
#
#-----------------------------------------------------------
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
class Spriteset_Battle
def initialize
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Sprite.new(@viewport1)
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
#--------------------------------------------------------------------------
def update
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 480)
end
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport4.color = $game_screen.flash_color
@viewport1.update
@viewport2.update
@viewport4.update
end
end
class Scene_Battle
#--------------------------------------------------------------------------
def main
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
$game_system.battle_interpreter.setup(nil, 0)
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 0
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
@spriteset = Spriteset_Battle.new
@wait_count = 0
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
start_phase1
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
Graphics.freeze
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
@spriteset.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
def phase3_setup_command_window
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window.x = 480
@actor_command_window.index = 0
end
end
# Here we finish, as you can see, only some mods are added. To make better this script should be
# done by you and your graphic program (like photoshop, corel draw, etc.)
Code:
INSTRUCTIONS:
-------------
-Just place this script above main, all the work will be done. But it is better
if you read customizing part.
What the heck this script does? Simple! First, you must have battle backgrounds
of 640x480(like the RPGM2k, or 2k3, the oldies!). The script will make status_battle
window transparent, command window will be put in another coordinates and battlers
of actors will be drawed like this:
SCREEN
--------------------
- -
- A1 E -
- A2 E -
- A3 E -
- A4 E -
- -
--------------------
A is the actor and E is the enemy
A will be drawn in the screen depending on hisc class position (Like Advanced Guard
, behind, middle).
CUSTOMIZING:
------------
- You could do battler of Actors looking at right, and enemies looking at left
- You could draw a shadow by yourself in the battlers to improve it.
- Don't Forget about putting enemies on positions not above from actors.
- If you want to change the positions of the actors, search the lines with the comment
EDITABLE. and read the instructions there
Enjoy the script and give me the credit. Replies please! What do you think of this?
Samo, the thief.