Make "Chase" NPC face hero while adjacent?

Talk about things that are not making games here. But you should also make games!

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Make "Chase" NPC face hero while adjacent?

Post by sheamkennedy »

EDIT: After typing this question up I have realized that perhaps changing the NPC's activation mode to touch (and face hero) when he "see's" you will get the result I desire. I have to head to work now but may try this out in the evening. If you think you have a better answer though please feel free to respond still...

I have an NPC with a line of sight. When this NPC "see's" you he is set to chase. He also has a timer that turns on allowing him to shoot projectiles at you.

This all works great but there's one issue, the way the chase-mechanic works is not ideal. When the NPC is chasing the hero I have noticed that when the hero is not facing the NPC, the NPC will rarely turn to face the direction of the hero and thus will not shoot a projectile making my game too easy.

Is there a way I can override this mechanic so that while the NPC is on a directly adjacent tile (N, E, S, W) of my hero, he will face (and stay facing my hero) thus resulting in more difficult gameplay?

I have made my own attempt in the autorun script of my game but if doesn't work consistently and results in a lot of NPC misalignment so I figure I'm not on the right track at all haha.
Last edited by sheamkennedy on Mon Oct 17, 2016 3:25 pm, edited 2 times in total.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Post Reply