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

headshot_headshot.jpg
The theory has been proved. Based on an invisible image's data(the big red dot in the previous image), RM can identify different parts of an enemy and do something respectively. :kaojoy:
Ok.. coding what should be a simple "everyone is petrified and therefore dead, now go to game over screen" shouldn't involve needing to become Dr. J and dunking from the free throw line(my way of saying "jumping through hoops").
Hmmmm... how many xrays til I get super powers?
..of the major old school series that began in the 80s- early 90s, I still haven't beaten 'a' Zelda game. Mario 64 was the first Mario I've beaten. I don't know if I should give that honor to Link to the Past or A Link Between Worlds(I currently own both). Well technically I've haven't beaten a Sonic either (Game Genie doesn't count =P).
headshot_headinfo.jpg
Time to add the "headshot" concept into the game so that people may actually aim at the heads when shooting zombies and get massive damage and armor-pen bonus as rewards. :kaojoy:
(The red area is just for visually debug purposes right now. But, it's possible that I will add something that displays the weak spots of enemies in the future.)

Forum statistics

Threads
115,381
Messages
1,089,422
Members
150,098
Latest member
Lilyhia
Top