Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> RPG Tankentai Sideview Battle System Auto Enemy Positions, Much easier way to place enemies!
erthia
post Mar 16 2011, 11:51 AM
Post #1


Level 6
Group Icon

Group: Member
Posts: 88
Type: None
RM Skill: Undisclosed




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
Go to the top of the page
 
+Quote Post
   
sniperzip
post Apr 7 2011, 02:37 AM
Post #2



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Beginner




i don't see Acter??
[but see monster in side view]
Go to the top of the page
 
+Quote Post
   
erthia
post Apr 7 2011, 07:11 AM
Post #3


Level 6
Group Icon

Group: Member
Posts: 88
Type: None
RM Skill: Undisclosed




Everything should work the same before this script is placed, for the characters. This script doesn't modify the placement of characters, only the enemies. I just tried it on a brand new installation of the sideview system.
Go to the top of the page
 
+Quote Post
   
arokalot
post Apr 24 2011, 08:25 AM
Post #4


Level 3
Group Icon

Group: Member
Posts: 40
Type: Artist
RM Skill: Beginner




When I tried this it showed the enemy way off the screen.


__________________________

"It's not all it's cracked up to be, It's what you make it."
Go to the top of the page
 
+Quote Post
   
Ashalinia
post Apr 24 2011, 03:46 PM
Post #5


Level 12
Group Icon

Group: Revolutionary
Posts: 204
Type: Writer
RM Skill: Intermediate




You've actually tested this? When I had 2 enemies on the screen it just put them insanely close together. Is this dependent on graphic sizes?


__________________________
Do you hate me? Good, I hate you too.

Rob_Riv is my idol. :)



Support



-----------------------------------------------------------------------------------------------------------------

Sorcerer's Night
Go to the top of the page
 
+Quote Post
   
SoloHero
post Apr 25 2011, 11:07 PM
Post #6


Level 2
Group Icon

Group: Member
Posts: 23
Type: Artist
RM Skill: Intermediate




QUOTE (Ashalinia @ Apr 24 2011, 03:46 PM) *
You've actually tested this? When I had 2 enemies on the screen it just put them insanely close together. Is this dependent on graphic sizes?

Not really. You can just customize the spacing between enemies in the script and they'll all follow those same coordinates.

This post has been edited by SoloHero: Apr 25 2011, 11:15 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Ashalinia
post Apr 26 2011, 02:40 PM
Post #7


Level 12
Group Icon

Group: Revolutionary
Posts: 204
Type: Writer
RM Skill: Intermediate




QUOTE
Not really. You can just customize the spacing between enemies in the script and they'll all follow those same coordinates.


Oh I see, so this is so that all enemy troops are placed at the same coordinates in battles? That would make a little more sense.


__________________________
Do you hate me? Good, I hate you too.

Rob_Riv is my idol. :)



Support



-----------------------------------------------------------------------------------------------------------------

Sorcerer's Night
Go to the top of the page
 
+Quote Post
   
Bloodmatrix
post Oct 16 2011, 06:29 PM
Post #8


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Undisclosed




thank you, you did a great job with this script. it was exactly what I was looking for, and was expecting.
am using it from now on biggrin.gif
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 04:57 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker