Drifter92

Veteran
Veteran
Joined
Aug 9, 2017
Messages
122
Reaction score
86
First Language
English
Primarily Uses
RMMV
My project uses full screen and higher resolution than default and i'm having difficulty moving the Enemy troop members into position. I have googled around and I can only find this plugin http://www.rpgmakercentral.com/topic/36768-enemy-positions/
Which is great unless you have more than one of the same enemy in your troop.

I have also found a bunch of other people requesting a plugin that can move enemies too but it seems like they never found a solution or they did but never posted what the solution was. eg. https://forums.rpgmakerweb.com/index.php?threads/enemies-battle-positioning.51567/#post-531421

After further searching I came across this older plugin http://himeworks.com/2013/04/enemy-re-position/
This sounds like this is along the right lines but it isn't for RPG Maker MV :(

Does anyone know of a way to position enemy troop members such as the plugin above, or if there is any other solution possible?
Any information would be greatly appreciated :))
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,744
Reaction score
9,292
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

Drifter92

Veteran
Veteran
Joined
Aug 9, 2017
Messages
122
Reaction score
86
First Language
English
Primarily Uses
RMMV
Thanks for that LadyBaskerville!

Sorry for the late reply! I think your Enemy Placement plugin is exactly what i need although Im a little unsure about how to set it up to what i want. For the enemy troops in my game i never have more than 5 troop members but i can have less in a troop. Would i be able to set the default X position so that it centers the members?

For example if i have 1 enemy in the troop then it is shown at the center of the screen. And if i have 5 members in the troop then they are also centered on the screen.

Thanks! :)
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
706
Reaction score
643
First Language
German
Primarily Uses
RMMV
@Beau Lamb It should be possible with some math - I think the default formula in the Default X Position parameter already does something similar, although it doesn't center the enemies. Maybe that can give you a starting point? Keep in mind that you can use troopSize, screenWidth and index as variables in your formula.

Unfortunately, I'm out of country at the moment, so I can't work on it myself, but if you haven't solved it until I come back next week, I'll try to write something up for you.

EDIT: I think something like this should work:
Code:
screenSize/2 + (index - (troopSize-1)/2) * 64
The 64 at the end is just an estimate, you might need to change it to something bigger or smaller if the enemies are too close or too far away from each other. I'm also not sure which point of the graphic is used as the origin for positioning, so if all enemies are shifted to the left or right, that would need adjusting as well. Let me know how it looks when you try it!
 
Last edited:

Drifter92

Veteran
Veteran
Joined
Aug 9, 2017
Messages
122
Reaction score
86
First Language
English
Primarily Uses
RMMV
@LadyBaskerville Thanks for the quick reply! :)
I gave that a go and it looks like its almost what i need :D (Although a little off to the right and the spacing needed be way bigger so i adjusted that) Ill post a bunch of images as it might be easier to explain..

This is what that looked like.. pretty close!
Suggested.png

So i made some changes... although Im not exactly sure what im doing (I could be doing this completely wrong)
But this got me super close! I feel like i shouldn't be dividing the screen width by 4 to get what i want though..... :p

Code:
screenWidth/4 + (index - (troopSize-1)/2) * 340

That got it looking like this :)
Troop5.png

And this what it looks like for the other amount of enemies in the troop.
BattleBoardActors.jpg
Troop2.png
Troop3.png
Troop4.png

Which is perfect for troops that have 1,3,5 enemies in. But for troops that have 2,4 they are centered... which is good but i would preferably like them in the position of the red boxes that i have in the images above. Im not sure if this is possible though as its pretty specific :/

Thanks again! Sorry for the long post.
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
706
Reaction score
643
First Language
German
Primarily Uses
RMMV
Hm... Instead of dividing the screen width by 4, you could probably just substract about 1/4 of the screen width at the end of the formula. That way, you have some better control over the exact position as well, and you could easily shift everything a few pixels to the right or left, if necessary.

If you want the cards in the 2 and 4 member troops in the red boxes you marked above, they would no longer be centered exactly, but be basically in the same positions as in the troops with an uneven number of members, correct? If so, try putting Math.floor(...) around the (troopSize-1)/2 part of the formula.
 

Drifter92

Veteran
Veteran
Joined
Aug 9, 2017
Messages
122
Reaction score
86
First Language
English
Primarily Uses
RMMV
That works perfectly! :D Thank you very much for the help I really appreciate it. Now I dont have to deal with the annoying standard troop positioning :)
 

Latest Threads

Latest Profile Posts



Did this randomly in my free time, I guess today is a good day to show it.
If I were to not exaggerate, I would say that I have changed my damage formula about a million times by now. Give or take 1 or 2.
Son passed his second swimming exam *celebrations*
Super Mighty Pack is set to come out at like 6:09 EST today. It is not free, it will have a subscription service.
Time to wrap things up and release a demo of my game.

Forum statistics

Threads
130,010
Messages
1,207,000
Members
171,274
Latest member
Mindee1993
Top