Hi, Im a RPG XP User and I use the ATOA ACBS (Sideview battlesystem) by Victor Sants aka Atoa.
I've a huge problem.
In the script "ACBS | Config 2 - Advanced" which is part of the battle scripts you can adjust the settings of battlers, like how fast a pose should be, if a pose should be inverted or not.
Okay. so far so good.
The name of my battler is soldier3.
Here are his Settings. Im gonna explain them all.
Pose_Sprite['%Soldier3'] = {'Base' =>[1,1,200,false], 'Adjust' => [0,211],
1 =>[1,5,true], 2 =>[1,4,true], 3 =>[1,4,true], 4 =>[1,4,true], 5 =>[1,4,true],
6 =>[1,4,true], 7 =>[1,2,false], 8 =>[1,4,false], 9 =>[1,4,true], 10 =>[1,4,true],
11 =>[1,4,true], 12 =>[1,4,true], 'Center' => {'Base' =>[0, 50]}}
Pose_Sprite['%Soldier3'] menas its meant for the battler wit hthe name soldier 3.
{'Base' =>[1,1,200,false], = the first number is the maximum number of of horizontal frames and the next one is the maximum number of vertical frames.
200 is the movement speed. false means that the battler will be not inverted.
Adjust is important, it adjusts for battler sprite.
The rest of them are the poses used. For example 1 =>[1,5,true] is the idle pose. it has 1 frames and runs on 5 speed. True means loop. etc.
HERES MY PROBLEM: My problem is the center line. Center sets the sprite "center", used to set the target point
for battle animations and throws. its helpful for example if the sprite is not really in the middle or is an flying enemy or if the battler is a big sprite. I tried to use the line so that animations from enemies hit exactly where my sprite is and not bewlow wich they currently do. because my sprite is big and it needs to be big.
But whenever someone attacks me I get a errorline on Script battle line 418 undefined local variable or method'_ name for sprite_battler.
I dont know what I did wrong.
Heres the demo and the script part.
From ACBS | Sprite Battler
Line 400 - 423
http://workupload.com/file/DGNbnJ7 DOWNLOAD DEMO
#--------------------------------------------------------------------------
# * Get sprite X center
#--------------------------------------------------------------------------
def center_x
name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name
if Pose_Sprite[name] != nil and Pose_Sprite[name]['Center'] != nil
pose = Pose_Sprite[name]['Center'].dup
return pose[@battler.pose_id][0] if pose[@battler.pose_id] != nil
return pose['Base'][0] if pose['Base'] != nil
end
return @frame_width / 2
end
#--------------------------------------------------------------------------
# * Get sprite Y center
#--------------------------------------------------------------------------
def center_y
name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name
if Pose_Sprite[name] != nil and Pose_Sprite[name]['Center'] != nil
pose = Pose_Sprite[_name]['Center'].dup
return pose[@battler.pose_id][1] if pose[@battler.pose_id] != nil
return pose['Base'][1] if pose['Base'] != nil
end
return @frame_height / 2
end
In the code you posted at the end, specifically this line:
pose = Pose_Sprite[_name]['Center'].dup
Did you try removing the underscore next to
name?
EDIT: So I downloaded your demo along with someone who was hosting the script's demo. Both are exactly the same version. I compared the text in
ACBS | Sprite Battler and the only difference was that _name bit on that one line.
I don't know what could have caused you to add that there by mistake.
Actually it wasnt me who did this but rather victor sants - the creator.
When I was about to post this, I wanted to erase the "_" but forget it to test it before I could upload it. I put it in the folder however.
But it worked.
But my problem is not over yet. Now the real problem is starting to begin. LOL.
Its hard for me to put it into words because my native tongue isnt english so im trying step for step if its okay.
If you look at my battler in the picture 1 (all pictures are at the buttom)- you will notice that he is in the very middle of the picture. Normally they are on the middle at the bototm. I need to do this because I will implement skills and actions for battlers that needs space. This is why hes in the middle. If I do this, in battle he will appear wrongly above the battlefield. Look at Picture two. Btw. dont mind the pink and yellow edges, they are only help for me.
Okay, so in order to counter that and in order to get my character below in the battlefield Victor sants created a Adjust command. With that you can adjust battlers who are not well aligned like my.
Heres an example how the code looks:
Pose_Sprite['%Soldier3'] = {'Base' =>[1,1,200,false], 'Adjust' => [0,220],
1 =>[1,5,true], 2 =>[1,4,true], 3 =>[1,4,true], 4 =>[1,4,true], 5 =>[1,4,true],
6 =>[1,4,true], 7 =>[1,2,false], 8 =>[1,4,false], 9 =>[1,4,true], 10 =>[1,4,true],
11 =>[1,4,true], 12 =>[1,4,true]}
What does the adjust do? here? 0 is the X position adjust, 231 is the Y position adjust. It means that it will skip 220 x positions to get the battler right.
In Picture 3 you can see that it worked and I get my battler right. Dont mind the shadow under my battler. I was just too lazy to delete it. Look at picture 3 please.
Okay, now that the battler is displayed correctly, you will ask me where my problem is, isnt it? Here is where it starts. The funny thing is, as I corrected the display of the battler with the help of the adjust term, the animations and casting animations are postponed - they are displayed wrong. I dont know if the adjust command should do this or if its a bug. So the adjust command displays the positions for animations skill on the user like cure or casting wrong etc. I dont know why the command is doing it or if its a bug. ALSO: What I also consider a bug or simply wrong is, that the dmg sprite is too much apart from the animation when adjust is used.
So my first question: Can anyone check if adjust should do this or if its a bug? Can anyone check in the script (I think its ACBS | RPG::Sprite) why the animation is displaced alongside the sprite? For all of that see picture 5.
In the script I found another command or term that is helpful in situations like where I am.
It is the center command.
'Center' = Value that sets the sprite "center", used to set the target point for battle animations and throws. By default, the center is based on the frame dimensions, but don't take into consideration the position of the sprite inside the frame If the sprite is on an uncommon position compared to the center (like an flying enemy that stays above the center).
Heres what I did:
Pose_Sprite['%Soldier3'] = {'Base' =>[1,1,200,false], 'Adjust' => [0,220],
1 =>[1,5,true], 2 =>[1,4,true], 3 =>[1,4,true], 4 =>[1,4,true], 5 =>[1,4,true],
6 =>[1,4,true], 7 =>[1,2,false], 8 =>[1,4,false], 9 =>[1,4,true], 10 =>[1,4,true],
11 =>[1,4,true], 12 =>[1,4,true], 'Center' => {'Base' =>[530, 300]}}
I took the center command for 530 X positions and Y Positions. The problem is, that im Sure that the center command is bugged or it conflicts with the adjust command or something like this. BECAUSE: As I change the X positions of the center command, the animation goes right or left in the way I want it. But changing the Y positions wont do anything. I tried using 300, 50, 1, 0. Its always in the same position which it should not. Im 100% that the code is bugged. I dont know what exactly is wrong. Second question: can anyone look at the script and look whats wrong about the term center? Why is the animation not moving along the Y positions despite the fact that I change it?
The main scripts for my problem are found in
ACBS | RPG::Sprite
ACBS | Config 2 - Advanced
ACBS | Sprite Damage
Heres a link to a new demo with the current settings:
https://workupload.com/file/7sSeSdn
PICTURE ONE:
(http://img5.fotos-hochladen.net/uploads/picture14qdma7ce5l.png) (http://www.fotos-hochladen.net)
PICTURE TWO
(http://img5.fotos-hochladen.net/uploads/picture2tju5fsny7o.png) (http://www.fotos-hochladen.net)
PICTURE THREE
(http://img5.fotos-hochladen.net/uploads/picture3hpzkcf5x0v.png) (http://www.fotos-hochladen.net)
PICTURE FOUR
(http://img5.fotos-hochladen.net/uploads/picture4smgcf6o7hz.png) (http://www.fotos-hochladen.net)
PICTURE FIVE
(http://img5.fotos-hochladen.net/uploads/picture504y9aox6ri.png) (http://www.fotos-hochladen.net)
QuoteActually it wasnt me who did this but rather victor sants - the creator.
What I meant was that the script demo I downloaded from another website was the EXACT SAME version as your demo. The underscore was not there in my download. If you're saying that you didn't add that underscore there by accident, wherever you downloaded the script from is clearly a faulty download.
As for your questions, which are exactly the same by the way, it's because you need to change the animation position. Looking at ACBS | RPG::Sprite, center_y only takes effect if the animation position is 1 (Middle):
if $game_temp.in_battle
sprite.x = self.x - self.ox + self.center_x
sprite.y = self.y - self.oy if position == 0
sprite.y = self.y - self.oy + self.center_y if position == 1 #<==================
sprite.y = self.y - self.oy + self.frame_height if position == 2
else
So go in your animation database. To the left of the 'Frames' drop-down is the 'Position' drop-down. Choose 'Middle' and your problem is solved.
QuoteIf you look at my battler in the picture 1 (all pictures are at the buttom)- you will notice that he is in the very middle of the picture. Normally they are on the middle at the bototm. I need to do this because I will implement skills and actions for battlers that needs space.
I don't understand what you're trying to do here. What space do you need? Your battler graphic shouldn't be 1050x600 in size.
Thanks for your help so far.
I downloaded the Demo from RPG XP.ORG if I remember correctly. Can you tell me where I can get a clear version if mine was corrupted or is outdated?
Okay the animation problem is, lets say: solved to the half, but I really dont understand why the problem only happens if adjust and center term is used. So IT is a bug then. If I dont use them everything seems okay. Even if I use animation who are not below and and when I dont use both terms - everything is cool. I really dont understand why it only happens when using center and adjust. It works when I dont use buttom for animation. And what if I want to use buttom?
The battler was just a template. My battlers are normally greater. I need space because I make the animations of certain attacks thru battlers and not thru animations except for skills like thunder etc.
Another problem is still there. The dmg sprite is a bit apart from the animation. And even if I move the center - damage sprite is always on a certan point which it should not. Normally the damage is on the same point where the animation appears if I remember correctly. However after using center and adjust the animation is a bit apart. Any ideas?
I'm not sure what you're trying to say, possibly because the English is pretty broken. So I'll just quote and break it down:
QuoteI downloaded the Demo from RPG XP.ORG if I remember correctly. Can you tell me where I can get a clear version if mine was corrupted or is outdated?
Could you provide the link? The one I tried was http://cavernofcreativity.com/Atlas/Thread-RGSS-ACBS-Atoa-Custom-Battle-System
QuoteI really dont understand why the problem only happens if adjust and center term is used...If I dont use them everything seems okay. Even if I use animation who are not below and and when I dont use both terms - everything is cool
Can you show me an example of this? I don't really see how it "works" in your demo.
QuoteI really dont understand why it only happens when using center and adjust. It works when I dont use buttom for animation. And what if I want to use buttom?
I already explained to you in the previous post why it doesn't work for 'Bottom' position animations. 'Top' and 'Bottom' animations play at the very top/bottom of the sprite graphic. Because the bottom of your Soldier graphic is where the yellow boxes are, the animations play there. There is no setting in the script to adjust the positions of 'Top' and 'Bottom' animations. If you want to make 'Bottom' animations actually play at the bottom of your sprite, don't make them pointlessly large.
QuoteThe battler was just a template. My battlers are normally greater.
If each frame of animation for the battler is going to be 1050x600 pixels large, you're doing things wrong. For starters, the game window is only 640x480 in size--that's a lot of added file size to your project and wasted RAM for your players.
QuoteThe dmg sprite is a bit apart from the animation.
In ACBS | RPG::Sprite, there's this line:
@_damage_sprites[i].y = self.y + Dmg_Y_Adjust - self.oy / 3
The only adjustment in the script is the configuration option Dmg_Y_Adjust (ACBS | Config 1 - Basic, near the bottom) but that's applied globally.
I think you should work on your graphic first before you start messing with the adjustments. The large, single-frame sprite is confusing you as to how things actually work.
My problem is this: First:
The adjust or center settings are not calculated withhin animation that are buttom or top animation. I want that to be fixed or added. T_T. I consider this a bug
By tests which I have done, only the adjust/center settings for middle animations is calculated. I want that to be fixed. Thats my first problem.
Because when I use a middle skill (And I tested the exact location of the skill) the location of where the skill is exactly at the same points. On both battlers. One who battler is a normal one without any adjust or center command. the other battler does have adjustment and center is a large battler. look at picture two and three.
EDIT: If the adjust or center settings are not calculated can't you add that it will be calculated?
I tried this here: sprite.y = self.y - self.oy + self.frame_height - self.center_y if position == 2
But if I do that the animation is okay for battlers with the center command, but it doesnt work for battlers without the center command. Any ideas?
Second Problem:
The damage sprite is miles away from my hero character and from the animation. please look at picture one
Please note that both sprites only look the same. The enemy sprite is however different. My hero sprite is usign adjust and center. He doesnt.
Im sorry, it was my fault to use the exact same sprites for both battlers but they're both different.
Im not a beginner in terms of this script. Im using the battle system for months. But im a complete beginner in terms of scripting. I know exactly why Im using such large battlers. The problem is the script itself.
Picture ONE:
(http://img5.fotos-hochladen.net/uploads/picture97gzrulfhqb.png) (http://www.fotos-hochladen.net)
Picture two:
My enemy sprite. His battler is not adjusted.
(http://img5.fotos-hochladen.net/uploads/soldier6koc9msag8z3k.png) (http://www.fotos-hochladen.net)
Picture three:
My hero sprite
(http://img5.fotos-hochladen.net/uploads/soldier3kop247wsqn6dy.png) (http://www.fotos-hochladen.net)
Probably best to consider this a script request now. I'll see if I can add custom options to the configuration for the following:
- Adjust Damage sprite location
- Adjust Bottom/Top animation location
Okay, thank you really for helping me, you dont probably know in how much trouble I was...
As for the animation issue, I at least know where the problem is altough i cant fix it.
As for the animation issue. My suggestion would be too make two lines. One that applies for battlers with center and one without.
sprite.y = self.y - self.oy + self.frame_height if position == 2
the line above is the original line.
The line below could fix this I believe
sprite.y = self.y - self.oy + self.frame_height +- self.center_y if position == 2
But I really don know how to check if a battler has a center command or how to make two separate versions. Im not on expert, so Im not gonna rush on things.
But do you know where the source for the damage issue is? So I can also look for solution while you're working on it.
Btw. I checked the version of ATOAS Script in the demo you showed with mine - it is the same. It also had the _name issue.
Thanks, from the bottom of my heart for helping me.
QuoteBut do you know where the source for the damage issue is? So I can also look for solution while you're working on it.
Quote from: KK20 on October 08, 2016, 07:49:33 pm
In ACBS | RPG::Sprite, there's this line:
@_damage_sprites[i].y = self.y + Dmg_Y_Adjust - self.oy / 3
The only adjustment in the script is the configuration option Dmg_Y_Adjust (ACBS | Config 1 - Basic, near the bottom) but that's applied globally.
EDITHere's the solution. Place this under the <<Add-Ons>> :
class Sprite_Battler < RPG::Sprite
def damage_adjust
name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name
if Pose_Sprite[name] != nil and Pose_Sprite[name]['Damage'] != nil
pose = Pose_Sprite[name]['Damage']
return pose[@battler.pose_id] if pose[@battler.pose_id] != nil
return pose['Base'] if pose['Base'] != nil
end
super
end
def bottom_anim_adjust
name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name
if Pose_Sprite[name] != nil and Pose_Sprite[name]['Bottom'] != nil
pose = Pose_Sprite[name]['Bottom']
return pose[@battler.pose_id] if pose[@battler.pose_id] != nil
return pose['Base'] if pose['Base'] != nil
end
super
end
def top_anim_adjust
name = Pose_Sprite[set_battler_name].nil? ? @battler_name : set_battler_name
if Pose_Sprite[name] != nil and Pose_Sprite[name]['Top'] != nil
pose = Pose_Sprite[name]['Top']
return pose[@battler.pose_id] if pose[@battler.pose_id] != nil
return pose['Base'] if pose['Base'] != nil
end
super
end
end
class RPG::Sprite
def damage_adjust; return [0,0]; end
def bottom_anim_adjust; return 0; end
def top_anim_adjust; return 0; end
#--------------------------------------------------------------------------
# * Set Damage Pop
# value : Damage value
# critical : Critical flag
# sp_damage : SP Damage flag
#--------------------------------------------------------------------------
def damage(value, critical, sp_damage = nil)
dispose_damage(0...@_damage_durations.size)
@_damage_sprites = []
damage_string = value.numeric? ? value.abs.to_s : value.to_s
@battler.apply_damage(value, sp_damage)
for i in 0...damage_string.size
letter = damage_string[i..i]
if Damage_Sprite
if value.numeric? and value < 0
extension = Hp_Rec_String
extension = Sp_Rec_String if sp_damage
else
extension = Sp_Dmg_String if sp_damage
extension = Crt_Dmg_String if critical
extension = Mss_Txt_String if damage_string == Miss_Message
end
begin
bitmap = RPG::Cache.digits(letter + extension)
rescue
bitmap = RPG::Cache.digits(letter)
end
else
if value.numeric? and value < 0
@_damage_color = [Hp_Rec_Color[0],Hp_Rec_Color[1],Hp_Rec_Color[2]]
@_damage_color = [Sp_Rec_Color[0],Sp_Rec_Color[1],Sp_Rec_Color[2]] if sp_damage
else
@_damage_color = [Hp_Dmg_Color[0],Hp_Dmg_Color[1],Hp_Dmg_Color[2]]
@_damage_color = [Sp_Dmg_Color[0],Sp_Dmg_Color[1],Sp_Dmg_Color[2]] if sp_damage
@_damage_color = [Crt_Dmg_Color[0],Crt_Dmg_Color[1],Crt_Dmg_Color[2]] if critical
@_damage_color = [Mss_Txt_Color[0],Mss_Txt_Color[1],Mss_Txt_Color[2]] if damage_string == Miss_Message
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = Damage_Font
bitmap.font.size = Dmg_Font_Size
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1,160, 36, letter, 1)
bitmap.draw_text(+1, 12-1,160, 36, letter, 1)
bitmap.draw_text(-1, 12+1,160, 36, letter, 1)
bitmap.draw_text(+1, 12+1,160, 36, letter, 1)
bitmap.font.color.set(*@_damage_color)
bitmap.draw_text(0, 12,160, 36, letter, 1)
if critical and Critic_Text and i == 0
x_pop = (damage_string.size - 1) * (Dmg_Space / 2)
bitmap.font.size = ((Dmg_Font_Size * 2) / 3).to_i
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1 + x_pop, -1, 160, 20, Crt_Message, 1)
bitmap.draw_text(+1 + x_pop, -1, 160, 20, Crt_Message, 1)
bitmap.draw_text(-1 + x_pop, +1, 160, 20, Crt_Message, 1)
bitmap.draw_text(+1 + x_pop, +1, 160, 20, Crt_Message, 1)
color = [Crt_Txt_Color[0],Crt_Txt_Color[1],Crt_Txt_Color[2]] if critical
bitmap.font.color.set(*color) if critical
bitmap.draw_text(0 + x_pop, 0, 160, 20, Crt_Message, 1)
end
end
if critical and Critic_Flash and value.numeric?
$game_screen.start_flash(Color.new(255, 255, 255, 255),10)
end
dmg_delay = Multi_Pop ? i : 1
dmg_adjust = Damage_Sprite ? 32 : 96
@_damage_sprites[i] = ::Sprite.new(self.viewport)
@_damage_sprites[i].bitmap = bitmap
@_damage_sprites[i].ox = dmg_adjust
@_damage_sprites[i].oy = 20
@_damage_sprites[i].x = self.x + 32 + Dmg_X_Adjust + i * Dmg_Space - (damage_string.size * 8) + damage_adjust[0]
@_damage_sprites[i].y = self.y + Dmg_Y_Adjust - self.oy / 3 + damage_adjust[1]
@_damage_sprites[i].z = Dmg_Duration + 3000 + dmg_delay * 2
@_damage_sprites[i].opacity = 0
end
end
#--------------------------------------------------------------------------
# * Set animation sprites
# sprites : animation sprite
# cell_data : cell info
# postion : animation position
# animation : animation info
# anim_pos : animation custom position
# anim_mirror : invert animation
#--------------------------------------------------------------------------
def animation_set_sprites(sprites, cell_data, position, animation, anim_pos = nil, anim_mirror = false)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if anim_pos != nil
sprite.x = anim_pos[0]
sprite.y = anim_pos[1]
elsif anim_pos.nil? and self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 320
else
sprite.x = 320
sprite.y = 240
end
else
if $game_temp.in_battle
sprite.x = self.x - self.ox + self.center_x
sprite.y = self.y - self.oy
case position
when 0
sprite.y += top_anim_adjust
when 1
sprite.y += self.center_y
when 2
sprite.y += self.frame_height + bottom_anim_adjust
end
else
sprite.x = self.x - self.ox + self.center_x
sprite.y = self.y - self.oy + self.center_y
sprite.y -= self.center_x / 2 if position == 0
sprite.y += self.center_y / 2 if position == 2
end
end
set_sprite_cell_data(sprite, cell_data, i, anim_mirror)
anim_setting = Animation_Setting[animation.id]
sprite.z = anim_setting.nil? ? 2000 : self.z + anim_setting[2]
sprite.x += (anim_setting.nil? ? 0 : anim_mirror ? -anim_setting[0] : anim_setting[0])
sprite.y += (anim_setting.nil? ? 0 : anim_setting[1])
sprite.ox = 96
sprite.oy = 96
end
end
end
And this is the configuration I used for your battler:
Pose_Sprite['%Soldier3'] = {'Base' =>[1,1,200,false], 'Adjust' => [0,220],
1 =>[1,5,true], 2 =>[1,4,true], 3 =>[1,4,true], 4 =>[1,4,true], 5 =>[1,4,true],
6 =>[1,4,true], 7 =>[1,2,false], 8 =>[1,4,false], 9 =>[1,4,true], 10 =>[1,4,true],
11 =>[1,4,true], 12 =>[1,4,true], 'Center' => {'Base' =>[530, 350]},
'Top' => {'Base' => 300}, # Positive values move the animation DOWN
'Bottom' => {'Base' => -250}, # Negative values move the animation UP
'Damage' => {'Base' => [0, -100]} # Move the damage text. Configured as [X,Y]. Negative value used to move text up.
}
The 'Center' configuration is not mandatory if using 'Top', 'Bottom', or 'Damage', but you're most likely going to need it for your reasons.
Thank you so much for helping me. I had time to test your edit. I really did some long compatible tests etc.
And you know what? it worked. It solved the top/down/damage issue.
However, theres one issue, thats remaining.
Im using some addons written by dervvulfman like chanting animations, recovery when defending. I also tested them.
1. Recovery when defending by vvulfman addon works with your edit. No issues with that.
2. ATOA Chanting Battle Animations also by vvulfman works perfectly. It basicially gives one the ability to set animations on users when casting skills.
3. Then there is the last addon that doesnt want to work. Its the ATOA Status Effect Pops script also by VVulfman. It basicially sets messages when statuses are applied like damage spries. For example when someone is poisoned, a message with the text "poison" will appear like a damage sprite. Problem is only, that the script isnt compatible with your edit. It doesnt factors your edit with the damage. If I adjust a damage in the configuration which I need to make, the damage appears far below the character and not in the right position.
btw. the script order is:
main battle scripts
Atoa HP/SP Defending Recovery
Your edit
ATOA Status Effect Pops
ATOA Chanting Battle Animations
As far as I know, its the best variant, i tested around a lot. With that order all scripts except for the status effect pop ups work.
Could you edit the ATOA Status Effect Pops script or your edit so that both are compatible with each other and so that the status effect pop up script will factor the adjust taken on damage?
Heres the script, its free of use:
Thanks,
koktengri.
#==============================================================================
# ** ATOA Status Effect Pops
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.1
# 1-10-2016 (mm/dd/yyyy)
# RGSS / RPGMaker XP
#
#==============================================================================
#
# INTRODUCTION:
#
# This script creates a new damage pop option for the ATOA ACBS system, now
# drawing status effect/ailment names along when a character is so effected
# while in battle.
#
# Like the original system, graphics for status damage pops are kept within
# the Graphics\Digits folder. Otherwise, it will draw damage pops using the
# more traditional draw_text method.
#
# NOTE: Mix match of graphically rendered and text drawn damage pops is not
# visually recommended. Both handle positioning differently.
#
# This script is an add-on for Atoa's ACBS.
#
#------------------------------------------------------------------------------
#
# INSTALLATION:
#
# Paste below Atoa's ACBS system.
#
# The configurations are explained below.
#
#------------------------------------------------------------------------------
#
# CONFIGURATION:
#
# These are going to be quickly explained. There's not a lot really TO
# explain about them.
#
# Basic values:
#
# * Dmg_State_Max
# This sets the maximum number of damage pops that will show at one time.
# I do not recommend going above 3 as it may appear crowded.
#
# * Dmg_State_X_Adjust
# Like the Atoa ACBS system, there is an extra X-Position adjustment value
# you can use. A setting of 0 should keep it horizontally aligned with all
# other damage pops of the same style.
#
# * Dmg_State_Y_Adjust
# This determines the vertical position of your damage pops, either above
# or below the ones normally generated. Negative values are above the
# default pops while positive will be positioned below.
#
# * Dmg_State_Height
# This sets how much vertical space is between each status damage pop.
#
# * Dmg_Default_Text
# This is used when a status damage pop is being generated and no custom
# status effect name (below) is defined. If this value is set to true, then
# it will use the default name in the database. If set to false, then it
# will not render the status damage pop.
#
# * Dmg_State_Skip
# This allows you to define what status ailments are not to be shown, even
# if the game is set to permit default status effect names (above). Just
# set the IDs of the states in the array.
#
#
# Extended values:
#
# * Dmg_State_Pops
# This is a hash array where you set the name for each status effect to
# show. If a graphic of the same name is in the Graphics\Digits folder,
# it will render that graphic as the damage pop. Otherwise, it will show
# this name using default text methods. If a state pop is being generated
# and no name is in this hash array, it will either show the default name
# stored in the database or just 'not' show the pop, depending upon the
# value set by the Dmg_Default_Text value (above).
#
# * Dmg_State_Color
# When a status damage pop is rendered, it is of a custom color. This
# array sets the default color in the [red, green, blue] format. It can
# be overwritten by individual color settings described below.
#
# * Dmg_State_Colors
# This is a hash array where you set the color for each status effect to
# show. If no color is defined for a given state, it will use the default
# color above.
#
# * Dmg_State_Dur
# When a status damage pop is rendered, it is to stay on the screen for
# a set period of time in frames. This is where you set the number of
# frames (default = 40).
#
# * Dmg_State_Durs
# This is a hash array where you allow some status effect pops to show
# longer or to vanish quicker than others. If no value is listed, it will
# use the default duration as set by the Dmg_State_Dur value above.
#
#
#==============================================================================
#
# TERMS AND CONDITIONS:
#
# Free for use, even in commercial games. And as this script was requested
# by Noctis, you have to give both of us credit for this script.
#
#==============================================================================
module Atoa
#----------------------------------------------------------------------------
Dmg_State_Pops = {} # Do Not Touch
Dmg_State_Colors = {} # Do Not Touch
Dmg_State_Durs = {} # Do Not Touch
#----------------------------------------------------------------------------
# State Pop Values
# ---------------------------------------------------------------------------
# Basis values to set that control the system.
#
Dmg_State_Max = 3 # Max # of State pops (Recommend no more than 3)
Dmg_State_X_Adjust = 0 # X position adjustment for State Pops
Dmg_State_Y_Adjust = -48 # Y position adjustment for State Pops
Dmg_State_Height = 22 # Vertical Space between State Pops
Dmg_Default_Text = true # If true and no damage pop defuned, use default
Dmg_State_Skip = [4,5] # Array of states NOT to show pops
# State Pop Names
# ---------------------------------------------------------------------------
# Renames the damage pops or acts as filenames for graphic pops to show.
# If a filename, assumes graphic is in the Graphics\Digits folder.
#
Dmg_State_Pops[2] = "Slammed" # Changes stunned state name to Slammed
Dmg_State_Pops[3] = "POISON" # Changes venom state name to Poisoned
# State Pop Colors
# ---------------------------------------------------------------------------
# Used only with damage pops drawn with the more traditional draw_text
# method, this sets the color of rendered text. Not used with graphic
# image pops.
#
Dmg_State_Color = [128,0,128] # Default color set to dark purple
# -------------------------------------------------------------------------
Dmg_State_Colors[2] = [255,0,0] # Red color for Slammed/Stun state
Dmg_State_Colors[3] = [0,255,0] # Green color for Poisoned/Venom state
Dmg_State_Colors[9] = [255,128,0] # Orange color for Weaken state
# State Pop Colors
# ---------------------------------------------------------------------------
# Used only with damage pops drawn with the more traditional draw_text
# method, this sets the color of rendered text. Not used with graphic
# image pops.
#
Dmg_State_Dur = 40 # Default state effect duration
# -------------------------------------------------------------------------
Dmg_State_Durs[2] = 60 # 2 second duration for stuns
Dmg_State_Durs[3] = 60 # 1 1/2 seconds for venom
end
#==============================================================================
# ** Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa StatePops'] = true
#==============================================================================
# ** RPG::Sprite
#------------------------------------------------------------------------------
# Class that manages Sprites exhibition
#==============================================================================
class RPG::Sprite < ::Sprite
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias status_pops_damage damage
#--------------------------------------------------------------------------
# * Set Damage Pop
# value : Damage value
# critical : Critical flag
# sp_damage : SP Damage flag
#--------------------------------------------------------------------------
def damage(value, critical, sp_damage = nil)
# Create temporary damage state array
temp_dmg_states = []
# Push new damage states into array
temp_dmg_states += @battler.state_to_add unless @battler.state_to_add == []
# Perform the original call
status_pops_damage(value, critical, sp_damage)
return if temp_dmg_states == []
# Take only up to the max number of states to show
temp_dmg_states = temp_dmg_states[0,Atoa::Dmg_State_Max]
# Reverse order if drawing above normal damage pop
temp_dmg_states.reverse if Dmg_State_Y_Adjust < 0
# Cycle through temporary damage state array
for i in 0..temp_dmg_states.size-1
# Get state ID from list
state_id = temp_dmg_states[i]
# Skip if the state is a no-show state (no pop)
next if Atoa::Dmg_State_Skip.include?(state_id)
# Get height position)
state_ht = (i * Atoa::Dmg_State_Height) + Dmg_State_Y_Adjust
# Determine if a valid graphic exists or if text
test_pop = false
begin
testbitmap = RPG::Cache.digits(Atoa::Dmg_State_Pops[state_id])
rescue
test_pop = true
end
# Branch if text pop or graphic
if test_pop == true
damage_state_pop_texts(i, state_id, state_ht)
else
damage_state_pop_graphics(i, state_id, state_ht)
end
end
end
#--------------------------------------------------------------------------
# * Set State Damage Pop from Graphic
# i : counter index of state in state pops applied
# state_id : actual status ailment ID in database
# state_ht : height position to be drawn in respect to pop
#--------------------------------------------------------------------------
def damage_state_pop_graphics(i, state_id, state_ht)
# Determine last sprite drawn among all damage pops
newpopsize = @_damage_sprites.size
# Get duration for individual state
state_dur = Atoa::Dmg_State_Dur
if Atoa::Dmg_State_Durs.has_key?(state_id)
state_dur = Atoa::Dmg_State_Durs[state_id]
end
# Grab the actual image from the folder
bitmap = RPG::Cache.digits(Atoa::Dmg_State_Pops[state_id])
# Set sprite number, delay and x/y position
j = newpopsize + i
dmg_delay = Multi_Pop ? i : 1
x = Dmg_State_X_Adjust
y = state_ht - self.oy / 3
# Draw the state damage sprite
damage_state_sprite_drawing(bitmap, state_dur, dmg_delay, j, x, y)
end
#--------------------------------------------------------------------------
# * Set State Damage Pop from Text
# i : counter index of state in state pops applied
# state_id : actual status ailment ID in database
# state_ht : height position to be drawn in respect to pop
#--------------------------------------------------------------------------
def damage_state_pop_texts(i, state_id, state_ht)
# Determine last sprite drawn among all damage pops
newpopsize = @_damage_sprites.size
# Get duration for individual state
state_dur = Atoa::Dmg_State_Dur
if Atoa::Dmg_State_Durs.has_key?(state_id)
state_dur = Atoa::Dmg_State_Durs[state_id]
end
# Get damage pop string from state ID
damage_string = Atoa::Dmg_State_Pops[state_id]
# Either use the default name or exit if no replacement string
if damage_string.nil?
if Atoa::Dmg_Default_Text == true
damage_string = $data_states[state_id].name
else
return
end
end
# Get the color for the status damage pop
state_color = Atoa::Dmg_State_Color
if Atoa::Dmg_State_Colors.has_key?(state_id)
state_color = Atoa::Dmg_State_Colors[state_id]
end
# Set the color
pop_damage_color = [state_color[0], state_color[1], state_color[2]]
# Cycle through individual letters in text
for k in 0...damage_string.size
# Obtain letter
letter = damage_string[k..k]
# Create new bitmap for letter and draw
bitmap = Bitmap.new(160, 48)
bitmap.font.name = Damage_Font
bitmap.font.size = Dmg_Font_Size
# Set black font outline and draw outline
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1,160, 36, letter, 1)
bitmap.draw_text(+1, 12-1,160, 36, letter, 1)
bitmap.draw_text(-1, 12+1,160, 36, letter, 1)
bitmap.draw_text(+1, 12+1,160, 36, letter, 1)
# Set pop color and draw text
bitmap.font.color.set(*pop_damage_color)
bitmap.draw_text(0, 12,160, 36, letter, 1)
# Set sprite number, delay and x/y position
j = newpopsize + k
dmg_delay = Multi_Pop ? i : 1
x = Dmg_State_X_Adjust + 32 + k * Dmg_Space - (damage_string.size * 8)
y = state_ht - self.oy / 3
# Draw the state damage sprite
damage_state_sprite_drawing(bitmap, state_dur, dmg_delay, j, x, y)
end
end
#--------------------------------------------------------------------------
# * Set State Damage Pop from Text
# bitmap : bitmap passed into drawn sprite
# state_dur : amount of delay adjusted for individual state
# delay : amount of delay adjusted for characters in pop
# count : counter for individual sprite drawn (increases for each)
# x : x-position of damage pop sprite being adjusted
# y : y-position of damage pop sprite being adjusted
#--------------------------------------------------------------------------
def damage_state_sprite_drawing(bitmap, state_dur, delay, count, x, y)
# Change X position if actor (0px) or enemy (left 45px)
x += (@battler.is_a?(Game_Actor)) ? 0 : -99
dmg_delay = Multi_Pop ? i : 1
dmg_adjust = Damage_Sprite ? 32 : 96
@_damage_sprites[count] = ::Sprite.new(self.viewport)
@_damage_sprites[count].bitmap = bitmap
@_damage_sprites[count].ox = dmg_adjust
@_damage_sprites[count].oy = 20
@_damage_sprites[count].x = self.x + Dmg_X_Adjust + x
@_damage_sprites[count].y = self.y + Dmg_Y_Adjust + y
@_damage_sprites[count].z = state_dur + 3000 + dmg_delay * 2
@_damage_sprites[count].opacity = 0
end
end
In the Status Effects script, near the end
@_damage_sprites[count].x = self.x + Dmg_X_Adjust + x
@_damage_sprites[count].y = self.y + Dmg_Y_Adjust + y
add these to the end of them
@_damage_sprites[count].x = self.x + Dmg_X_Adjust + x + damage_adjust[0]
@_damage_sprites[count].y = self.y + Dmg_Y_Adjust + y + damage_adjust[1]
Thanks, it worked again. I know that Im killing your nerves right now, but I've one final issue where I am stuck.
Its regarding the Battle Camera addon. It basically installs a camera that zooms in and out during certain actions. Almost everything with that works except for some issues.
I wanted to check if your added adjusts work with the Battle Camera addon since Im using it in my project anyway, but even before I can do that theres a problem. Because even If I dont use adjust or center command, the animations such as status animations on battlers like poison and things like timemeter from the ATB addon "slide" when the game zooms in and out which is wrong and kinda looks odd. The animations and the timemeter are not fixed in their position which they should be, they slide when the game zooms.
The Timemeter bar is from the Atoa ATB - also one of his addons.
If you dont know what I mean, I've prepared a picture.
(http://img5.fotos-hochladen.net/uploads/bvbv7655hl3nuvz5tw.png) (http://www.fotos-hochladen.net)
Do you have a solution for that?
Thanks. For everything.
Koktengri.
I can't post Atoas ATB because its too long. So this is a direct link then:
https://workupload.com/file/ZkpZ4CJ
#==============================================================================
# Battle Camera
# by Atoa
#==============================================================================
# This script allow you to add an camera movement and zoom system
# during battle
#
# Don't work with the Add-On 'Chrono Trigger Battle'
#==============================================================================
module Atoa
# Do not remove these lines
Zoom_Actions = {}
Zoom_Skills = {}
Zoom_Items = {}
Zoom_Weapons = {}
# Do not remove these lines
# Add zoom effect to target arrows?
Arrow_Zoom = false
# Add zoom effect to damage exhibition?
Damage_Zoom = false
# Zoom transition speed, the lower, the faster
Zoom_Speed = 10.0
#=============================================================================
# Basic Camera Movement Settings
#=============================================================================
# Here you can set the default movement and zoom settings
# These settings are applied to *all* actions of an set type, unless it
# has it's own settings
#
# Zoom_Actions['Condition'] = ['Type', intensity, adjust x, adjust y]
#
# 'Condition' = Condition that the zoom will be applied
# Must be one of the following values:
# 'reset' = Default Setting, uConfiguração padrão, usado quando nenhuma ação está sendo feita.
# 'active_battler' = used during the actor action selection
# 'select_ally' = used during the selection of single target actor
# 'select_enemy' = used during the selection of single target enemy
# 'select_self' = used during the selection of user
# 'select_all_allies' = used during the selection of all allies
# 'select_all_enemies' = used during the selection of all enemies
# 'select_all_battlers' = used during the selection of all battlers
# 'action_active' = used during the battler action start
# 'action_ally' = used during actions wich the target is a single ally
# 'action_enemy' = used during actions wich the target is a single enemy
# 'action_self' = used during action wich the target is the user
# 'action_all_allies' = used during action wich the targets are all allies
# 'action_all_enemies' = used during action wich the targets are all enemies
# 'action_all_battlers' = used during action wich the targets are all battlers
# 'intro_lock_on' = used during the battle intro, centering the camera on an battler
# 'victory_lock_on' = used during the battle end, centering the camera on an battler
#
# 'Type' = type of zoom applied
# Must be one of the following value:
# 'lock_on_screen' = center the move on the screen
# 'lock_on_group' = center the move on the group (allies on enemies) depending
# on the action
# 'lock_on_battler' = center the move on the battler, using as reference the
# "base" of the battler, don't following him during jumps or lauchs.
# 'lock_on_move' = center the move on the battler, following all movements.
#
# intensity = zoom intensity. Numeric value, can be decilams. Defualt = 1.0
# if the value is 1.0, the camera returns to the original size
# values lower than 1.0 reduces the sprites size, causing an zoom out.
# values higher than 1.0 increases the sprites size, causing an zoom in.
#
# adjust x = camera movement X position adjust
# adjust y = camera movement Y position adjust
#
# IMPORTANTE: Don't remove any of these settings.
# If you don't want that an zoom effect to be used, change the valoe of the
# setting to: Zoom_Actions['type'] = nil
Zoom_Actions['reset'] = ['lock_on_screen', 1.0, 0, 0]
Zoom_Actions['active_battler'] = ['lock_on_battler', 1, 0, 0]
Zoom_Actions['select_ally'] = ['lock_on_battler', 1.2, 0, 0]
Zoom_Actions['select_enemy'] = ['lock_on_battler', 1.2, 0, 0]
Zoom_Actions['select_self'] = ['lock_on_battler', 1.5, 0, 0] #eig 1.5
Zoom_Actions['select_all_allies'] = ['lock_on_group', 0.8, 0, 0]
Zoom_Actions['select_all_enemies'] = ['lock_on_group', 0.8, 0, 0]
Zoom_Actions['select_all_battlers'] = ['lock_on_screen', 0.7, 0, 0]
Zoom_Actions['action_active'] = ['lock_on_battler', 1.1, 0, 0]
Zoom_Actions['action_ally'] = ['lock_on_battler', 1.1, 0, 0]
Zoom_Actions['action_enemy'] = ['lock_on_battler', 1.1, 0, 0]
Zoom_Actions['action_self'] = ['lock_on_battler', 1.5, 0, 0]
Zoom_Actions['action_all_allies'] = ['lock_on_group', 0.8, 0, 0]
Zoom_Actions['action_all_enemies'] = ['lock_on_group', 0.8, 0, 0]
Zoom_Actions['action_all_battlers'] = ['lock_on_screen', 0.7, 0, 0]
Zoom_Actions['intro_lock_on'] = nil
Zoom_Actions['victory_lock_on'] = nil
# OBS.: the options 'intro_lock_on' and 'victory_lock_on', if used together with
# the "Battle Cry" functions, will make the camera center on the battler
# selected to execute the battle cry, otherwise the battler will be random.
# You can use 'Script Calls' to specify one battler to be the target or
# cancel this effect for the next battle.
#
# Lock the camera on the battle intro on the actor with ID = X
# $game_temp.lock_actor_intro = X
#
# Lock the camera on the battle end on the actor with ID = X
# $game_temp.lock_actor_victory = X
#
# Lock the camera on the battle intro on the actor with INDEX = X
# $game_temp.lock_enemy_intro = X
#
# Travar movimento de câmera de vitória no inimigo de INDEX igual a X
# $game_temp.lock_enemy_victory = X
#
# OBS.: for enemies, the value are NOT the enemy ID, it's the INDEX.
# the value according to his position on the Enemy Troop
#
# Cancel the battle intro camera movement
# $game_temp.no_intro_lock = true
#
# Cancel the battle end camera movement
# $game_temp.no_victory_lock = true
#=============================================================================
#=============================================================================
# Specific Camera Movement Settings
#=============================================================================
# Here you can set specific camera movement for each action.
# The values here igonres the settings of the basic settings.
# You only need to add the values that will be changed, for the values not added
# the default values will be used
#
# Zoom_Skills[ID da Skill] = { 'Condition' => ['Type', intensity, adjust x, adjust y] }
# Zoom_Items[ID da Skill] = { 'Condition' => ['Type', intensity, adjust x, adjust y] }
# Zoom_Weapons[ID da Skill] = { 'Condition' => ['Type', intensity, adjust x, adjust y] }
Zoom_Skills[57] = {'action_active'=> ['lock_on_battler', 2.0, 0, 0],
'action_enemy' => ['lock_on_battler', 2.0, 0, 0]}
Zoom_Skills[126] = {'action_active'=> ['lock_on_battler', 2.0, 0, -48],
'action_enemy' => ['lock_on_move', 2.0, 0, -48]}
Zoom_Skills[127] = {'action_active'=> ['lock_on_battler', 2.0, 0, -48],
'action_enemy' => ['lock_on_move', 2.0, 0, -48]}
Zoom_Skills[128] = {'action_active'=> ['lock_on_battler', 2.0, 0, -48],
'action_enemy' => ['lock_on_move', 2.0, 0, -48]}
Zoom_Weapons[17] = {'action_active'=> nil}
Zoom_Weapons[18] = {'action_active'=> nil}
Zoom_Weapons[19] = {'action_active'=> nil}
Zoom_Weapons[20] = {'action_active'=> nil}
Zoom_Weapons[21] = {'action_active'=> nil}
Zoom_Weapons[22] = {'action_active'=> nil}
Zoom_Weapons[23] = {'action_active'=> nil}
#=============================================================================
#=============================================================================
# Settings for Camera Movement Priority
#=============================================================================
# To avoid tha certain camera movements cancel other movements that
# you might consider more important, this settings was added.
# Effects with values higher or equal to the current effect overlaps it.
# If the value is lower, the current movement effect isn't applied
Zoom_Priority = {
'reset' => 10,
'active_battler' => 4,
'select_ally' => 5,
'select_enemy' => 5,
'select_self' => 8,
'select_all_allies' => 6,
'select_all_enemies' => 6,
'select_all_battlers' => 6,
'action_active' => 1,
'action_ally' => 2,
'action_enemy' => 2,
'action_self' => 5,
'action_all_allies' => 3,
'action_all_enemies' => 3,
'action_all_battlers' => 3,
'intro_lock_on' => 7,
'victory_lock_on' => 7
}
end
#==============================================================================
# ** Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Battle Camera'] = true
#==============================================================================
# ** RPG::Sprite
#------------------------------------------------------------------------------
# Class that manages Sprites exhibition
#==============================================================================
class RPG::Sprite < ::Sprite
#--------------------------------------------------------------------------
# * Set animation frame info
# sprite : animation sprite
# cell_data : cell info
# index : index
# anim_mirror : invert animation
#--------------------------------------------------------------------------
def set_sprite_cell_data(sprite, cell_data, index, anim_mirror = false)
sprite.x += (anim_mirror ? - cell_data[index, 1] : cell_data[index, 1]) * $game_temp.temp_zoom_value
sprite.y += cell_data[index, 2] * $game_temp.temp_zoom_value
sprite.zoom_x = (cell_data[index, 3] / 100.0) * $game_temp.temp_zoom_value
sprite.zoom_y = (cell_data[index, 3] / 100.0) * $game_temp.temp_zoom_value
sprite.angle = cell_data[index, 4]
sprite.mirror = (cell_data[index, 5] == 1)
sprite.opacity = cell_data[index, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[index, 7]
end
end
#==============================================================================
# ** Object
#------------------------------------------------------------------------------
# Superclass of all other classes.
#==============================================================================
class Object
#--------------------------------------------------------------------------
# * Adjust position X according to the Zoom
# value : adjust value
#--------------------------------------------------------------------------
def adjust_x_to_zoom(value)
return (value * $game_temp.temp_zoom_value) + $game_temp.temp_zoom_adj_x - ($game_temp.center_adj_x / 2)
end
#-------------------Y according to the Zoom
# value : adjust value
#--------------------------------------------------------------------------
def adjust_y_to_zoom(value)
return (value * $game_temp.temp_zoom_value) + $game_temp.temp_zoom_adj_y - ($game_temp.center_adj_y / 2)
end
end
#==============================================================================
# ** Sprite_Damage
#------------------------------------------------------------------------------
# Classe que gerencia a exibição de dano
#==============================================================================
class Sprite_Damage < Sprite
#--------------------------------------------------------------------------
# * Object Initialization
# sprite : damage sprite
# init_x : initial X postion
# init_y : initial Y position
# duration : damage duration
# mirror : invert movement
# index : index
#--------------------------------------------------------------------------
alias initialize_zoom initialize
def initialize(sprite, init_x, init_y, duration, mirror, index)
initialize_zoom(sprite, init_x, init_y, duration, mirror, index)
adj_x = Damage_Zoom ? sprite.x - index * Dmg_Space : sprite.x
@sprite_x = (adj_x - $game_temp.temp_zoom_adj_x + ($game_temp.center_adj_x / 2)) / $game_temp.temp_zoom_value
@sprite_y = (sprite.y - $game_temp.temp_zoom_adj_y + ($game_temp.center_adj_y / 2)) / $game_temp.temp_zoom_value
self.zoom_x = $game_temp.temp_zoom_value if Damage_Zoom
self.zoom_y = $game_temp.temp_zoom_value if Damage_Zoom
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_zoom update
def update
update_zoom
unless self.nil? or self.disposed?
self.zoom_x = $game_temp.temp_zoom_value if Damage_Zoom
self.zoom_y = $game_temp.temp_zoom_value if Damage_Zoom
adj_x = Damage_Zoom ? @sprite_x + @index * Dmg_Space : @sprite_x
self.x = adjust_x_to_zoom(adj_x)
self.y = adjust_y_to_zoom(@sprite_y)
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :zoom_value
attr_accessor :zoom_adj_x
attr_accessor :zoom_adj_y
attr_accessor :temp_zoom_value
attr_accessor :temp_zoom_adj_x
attr_accessor :temp_zoom_adj_y
attr_accessor :center_adj_x
attr_accessor :center_adj_y
attr_accessor :zoom_plus_x
attr_accessor :zoom_plus_y
attr_accessor :zoom_plus_z
attr_accessor :lock_actor_intro
attr_accessor :lock_enemy_intro
attr_accessor :lock_actor_victory
attr_accessor :lock_enemy_victory
attr_accessor :no_intro_lock
attr_accessor :no_victory_lock
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias initialize_zoom initialize
def initialize
@zoom_value = 1.0
@zoom_adj_x = 0
@zoom_adj_y = 0
@temp_zoom_value = 1.0
@temp_zoom_adj_x = 0
@temp_zoom_adj_y = 0
@center_adj_x = 0
@center_adj_y = 0
@zoom_plus_x = 0
@zoom_plus_y = 0
@zoom_plus_z = 0
initialize_zoom
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :zoom_value
attr_accessor :zoom_adj_x
attr_accessor :zoom_adj_y
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias initialize_zoom initialize
def initialize
@zoom_value = $game_temp.zoom_value
@zoom_adj_x = $game_temp.zoom_adj_x
@zoom_adj_y = $game_temp.zoom_adj_y
$game_temp.zoom_value = 1.0
$game_temp.zoom_adj_x = 0
$game_temp.zoom_adj_y = 0
initialize_zoom
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_zoom update
def update
zoom_update
update_zoom
end
#--------------------------------------------------------------------------
# * Update Zoom
#--------------------------------------------------------------------------
def zoom_update
update_zoom_value
@battleback_sprite.zoom_x = @zoom_value
@battleback_sprite.zoom_y = @zoom_value
@battleback_sprite.x = @zoom_adj_x - ($game_temp.center_adj_x / 2)
@battleback_sprite.y = @zoom_adj_y - ($game_temp.center_adj_y / 2)
if @panorama != nil
@panorama.zoom_x = @zoom_value
@panorama.zoom_y = @zoom_value
@panorama.x = @zoom_adj_x - ($game_temp.center_adj_x / 2)
@panorama.y = @zoom_adj_y - ($game_temp.center_adj_y / 2)
end
if @fog != nil
@fog.zoom_x = $game_map.fog_zoom * @zoom_value / 100.0
@fog.zoom_y = $game_map.fog_zoom * @zoom_value / 100.0
@fog.x = @zoom_adj_x - ($game_temp.center_adj_x / 2)
@fog.y = @zoom_adj_y - ($game_temp.center_adj_y / 2)
end
end
#--------------------------------------------------------------------------
# * Update zoom values
#--------------------------------------------------------------------------
def update_zoom_value
if @zoom_value < $game_temp.zoom_value
@zoom_value = [@zoom_value + $game_temp.zoom_plus_z, $game_temp.zoom_value].min
elsif @zoom_value > $game_temp.zoom_value
@zoom_value = [@zoom_value - $game_temp.zoom_plus_z, $game_temp.zoom_value].max
end
if @zoom_adj_x < $game_temp.zoom_adj_x
@zoom_adj_x = [@zoom_adj_x + $game_temp.zoom_plus_x, $game_temp.zoom_adj_x].min
elsif @zoom_adj_x > $game_temp.zoom_adj_x
@zoom_adj_x = [@zoom_adj_x - $game_temp.zoom_plus_x, $game_temp.zoom_adj_x].max
end
if @zoom_adj_y < $game_temp.zoom_adj_y
@zoom_adj_y = [@zoom_adj_y + $game_temp.zoom_plus_y, $game_temp.zoom_adj_y].min
elsif @zoom_adj_y > $game_temp.zoom_adj_y
@zoom_adj_y = [@zoom_adj_y - $game_temp.zoom_plus_y, $game_temp.zoom_adj_y].max
end
$game_temp.temp_zoom_value = @zoom_value
$game_temp.temp_zoom_adj_x = @zoom_adj_x
$game_temp.temp_zoom_adj_y = @zoom_adj_y
$game_temp.center_adj_x = 640 * (@zoom_value - 1.0)
$game_temp.center_adj_y = 560 * (@zoom_value - 1.0)
end
#--------------------------------------------------------------------------
# * Battleback update
#--------------------------------------------------------------------------
alias update_battleback_zoom update_battleback
def update_battleback
update_battleback_zoom
if @battleback_sprite.bitmap != nil
@battleback_sprite.ox = (@battleback_width - 640) / 2
@battleback_sprite.oy = (@battleback_height - 480) / 2
end
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Battler position update
#--------------------------------------------------------------------------
alias update_position_zoom update_position
def update_position
self.zoom_x = $game_temp.temp_zoom_value
self.zoom_y = $game_temp.temp_zoom_value
update_position_zoom
if @shadow != nil
@shadow.x = adjust_x_to_zoom(@battler.actual_x)
@shadow.y = adjust_y_to_zoom(@battler.actual_y)
@shadow.zoom_x = (@frame_width * 0.5 / @shadow.bitmap.width) * $game_temp.temp_zoom_value
@shadow.zoom_y = $game_temp.temp_zoom_value
end
end
#--------------------------------------------------------------------------
# * Get battler real X postion
#--------------------------------------------------------------------------
def actual_x_position
return adjust_x_to_zoom(@actual_x + set_adjust[0])
end
#--------------------------------------------------------------------------
# * Get battler real Y postion
#--------------------------------------------------------------------------
def actual_y_position
return adjust_y_to_zoom(@actual_y + set_adjust[1])
end
end
#==============================================================================
# ** Throw_Sprite
#------------------------------------------------------------------------------
# This sprite is used to display throw animations.
#==============================================================================
class Throw_Sprite < RPG::Sprite
#--------------------------------------------------------------------------
# * Current position update
#--------------------------------------------------------------------------
def update_current_position
self.x = adjust_x_to_zoom(@actual_x)
actual_y = adjust_y_to_zoom(@actual_y)
arc_ajdust = (@arc_ajdust * $game_temp.temp_zoom_value).to_i
if @boomerang
self.y = [actual_y + arc_ajdust, actual_y].max
else
self.y = [actual_y - arc_ajdust, actual_y].min
end
self.z = self.y + 100
self.zoom_x = $game_temp.temp_zoom_value
self.zoom_y = $game_temp.temp_zoom_value
end
end
#==============================================================================
# ** Arrow_Enemy
#------------------------------------------------------------------------------
# This arrow cursor is used to choose enemies. This class inherits from the
# Arrow_Base class.
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position
#--------------------------------------------------------------------------
def update_arrows
self.x = adjust_x_to_zoom(self.enemy.actual_x)
self.y = adjust_y_to_zoom(self.enemy.actual_y)
self.zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
self.zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Arrow_Actor
#------------------------------------------------------------------------------
# This arrow cursor is used to choose an actor. This class inherits from the
# Arrow_Base class.
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position
#--------------------------------------------------------------------------
def update_arrows
self.x = adjust_x_to_zoom(self.actor.actual_x)
self.y = adjust_y_to_zoom(self.actor.actual_y)
self.zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
self.zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Arrow_Self
#------------------------------------------------------------------------------
# This arrow cursor is used to choose the user.
#==============================================================================
class Arrow_Self < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position
#--------------------------------------------------------------------------
def update_arrows
self.x = adjust_x_to_zoom(self.actor.actual_x)
self.y = adjust_y_to_zoom(self.actor.actual_y)
self.zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
self.zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Arrow_Actor_All
#------------------------------------------------------------------------------
# This arrow cursor is used to choose all actors.
#==============================================================================
class Arrow_Actor_All < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position
# index : index
#--------------------------------------------------------------------------
def update_arrows(index)
@arrows[index].x = adjust_x_to_zoom(@arrows[index].actor.actual_x)
@arrows[index].y = adjust_y_to_zoom(@arrows[index].actor.actual_y)
@arrows[index].zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
@arrows[index].zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Arrow_Enemy_All
#------------------------------------------------------------------------------
# This arrow cursor is used to choose all enemies.
#==============================================================================
class Arrow_Enemy_All < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position
# index : index
#--------------------------------------------------------------------------
def update_arrows(index)
@arrows[index].x = adjust_x_to_zoom(@arrows[index].enemy.actual_x)
@arrows[index].y = adjust_y_to_zoom(@arrows[index].enemy.actual_y)
@arrows[index].zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
@arrows[index].zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Arrow_Battler_All
#------------------------------------------------------------------------------
# This arrow cursor is used to choose all battlers.
#==============================================================================
class Arrow_Battler_All < Arrow_Base
#--------------------------------------------------------------------------
# * Update cursor position for actors
# index : index
#--------------------------------------------------------------------------
def update_arrows_actor(index)
@arrows[index].x = adjust_x_to_zoom(@arrows[index].actor.actual_x)
@arrows[index].y = adjust_y_to_zoom(@arrows[index].actor.actual_y)
@arrows[index].zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
@arrows[index].zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
@arrows[index].z = 3000
end
#--------------------------------------------------------------------------
# * Update cursor position for enemies
# index : index
#--------------------------------------------------------------------------
def update_arrows_enemy(index)
@arrows[index].x = adjust_x_to_zoom(@arrows[index].enemy.actual_x)
@arrows[index].y = adjust_y_to_zoom(@arrows[index].enemy.actual_y)
@arrows[index].zoom_x = $game_temp.temp_zoom_value if Arrow_Zoom
@arrows[index].zoom_y = $game_temp.temp_zoom_value if Arrow_Zoom
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :sprite_x
attr_accessor :sprite_y
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias initialize_zoom initialize
def initialize
initialize_zoom
@sprite_x = 0
@sprite_y = 0
end
#--------------------------------------------------------------------------
# * Set target center action
#--------------------------------------------------------------------------
def action_target_center
@target_x = $scene.spriteset.battleback_width / 2
@target_y = $scene.spriteset.battleback_height / 2
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias terminate_zoom terminate
def terminate
terminate_zoom
$game_temp.zoom_value = 1.0
$game_temp.zoom_adj_x = 0
$game_temp.zoom_adj_y = 0
end
#--------------------------------------------------------------------------
# * Set intro battlecry
#--------------------------------------------------------------------------
alias set_intro_battlecry_zoom set_intro_battlecry
def set_intro_battlecry
@zoom_postion_adj = [0, 0]
set_zoom_postion('reset')
set_intro_battlecry_zoom
if Zoom_Actions['intro_lock_on'] != nil and not $game_temp.no_intro_lock
actors = []
battler_zoom = nil
for i in 0...$game_party.actors.size
actors << $game_party.actors[i] unless $game_party.actors[i].restriction == 4
end
actor = actors[rand(actors.size)]
battler_zoom = actor if actor != nil
if @intro_battlercry_battler != nil
battler_zoom = @intro_battlercry_battler
end
if $game_temp.lock_enemy_intro != nil
enemy = $game_troop.enemies[$game_temp.lock_enemy_intro]
battler_zoom = enemy if enemy != nil and enemy.exist?
end
if $game_temp.lock_actor_intro != nil
battler = $game_actors[$game_temp.lock_actor_intro]
battler_zoom = battler if battler != nil and $game_party.actors.include?(battler) and not battler.restriction == 4
end
set_zoom_postion('intro_lock_on', battler_zoom, battler_zoom) if battler_zoom != nil
end
update_graphics
@spriteset.zoom_value = $game_temp.zoom_value
@spriteset.zoom_adj_x = $game_temp.zoom_adj_x
@spriteset.zoom_adj_y = $game_temp.zoom_adj_y
update_graphics
end
#--------------------------------------------------------------------------
# * Set allies victory battlecry
#--------------------------------------------------------------------------
alias set_victory_battlecry_zoom set_victory_battlecry
def set_victory_battlecry
set_zoom_postion('reset')
set_victory_battlecry_zoom
if Zoom_Actions['victory_lock_on'] != nil and not $game_temp.no_victory_lock
battler_zoom = nil
battler_zoom = @last_active_actor if @last_active_actor != nil
battler_zoom = @victory_battlercry_battler if @victory_battlercry_battler != nil
if $game_temp.lock_actor_victory != nil
battler = $game_actors[$game_temp.lock_actor_victory]
battler_zoom = battler if battler != nil and $game_party.actors.include?(battler) and not battler.restriction == 4
end
set_zoom_postion('victory_lock_on', battler_zoom, battler_zoom) if battler_zoom != nil
end
end
#--------------------------------------------------------------------------
# * Set Victory battlecry for enemies
#--------------------------------------------------------------------------
alias set_enemy_victory_battlecry_zoom set_enemy_victory_battlecry
def set_enemy_victory_battlecry
set_zoom_postion('reset')
set_enemy_victory_battlecry_zoom
if Zoom_Actions['victory_lock_on'] != nil and not $game_temp.no_victory_lock
battler_zoom = nil
battler_zoom = @last_active_enemy if @last_active_enemy != nil
battler_zoom = @victory_battlercry_enemy if @victory_battlercry_enemy != nil
if $game_temp.lock_enemy_victory != nil
battler = $game_troop.enemies[$game_temp.lock_enemy_victory]
battler_zoom = battler if battler != nil and battler.exist? and
$game_troop.enemies.include?(battler) and not battler.restriction == 4
end
set_zoom_postion('victory_lock_on', battler_zoom, battler_zoom) if battler_zoom != nil
end
end
#--------------------------------------------------------------------------
# * Battle Ends
# result : results (0:win 1:escape 2:lose 3:abort)
#--------------------------------------------------------------------------
alias battle_end_zoom battle_end
def battle_end(result)
battle_end_zoom(result)
$game_temp.lock_actor_intro = nil
$game_temp.lock_enemy_intro = nil
$game_temp.lock_actor_victory = nil
$game_temp.lock_enemy_victory = nil
$game_temp.no_intro_lock = nil
$game_temp.no_victory_lock = nil
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
alias start_phase2_zoom start_phase2
def start_phase2
start_phase2_zoom
set_zoom_postion('reset') unless $atoa_script['Atoa ATB'] or $atoa_script['Atoa CTB']
end
#--------------------------------------------------------------------------
# * Start Main Phase
#--------------------------------------------------------------------------
alias start_phase4_zoom start_phase4
def start_phase4
start_phase4_zoom
set_zoom_postion('reset')
end
#--------------------------------------------------------------------------
# * Update Graphics
#--------------------------------------------------------------------------
alias update_graphics_zoom update_graphics
def update_graphics
update_graphics_zoom
update_zoom
end
#--------------------------------------------------------------------------
# * Update ATB
#--------------------------------------------------------------------------
alias atb_update_zoom atb_update if $atoa_script['Atoa ATB']
def atb_update
if @active_battler.nil? and @input_battler.nil? and @active_battlers.empty? and
@input_battlers.empty?
set_zoom_postion('reset')
end
atb_update_zoom
end
#--------------------------------------------------------------------------
# * Update CTB
#--------------------------------------------------------------------------
alias ctb_update_zoom ctb_update if $atoa_script['Atoa CTB']
def ctb_update
if @active_battler.nil? and @input_battler.nil? and @active_battlers.empty? and
@input_battlers.empty?
set_zoom_postion('reset')
end
ctb_update_zoom
end
#--------------------------------------------------------------------------
# * Update zoom
#--------------------------------------------------------------------------
def update_zoom
plus_x = @zoom_postion_adj[0]
plus_y = @zoom_postion_adj[1]
zoom_spd = @zoom_postion_adj[4].nil? ? Zoom_Speed.to_f : @zoom_postion_adj[4].to_f
case @zoom_type
when 'lock_on_battler'
if @locked_battler != nil
$game_temp.zoom_value = @zoom_effect
$game_temp.zoom_adj_x = (320 * $game_temp.zoom_value) - ((@locked_battler.actual_x + plus_x) * $game_temp.zoom_value)
$game_temp.zoom_adj_y = (240 * $game_temp.zoom_value) - ((@locked_battler.actual_y + plus_y) * $game_temp.zoom_value)
end
when 'lock_on_move'
if @locked_battler != nil
sprite = @spriteset.battler(@locked_battler)
$game_temp.zoom_value = @zoom_effect
$game_temp.zoom_adj_x = (320 * $game_temp.zoom_value) - ((sprite.x + plus_x) * $game_temp.zoom_value)
$game_temp.zoom_adj_y = (240 * $game_temp.zoom_value) - ((sprite.y + plus_y) * $game_temp.zoom_value)
end
when 'lock_on_group'
party_x = 0
party_y = 0
@locked_party = @locked_party.nil? ? (@locked_battler.actor? ? $game_party.actors.dup : $game_troop.enemies.dup) : @locked_party
for member in @locked_party
party_x += member.base_x
party_y += member.base_y
end
party_x /= [@locked_party.size, 1].max
party_y /= [@locked_party.size, 1].max
$game_temp.zoom_value = @zoom_effect
$game_temp.zoom_adj_x = (320 * $game_temp.zoom_value) - ((party_x + plus_x) * $game_temp.zoom_value)
$game_temp.zoom_adj_y = (240 * $game_temp.zoom_value) - ((party_y + plus_y) * $game_temp.zoom_value)
when 'lock_on_screen'
$game_temp.zoom_value = @zoom_effect
$game_temp.zoom_adj_x = plus_x
$game_temp.zoom_adj_y = plus_y
end
max_zoom_x = 640.0 / @spriteset.battleback_width
max_zoom_y = 480.0 / @spriteset.battleback_height
$game_temp.zoom_value = [$game_temp.zoom_value, (max_zoom_x > max_zoom_y ? max_zoom_x : max_zoom_y)].max
max_x = [(@spriteset.battleback_width.to_f * $game_temp.zoom_value) - 640, 0].max
max_y = [(@spriteset.battleback_height.to_f * $game_temp.zoom_value) - 480, 0].max
$game_temp.zoom_adj_x = [[$game_temp.zoom_adj_x, - max_x / 2].max, max_x / 2].min
$game_temp.zoom_adj_y = [[$game_temp.zoom_adj_y, - max_y / 2].max, max_y / 2].min
if @old_type != @zoom_type or @old_zoom_adj_x != $game_temp.zoom_adj_x or @old_zoom_adj_y != $game_temp.zoom_adj_y
@old_type = @zoom_type
@old_zoom_adj_x = $game_temp.zoom_adj_x
@old_zoom_adj_y = $game_temp.zoom_adj_y
@min_move = @zoom_type == 'lock_on_battler' ? @min_move + 2.0 : 1.0
@zoom_adj_z = [(($game_temp.temp_zoom_value - $game_temp.zoom_value) / zoom_spd).abs, 0.01].max
@zoom_adj_x = [(($game_temp.temp_zoom_adj_x - $game_temp.zoom_adj_x) / zoom_spd).abs, @min_move].max
@zoom_adj_y = [(($game_temp.temp_zoom_adj_y - $game_temp.zoom_adj_y) / zoom_spd).abs, @min_move].max
end
$game_temp.zoom_plus_z = @zoom_adj_z
$game_temp.zoom_plus_x = @zoom_adj_x
$game_temp.zoom_plus_y = @zoom_adj_y
update_sprite_position
end
#--------------------------------------------------------------------------
# * Update sprites position
#--------------------------------------------------------------------------
def update_sprite_position
for battler in $game_party.actors + $game_troop.enemies
sprite = @spriteset.battler(battler)
next if sprite.nil? or sprite.disposed?
battler.sprite_x = sprite.x
battler.sprite_y = sprite.y
end
end
#--------------------------------------------------------------------------
# * Set zoom postion
# type : zoom type
# target : target position
# active : active battler
#--------------------------------------------------------------------------
def set_zoom_postion(type, target = nil, active = nil)
if active != nil and active.now_action != nil
case active.now_action
when RPG::Weapon
if Zoom_Weapons[now_id(active)] != nil and
Zoom_Weapons[now_id(active)].keys.include?(type)
zoom_settings(Zoom_Weapons[now_id(active)][type], target)
return
end
when RPG::Skill
if Zoom_Skills[now_id(active)] != nil and
Zoom_Skills[now_id(active)].keys.include?(type)
zoom_settings(Zoom_Skills[now_id(active)][type], target)
return
end
when RPG::Item
if Zoom_Items[now_id(active)] != nil and
Zoom_Items[now_id(active)].keys.include?(type)
zoom_settings(Zoom_Items[now_id(active)][type], target)
return
end
end
end
zoom_settings(Zoom_Actions[type], target)
end
#--------------------------------------------------------------------------
# * Set zoom settings
# type : zoom type
# target : target position
#--------------------------------------------------------------------------
def zoom_settings(type, target)
return if type.nil?
return if Zoom_Priority[@zoom_type] != nil and Zoom_Priority[@zoom_type] > Zoom_Priority[type]
@zoom_type = type[0]
@zoom_effect = type[1]
@zoom_postion_adj = [type[2].nil? ? 0.0 : type[2], type[3].nil? ? 0.0 : type[3]]
if target.nil?
@locked_battler = nil
@locked_party = nil
@min_move = 1.0
return
elsif target.is_a?(Game_Battler)
@locked_battler = target
@locked_party = nil
@min_move = (type == 'lock_on_battler' or type == 'lock_on_battler') ? 2.0 : 1.0
return
elsif target.is_a?(Array)
@locked_battler = nil
@locked_party = target
@min_move = 1.0
return
end
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
alias phase3_setup_command_window_zoom phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_zoom
set_zoom_postion('active_battler', @active_battler, @active_battler)
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : actor selection)
#--------------------------------------------------------------------------
alias update_phase3_actor_select_zoom update_phase3_actor_select
def update_phase3_actor_select
set_zoom_postion('select_ally', $game_party.actors[@actor_arrow.index], @active_battler)
set_zoom_postion('active_battler', @active_battler) if Input.trigger?(Input::B)
update_phase3_actor_select_zoom
end
#--------------------------------------------------------------------------
# * Frame Updat (actor command phase : enemy selection)
#--------------------------------------------------------------------------
alias update_phase3_enemy_select_zoom update_phase3_enemy_select
def update_phase3_enemy_select
set_zoom_postion('select_enemy', $game_troop.enemies[@enemy_arrow.index], @active_battler)
set_zoom_postion('active_battler', @active_battler) if Input.trigger?(Input::B)
update_phase3_enemy_select_zoom
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : all enemies selection)
#--------------------------------------------------------------------------
alias update_phase3_select_all_enemies_zoom update_phase3_select_all_enemies
def update_phase3_select_all_enemies
set_zoom_postion('select_all_enemies', $game_troop.enemies, @active_battler)
set_zoom_postion('active_battler', @active_battler) if Input.trigger?(Input::B)
update_phase3_select_all_enemies_zoom
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : all actors selection)
#--------------------------------------------------------------------------
alias update_phase3_select_all_actors_zoom update_phase3_select_all_actors
def update_phase3_select_all_actors
set_zoom_postion('select_all_allies', $game_party.actors, @active_battlerr)
set_zoom_postion('active_battler', @active_battler) if Input.trigger?(Input::B)
update_phase3_select_all_actors_zoom
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : all battlers selection)
#--------------------------------------------------------------------------
alias update_phase3_select_all_battlers_zoom update_phase3_select_all_battlers
def update_phase3_select_all_battlers
set_zoom_postion('select_all_battlers', $game_party.actors + $game_troop.enemies, @active_battler)
set_zoom_postion('active_battler', @active_battler) if Input.trigger?(Input::B)
update_phase3_select_all_battlers_zoom
end
#--------------------------------------------------------------------------
# * Update battler phase 2 (part 1)
# battler : active battler
#--------------------------------------------------------------------------
alias step2_part1_zoom step2_part1
def step2_part1(battler)
@current_zoom_battler = battler
step2_part1_zoom(battler)
set_zoom_postion('action_active', battler, battler)
end
#--------------------------------------------------------------------------
# * Update battler phase 3 (part 2)
# battler : active battler
#--------------------------------------------------------------------------
alias step3_part2_zoom step3_part2
def step3_part2(battler)
camera_targets = set_camera_target(battler)
set_zoom_postion(camera_targets[0], camera_targets[1], battler)
step3_part2_zoom(battler)
end
#--------------------------------------------------------------------------
# * Update battler phase 5 (part 4)
# battler : active battler
#--------------------------------------------------------------------------
alias step5_part4_zoom step5_part4
def step5_part4(battler)
step5_part4_zoom(battler)
set_zoom_postion('reset') if battler == @current_zoom_battler
@current_zoom_battler = nil
end
#--------------------------------------------------------------------------
# * Combination update battler phase 3 (part 2)
# battler : active battler
#--------------------------------------------------------------------------
alias combination_step3_part2_zoom combination_step3_part2 if $atoa_script['Atoa Combination']
def combination_step3_part2(active)
camera_targets = set_camera_target(active)
set_zoom_postion(camera_targets[0], camera_targets[1], active)
combination_step3_part2_zoom(battler)
end
#--------------------------------------------------------------------------
# * Set movement init
# battler : battler
#--------------------------------------------------------------------------
alias set_move_init_zoom set_move_init
def set_move_init(battler)
set_move_init_zoom(battler)
set_zoom_postion('action_active', battler, battler) if battler.moving?
end
#--------------------------------------------------------------------------
# * Update movement return
# battler : battler
#--------------------------------------------------------------------------
alias update_move_return_init_zoom update_move_return_init
def update_move_return_init(battler)
update_move_return_init_zoom(battler)
set_zoom_postion('action_active', battler, battler) if battler.moving?
end
#--------------------------------------------------------------------------
# * Set camera position
# battler : battler
#--------------------------------------------------------------------------
def set_camera_target(battler)
return ['action_enemy', battler.target_battlers[0]] if battler.now_action.nil?
ext = check_extension(battler_action(battler), 'TARGET/')
ext.slice!('TARGET/') unless ext.nil?
if ext == 'ALLBATTLERS'
return ['action_all_battlers', battler.target_battlers]
elsif ext == 'ALLENEMIES' or battler.now_action.scope == 2 or
(battler.now_action.scope == 1 and
check_include(battler.now_action, 'RANDOM'))
return ['action_all_enemies', battler.target_battlers]
elsif ext == 'ALLALLIES' or battler.now_action.scope == 4 or
(battler.now_action.scope == 3 and
check_include(battler.now_action, 'RANDOM'))
return ['action_all_allies', battler.target_battlers]
end
if battler.now_action.scope == 1
return ['action_enemy', battler.target_battlers[0]]
elsif battler.now_action.scope == 3
return ['action_ally', battler.target_battlers[0]]
elsif battler.now_action.scope == 7
return ['action_self', battler.target_battlers[0]]
end
return ['action_self', battler]
end
end
Yeah, I can't help with this one. The code is not pretty to look at and is quite confusing as to how things are working. There really is no easy fix, and that's all the time I really have for.
I can tell you that the ATB bar is supposed to be where it is; there's no compatibility with the camera and the script assumes the bars remain at a fixed location at all times. Writing code to make it move with the zooming and updating its position accordingly is enough of a headache.
Oh I see.
Well, thank you really much for your help so far, It would took me much longer without you.
However, I request not to close this topic or mark this is resolved since Im still stuck with some issues.
Maybe some folks here by chance have a solution. And Im also going make some tests which will take some time. If I have the solution, then Im going to post it here.