Inspired by Melody engine's ability to auto setup enemy positions, I decided to create a script that will help make positioning enemies easier in the RPG Tankentai Sideview Battle System. All you have to do is just add the enemies by pressing the add button in the database.
Place code as last script if you see no changes.NOTE: Make sure levitate is not checked on the monster, it won't place the battler properly.
CODE
module ENEMY_POSITION
POSITION_ENEMY ={
############################################################################
#Configure Adjustments here:
############################################################################
#[adj_x, adj_y, x_rate_x, x_rate_y, y_rate_x, y_rate_y],
:setup => [-408, 128, 0.300, -0.250, 1.600, 0.500],
}
end
############################################################################
class Game_Troop < Game_Unit
def setup(troop_id)
clear
@troop_id = troop_id
@enemies = []
offsets = ENEMY_POSITION::POSITION_ENEMY[:setup]
for member in troop.members
next if $data_enemies[member.enemy_id] == nil
enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
position_x = (member.x * offsets[2]) + (member.y * offsets[4])
position_x += offsets[0]
position_y = (member.x * offsets[3]) + (member.y * offsets[5])
position_y += offsets[1]
enemy.screen_x = Integer(position_x)
enemy.screen_y = Integer(position_y)
@enemies.push(enemy)
end
make_unique_names
end
end
This post has been edited by erthia: Mar 16 2011, 08:10 PM