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
694
Reaction score
101
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

My number one take away from this game jam is to make small games that are as polished and bug free as possible. Far less dev time, and if the game flops, it matters less because my time investment is much lower. Also, whatever ambitions I have... aim for about 10% of them. They are clearly too high, and will involve stuff that likely won't matter.
I'm finally back! :kaojoy:
A lot of RL issues happened this year which didn't let me work on Aithne as much, but I am back with new inspiration!
In that time my art style also changed a little, so I'll be doing a small art change with busts/menu art
Ops forgot to fix the hand on the weaponless sprite o_O
opening old GIMP files is a blessing and a curse because it can be fun to look at art you started once upon a time and want to finish BUT come to a total halt when you remember your past self forgot to create separate layers for most files

Forum statistics

Threads
113,723
Messages
1,076,943
Members
147,752
Latest member
JayJHatchet
Top