Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Moderator:GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Warning, Doing this in Decorate, yes I know I'm a chimp.
Trying to make a ghoul that will leap at the player, then when being targeted by the player, via LoS or damage state, it will turn and run from the player.
What version of the code I have worked out are semi doable, but have pathing issues, the monster can leap into solid walls, etc.
Besides inspiration from the Hexen dragon and placing map points for the ghouls to use as a leaping focus, or learning the better code language, are there any decent solutions?
Spoiler:
The trigger has a 80% chance to trigger the left or right flee movements, or 20% to be ignored and let the monster attack more.
DODGEL:
TNT1 A 0 A_FACETARGET
TNT1 A 0 A_SETANGLE(240+ANGLE)
GHUL F 0 A_Recoil(-24)
GHUL W 6 ThrustThingZ(0,30,0,0)
GHUL W 4
GHUL W 4
tnt1 a 0 A_ChangeFlag("FRIGHTENED", true) //triggers the flee
GHUL AB 8
tnt1 a 0 A_ChangeFlag("FRIGHTENED", false) //Turns off the Flee
GOTO SEE
DODGER:
TNT1 A 0 A_FACETARGET
TNT1 A 0 A_SETANGLE(120+ANGLE)
GHUL F 0 A_Recoil(-24)
GHUL W 6 ThrustThingZ(0,30,0,0)
GHUL W 4
GHUL W 4
tnt1 a 0 A_ChangeFlag("FRIGHTENED", true) //triggers the flee
GHUL AB 8
tnt1 a 0 A_ChangeFlag("FRIGHTENED", false) //Turns off the Flee
GOTO SEE