Yanfly Row - How to stop an enemy from moving into an occupied space?

CombatJazz

Villager
Member
Joined
Dec 29, 2015
Messages
27
Reaction score
4
First Language
English
Primarily Uses
RMMV
Hello, help form! Here's my question - 


I'm using the row plugin (amongst many other plugins, but I think this is something that can be solved with the row plugin, battle AI, and maybe action sequences? I don't know how really to javascript and i feel like this would require javascript, so I'm coming here for help!), and basically, I have enemies moving into each other. I have enemies capable of moving back and forth in rows, like the players can (the Row command was causing weird bugs, and controlling movement on an individual level I feel makes my game better anyway), and say if you knock a slime back, it crawls forward one row at a time until it's back in row 1.


Basically, is there any way I could javascript either the movement command or the AI of the enemies to look in front of it, go "Hey, if I moved forward I'd be hitting another enemy's hitbox! No, I will stay here and waste my turn", and then not move if it would cause it to bash into another enemy?


My game is still in the early stages of development so this isn't really a prompt request, but any help that one could offer would be appreciated! Right now, here is the movement commands I have and the AI of my test slimes.


Attached are the important files - I'm using State 20, 21, and 22 to track rows in lieu of any other method because I'm a simple guy that doesn't quite understand programming.


Also, the code for the "Advance" and "Fall Back" skills are in the spoilers below, with the slime AI beneath that (all 3 test slimes have the same AI)


Screen Shot 2016-12-05 at 10.11.53 PM.png


"Advance" notes

<Pull Forward User Row: 1>


<setup action>


display action


</setup action>


<finish action>


clear battle log


perform start


perform finish


</finish action>



Screen Shot 2016-12-05 at 10.12.14 PM.png


"Fall Back" notes

<Push Back User Row: 1>


<setup action>


display action


</setup action>


<finish action>


clear battle log


perform start


perform finish


</finish action>



Screen Shot 2016-12-05 at 10.12.25 PM.png


Test Slime AI notes & Row Tracker for reference

<Default Row: 3>


<AI Level: 100>


<AI Priority>


State !== State 20: SKILL 0005


</AI Priority>

Screen Shot 2016-12-05 at 10.12.40 PM.png


The last two pictures are just a demonstration of my problem


Turn 1


Screen Shot 2016-12-05 at 10.16.06 PM.png


Turn 2


Screen Shot 2016-12-05 at 10.16.46 PM.png


Also, here's my row settings for enemy rows, if that helps anything (or if a solution could be engineered from there)


Screen Shot 2016-12-05 at 11.31.17 PM.png
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
TBH, I'd just make it such that your enemies are arranged in a way that they will never bump into each other... that's way easier... 


Else, you will most probably need to edit the plug-in file itself. It might not be too easy since you need to be checking the enemy position itself, not just the "row" since the enemies can have the same "row" number but not bump to each other.
 

lolshtar

Master of Magic thatknow nospell
Veteran
Joined
Apr 13, 2013
Messages
702
Reaction score
103
First Language
French
Primarily Uses
RMMV
play with rowSize and rowIndex on enemy row Y but make sure enemies have enough space to not go offscreen so you might need to limit the enemy maximum size to 4, make some enemies not able to go front line or reduces the enemies graphics.
 

CombatJazz

Villager
Member
Joined
Dec 29, 2015
Messages
27
Reaction score
4
First Language
English
Primarily Uses
RMMV
TBH, I'd just make it such that your enemies are arranged in a way that they will never bump into each other... that's way easier... 


Else, you will most probably need to edit the plug-in file itself. It might not be too easy since you need to be checking the enemy position itself, not just the "row" since the enemies can have the same "row" number but not bump to each other.

I mean, I'd love to make sure they don't bump into each other, but if I can figure out the way to automate that process it'd a: be less work in the future for adding in new enemies, and b: make the game more strategic perhaps.

play with rowSize and rowIndex on enemy row Y but make sure enemies have enough space to not go offscreen so you might need to limit the enemy maximum size to 4, make some enemies not able to go front line or reduces the enemies graphics.

I'll give that a shot, thanks!
 

Latest Threads

Latest Posts

Latest Profile Posts

Day 2 of my redesign journey, as a follow up from the previous post :kaothx:
pXiRJSm.jpg

This is Cedric's son, Apollo!
New pet peeve: Telling tech support personnel what something is doing, only for them to tell me (in excessively condescending tones) what it should be doing. Yes, I know what it should be doing, and if it was doing that, I wouldn’t be talking to you and your attitude problem about it right now, would I? >.<
uglywolf wrote on Khulse's profile.
Hello.
The rules I makes pun about on your last thread is about "Verify Files" before anything else, if the stuff comes from STEAM. Which means, if it could be fixed with just that, there is no need to redownload the whole stuff.
But glad the reinstall worked, hope you enjoy it and your days too.
uh oh, I just tapped into a fresh, deep vein of nightmare fuel right here guys:

Forum statistics

Threads
115,430
Messages
1,089,799
Members
150,186
Latest member
DarkPurplePrince
Top