How do I fix monsters not working with portals?
Posted: Wed Sep 06, 2017 8:39 am
I have recently been experimenting with altering small fragments of a map during runtime by dynamically setting up interactive line portals to prefabricated areas. This unfortunately messes with A_Chase monsters, since they follow the players by looking in their direction, map coordinate wise. So a monster that is behind a portal can, generally, end up going into a completely random direction after getting its sights on you. It doesn't have to, but it usually does.
The thing is, I think A_Chase would generally work well enough as is if I could supply my very own difference vector between player and the monster, or alternatively my very own player position instead of the true one. Is there any obvious method of doing this, especially something involving ZScript? The only thing that comes to mind is setting up some sort of fake target actor for every combination of map-misplaced room and a player, but that sounds like an overkill if I have a non-single digit amount of rooms, plus maybe it wouldn't even be working? I am assuming here I can mod the monster's code and supply my own A_Chase equivalent, though a method not involving this would obviously be better.
The thing is, I think A_Chase would generally work well enough as is if I could supply my very own difference vector between player and the monster, or alternatively my very own player position instead of the true one. Is there any obvious method of doing this, especially something involving ZScript? The only thing that comes to mind is setting up some sort of fake target actor for every combination of map-misplaced room and a player, but that sounds like an overkill if I have a non-single digit amount of rooms, plus maybe it wouldn't even be working? I am assuming here I can mod the monster's code and supply my own A_Chase equivalent, though a method not involving this would obviously be better.