yuyo Posted April 12, 2023 i'm making a doom 2 wad that has this main enemy that only moves by jumping. The problem is I don't know how to do it, even tho i've been searching in the doom wiki for some flag or something that could help me. Also I didn't find any tutorial on this. It would be very useful if someone could tell me. 0 Quote Share this post Link to post
Burgish Posted April 12, 2023 Most monsters use A_Chase in the "See" state to pursue players. If you wanted to have a monster jump towards the player when its attacking, you could instead use A_FaceTarget (get em pointed in the right direction) and A_ChangeVelocity (give em a little shove forwards+upwards) to move around. So long as its in the "See" state, it should replace all normal monster movement. I think it would be worth your time to study up on how A_Chase works in engine too - it does a few pathfinding things that no other Action commands can really do, so your monster might behave in ways you don't expect. There are a few other commands that could help you fine tune their movement, but that should give you a working prototype to play with. 1 Quote Share this post Link to post
yuyo Posted April 12, 2023 33 minutes ago, Burgish_Nilwert said: Most monsters use A_Chase in the "See" state to pursue players. If you wanted to have a monster jump towards the player when its attacking, you could instead use A_FaceTarget (get em pointed in the right direction) and A_ChangeVelocity (give em a little shove forwards+upwards) to move around. So long as its in the "See" state, it should replace all normal monster movement. I think it would be worth your time to study up on how A_Chase works in engine too - it does a few pathfinding things that no other Action commands can really do, so your monster might behave in ways you don't expect. There are a few other commands that could help you fine tune their movement, but that should give you a working prototype to play with. I tried it in many ways but couldn't make it totally work. here is the code: See: PERO A 2 A_FaceTarget PERO AAAAAA 1 A_ChangeVelocity(0, 0, 3) PERO AAAAA 1 A_ChangeVelocity(0, 0, -3) Loop It did help me to make it jump tho (appreciate that), but it either jumps in his place or jumps toward one of the axis. Don't know how to make it jump toward the player. 0 Quote Share this post Link to post
SilverMiner Posted April 12, 2023 (edited) Try using A_Recoil with a negative number. PERO A 2 A_FaceTarget PERO A 0 A_ChangeVelocity(0, 0, 3) PERO A 0 A_Recoil(-7) Edited April 12, 2023 by SilverMiner 1 Quote Share this post Link to post
Kan3 Posted April 12, 2023 The best result I achieved so far to make a monster that jumps towards the player is with ThrustThing and ThrustThingZ, they should go also in DECORATE. Do something like this: Missile: //Easier to do this stuff in this state. TNT1 A 2 A_FaceTarget //some animation TNT1 A 0 ThrustThingZ(0, 32, 0, 0) TNT1 A 0 ThrustThing(angle*256/360, 20, 0, 0) //it uses byte angles, though I don't remember if you can call the monster angle property in decorate //if not, you can go for A_Recoil(-x) like they said TNT1 AA 4 //jumping animation Jump: TNT1 A 1 A_CheckFloor("Land") //the monster will stay in this tate with that frame until it reaches the ground Loop Land: TNT1 A 2 A_Stop //this is the correct way to stop the monster movement Goto See or Melee 3 Quote Share this post Link to post
Burgish Posted April 12, 2023 17 hours ago, yuyo said: See: PERO A 2 A_FaceTarget PERO AAAAAA 1 A_ChangeVelocity(0, 0, 3) PERO AAAAA 1 A_ChangeVelocity(0, 0, -3) Loop It did help me to make it jump tho (appreciate that), but it either jumps in his place or jumps toward one of the axis. Don't know how to make it jump toward the player. You've got the Z-axis going there, so long as it follows A_FaceTarget you should be able to just add some X-axis velocity and the jump should go forwards: PERO A 1 A_ChangeVelocity(10,0,10) This does the same thing as adding recoil, but in the same command. If you want it to seem like a "jump" I'd consider activating the Action on just one frame (A instead of AAAAAA), as the repeats it might make it act a bit floaty. You won't need the second one with -3 z-axis, gravity should take care of the -z for you ; These are all suggestions tho - play around with the values until it looks and feels how you want it. After the jump, Kan's code checking the floor and stopping (the "jump" and "land" states) will stop your monster from sliding after landing, definitely use those. Hope this helps! 2 Quote Share this post Link to post
yuyo Posted April 15, 2023 On 4/12/2023 at 4:21 PM, Burgish_Nilwert said: You've got the Z-axis going there, so long as it follows A_FaceTarget you should be able to just add some X-axis velocity and the jump should go forwards: PERO A 1 A_ChangeVelocity(10,0,10) This does the same thing as adding recoil, but in the same command. If you want it to seem like a "jump" I'd consider activating the Action on just one frame (A instead of AAAAAA), as the repeats it might make it act a bit floaty. You won't need the second one with -3 z-axis, gravity should take care of the -z for you ; These are all suggestions tho - play around with the values until it looks and feels how you want it. After the jump, Kan's code checking the floor and stopping (the "jump" and "land" states) will stop your monster from sliding after landing, definitely use those. Hope this helps! hey!! so i ended up playing with some functions i found on the doom wiki: See: PERO A 0 A_Chase PERO A 0 A_FaceTarget PERO A 0 A_ChangeVelocity(30, 0, 17, CVF_RELATIVE|CVF_REPLACE) PERO AAAAAAA 1 A_FaceTarget PERO A 0 A_ChangeVelocity(20, 0, -11, CVF_RELATIVE|CVF_REPLACE) PERO AAAAAAA 2 A_CheckFloor("Land") Loop it worked perfectly this way, but then i got another problem: the monster wasn't attacking effectively. it's like if it were just jumping toward the target and mayybe attacking him (sometimes). so i stealed some code that helped me out with this stuff: Missile: PERO A 2 A_FaceTarget PERO A 0 ThrustThingZ(0, 32, 0, 0) PERO A 0 ThrustThing(angle*256/360, 20, 0, 0) PERO AA 4 //jumping animation Jump: PERO A 1 A_CheckFloor("Land") Loop Land: PERO A 2 A_Stop Goto See so i don't fully understand why using the missile state works more effectivly than the see state but it works. also i found out how to use de ThursThing/Z functions :D This works for me so i'll leave it here and thanks to anyone coaching :D 2 Quote Share this post Link to post
Kan3 Posted April 15, 2023 41 minutes ago, yuyo said: so i don't fully understand why using the missile state works more effectivly than the see state but it works. The thing is easier than you may think: The monster enter the see state whenever it acquire a target and it will remain in that state untile it dies (unless you do some more complex "AI"). If in the see state you function like A_Chase, the monster have a chance (based on "aggressiveness") to enter the Missile state if the target is in his attack range. If you give the monster a Melee state, than he will be able to perform a melee attack if the target is in range. Now, in your previous code, the monster would just keep jumping around towards the target, even when he cannot see him, but with a very low chance to perform any sort of attack because he calls A_Chase for just a single frame in that code: without calling A_Chase various times, the chance to trigger an attack is minimal. If you make the monster jump in his Missile state, on the other hand, that action will be considered his range attack and it will be performed only when needed or specified, setting up the attack range etc. 1 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.