Critter behaviour and triggers
Posted: Mon Apr 09, 2018 3:17 am
The backstory here is that I had a nasty hack to simulate monsters following the party through stairs and am trying to make a more natural version.
So the questions I am currently facing are:
(1) Is there a way to trigger when monsters rearrange themselves on a tile? Something sort of like "on_turn" does for the player? I need to keep things at the front of the stair tile or the graphics don't work right. Also, if the monster decides to flee then I should shunt it back to the other side of the stair.
(2) The monster far AI should possibly have some mechanism to handle targets. Currently I have a hack added to the far_ai that calls into regular AI if there are any targets set, but I'm wondering if there should be something in the base code. (When the player uses a stair, I set a target for any monster that can see the player)
(3) Even with the aforementioned hack, monsters don't seem to be particularly enthusiastic about following targets. They seem to wander off about half the time...
oh, also
(4) Is there a 'proper' way to test if a tile is passable to the player? I have a method based on the monster_ai that loops through the insts and checks the collision on each, but I'm wondering if I have missed some 'official' method...
Thanks
So the questions I am currently facing are:
(1) Is there a way to trigger when monsters rearrange themselves on a tile? Something sort of like "on_turn" does for the player? I need to keep things at the front of the stair tile or the graphics don't work right. Also, if the monster decides to flee then I should shunt it back to the other side of the stair.
(2) The monster far AI should possibly have some mechanism to handle targets. Currently I have a hack added to the far_ai that calls into regular AI if there are any targets set, but I'm wondering if there should be something in the base code. (When the player uses a stair, I set a target for any monster that can see the player)
(3) Even with the aforementioned hack, monsters don't seem to be particularly enthusiastic about following targets. They seem to wander off about half the time...
oh, also
(4) Is there a 'proper' way to test if a tile is passable to the player? I have a method based on the monster_ai that loops through the insts and checks the collision on each, but I'm wondering if I have missed some 'official' method...
Thanks