For example, I want to detect if the monster has other monsters in sight. Let's say, if at the given animation he can't see any friendly monster nearby, he will jump to a different state.
Or the script could make the monster don't jump to a state if there are still monsters in sight.
Also, no, I can't have tagged monsters. This is supposed to work as a generic script to affect any monster placed in the map.
So far, I have been trying a DECORATE script poking with the A_CheckSight, A_JUmpIfTargetInLos, and A_ChangeFlag functions, but I still didn't got the expected result.
Code: Select all
See: //Now the see state is not the state where the monster chases the player. The see state only checks if the monster has any allies nearby. If he has allies nearby, he should jump to the common chase state, but if all allies died and he is now the only one nearby fighting the player, he should act differently.
TNT1 A 0 A_CheckSight("Chase") //Chase is supposed to be the See state. So, if theres no players in sight, he will just play his original see animation
XXXX A 1 A_ChangeFlag("FRIENDLY", 1) //Make the monster friendly for a instant so he can use the A_JumpIfTargetINLOS to check if there are any monsters nearby
XXXX A 1 A_Chase // One A_Chase just to make sure that he will count the nearby monsters as targets.
XXXX A 1 A_JumpIfTargetInLOS("Chase") //Check if the monster has valid allies in sight. If yes, he will jump to his chase state where he is going to change his friendly flag to 0 and act like a normal monster.
//If the state didnt jumped to the chase state, it means that the monster failed to see any nearby allies. So this should take his friendly flag away, and jump to the special state.
XXXX A 1 A_ChangeFlag("FRIENDLY", 0)
Goto SpecialState 