Help creating a Proximity AI for Monsters (Adventure)

baardbi

Active member
@SHLIM Thank you! I will try it.
I just noticed something. I don't know if you know about this. But in the Adventure module these actions are mixed up: "Stop Moving" and "Move Towards Player". This can easily be fixed by changing the labels in Project Labels, but it is something to be aware of, as it could cause some confusion.
 

dale_coop

Moderator
Staff member
Yeah, it's a known bug. And some topics about that on the forum and how to fix that (just by changing the labels in the "Project Settings > Action Types")
 

tbizzle

Active member
The complete opposites of each other lol. Well that is good to know. Maybe that is why my monsters wouldn't move. Thank you!!
 

tbizzle

Active member
@SHLIM I got it to work tonight! I still got to mess around with it. Its acting a little weirdly, but at least works! Thank you for the help!
 

tbizzle

Active member
@SHLIM I've gotten all 4 monsters to work for me. I just depends where on the screen they are placed. Next thing I need is to somehow have the monster have a facing direction to be able to detect from all directions instead of the default idle facing direction.
 

TalkingCat

Member
I haven't worked with the Adventure module much, but I was curious so I tried this. First of all it seems like it's best to replace the default move towards player AI with the improved one from Bucket Mouse:


Here's what I did:

1. Make a new file (doProximityCheck.asm) and paste the proximity code in there (I put it in the default Subroutines folder).

2. Include the new file in LoadAllSubroutines at the top:



3. Make a new AI and call it CheckProximity.asm. Put this code in there and assign it to a free monster action:



4. Make a monster with two action steps.

- Action step 0: CheckProximity
Timer: 1
End action: Repeat

- Action step 1: MoveTowardsPlayer
Timer: 5
End action: Go to first

Seems to work fine for me.
Thanks! I tried it and it works in the Metroidvania module. But just like in the alternative version, this code refuses to run on some screens or does not work as it should.
 

baardbi

Active member
Thanks! I tried it and it works in the Metroidvania module. But just like in the alternative version, this code refuses to run on some screens or does not work as it should.
Yeah. I have noticed some weirdness in the metroVania module too.
 

SHLIM

Member
@SHLIM I've gotten all 4 monsters to work for me. I just depends where on the screen they are placed. Next thing I need is to somehow have the monster have a facing direction to be able to detect from all directions instead of the default idle facing direction.
ive made a new one....it works without any issues, ill post it in a moment
 
Top Bottom