thisbecasper, on 15 August 2018 - 05:38 PM, said:
The difficulty is that all of the monster movement commands are oriented to the nearest player, even if the player is dead. A properly coded monster will check for "ifp palive" before firing, but they will generally still seek the nearest player regardless.
I guess the easiest way would be to insert some code into the monsters via EVENT_GAME. The code would check for if the nearest player is dead, and if so would change the angle of the monster so that it moved in a more appropriate direction. Depending on how much work you wanted to put into it, you could do something simple like make the monster walk off in a random direction, or you could write your own pathfinding code.
Here's a very simple and untested attempt at what I'm talking about:
move ENEMYWANDERVELS 160 appendevent EVENT_GAME switch sprite[].picnum case LIZTROOP case PIGCOP case LIZMAN // keep adding cases... ifp palive nullop else ifmultiplayer { ifmove ENEMYWANDERVELS nullop else move ENEMYWANDERVELS randomangle } break endswitch endevent
Note: you may need to make adjustments if you are using an old version of EDuke32 that doesn't allow the abbreviated CON commands