CaptainManiac Posted September 25, 2016 Ok,i tried to make a decorate zombieman who thinks twice before attacking Here is the code: actor BlaBlaZombieman : Zombieman +QuicktoRetaliate +Floorclip Monster States { Spawn: POSS AB 10 A_Look loop See: POSS AABBCCDD 4 A_Chase TNT1 A 1 A_Jump(65,"PreventAttack") loop PreventAttack: TNT1 A 1 A_GiveInventory("NoAttack",1) goto See Missile: TNT1 A 1 A_JumpIfInventory("NoAttack",1,"Spawn") POSS E 10 A_FaceTarget POSS F 8 A_PosAttack POSS E 8 Goto See Pain: TNT1 A 1 A_TakeInventory("NoAttack,1) POSS G 3 POSS G 3 A_Pain Goto See Death: POSS H 5 POSS I 5 A_Scream POSS J 5 A_NoBlocking POSS K 5 POSS L -1 Stop XDeath: POSS M 5 POSS N 5 A_XScream POSS O 5 A_NoBlocking POSS PQRST 5 POSS U -1 Stop Raise: POSS K 5 POSS JIH 5 Goto See } loop } actor NoAttack:CustomInventory { -inventory.invbar -countitem +inventory.keepdepleted inventory.maxamount 1 } With all this code there is 65% chance for the zombie to not attack the player,but when i tested it the zombie still attacks the player.How to make it really prevent attack with 65% chance to prevent?Sorry for the dumb question 0 Quote Share this post Link to post
Rayziik Posted September 25, 2016 You should just take the base definition of the zombieman and add an 'A_Jump' action to the start of the 'Missile' state that points it back to the 'See' state with whatever amount of chance you want it to have. Also, the chance in any variant of 'A_Jump' codepointer is out of 255, not 100. http://zdoom.org/wiki/A_Jump 0 Quote Share this post Link to post
CaptainManiac Posted September 25, 2016 Ok,i put that in the Missile State,giving 127.5 chance of going back into the See state,but the zombie still attacks me Crap,i used Floating point instead of integer 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.