Panda Posted May 15, 2023 I want to make a weapon that lifts up enemies and pushes them away. A_Blast worked perfectly for me but the shot also affects me and throws me into the air. xd In A_Explode there is XF_THRUSTZ, which I understand also raises monsters but it doesn't work for me. I know it's possible, since archvile uses it, but the problem is that I don't know how O.o! 0 Quote Share this post Link to post
Kan3 Posted May 16, 2023 This because the Archvile A_VileAttack function is "special", basically it thrust the target into the air with its explosion (note that it also deals damage to nearby actors though). You can check the function here. I doubt you can use this function on a weapon, though you can recreate the function within a missile actor class or just directly do the stuff in a missile state. With ZSCRIPT it should be pretty easy: you give a projectile the HITTRACER flag, for example, then, on the projectile XDeath state, you check if there is a tracer and you thrust him into the air or whatever. Something like this: ... +HITTRACER ... XDeath: TNT1 A 0 { if(tracer && !tracer.bDONTTHRUST) { //check if there is a tracer (actor hit by the projectile) and if he has no DONTTHRUST flag. tracer.vel.z = 10 * tracer.mass //use whatever "force" you want to, but remember that it directly depends on the actor's mass. } } TNT1 A 0 A_Explode(); //adds an explosion if you want. Stop; ... In DECORATE, you have to write this in an actual function that you then have to use into this same projectile state (even if I don't really remember if you can do that in DECORATE...) 0 Quote Share this post Link to post
Panda Posted May 19, 2023 On 5/16/2023 at 11:39 AM, Kan3 said: This because the Archvile A_VileAttack function is "special", basically it thrust the target into the air with its explosion (note that it also deals damage to nearby actors though). You can check the function here. I doubt you can use this function on a weapon, though you can recreate the function within a missile actor class or just directly do the stuff in a missile state. With ZSCRIPT it should be pretty easy: you give a projectile the HITTRACER flag, for example, then, on the projectile XDeath state, you check if there is a tracer and you thrust him into the air or whatever. Something like this: ... +HITTRACER ... XDeath: TNT1 A 0 { if(tracer && !tracer.bDONTTHRUST) { //check if there is a tracer (actor hit by the projectile) and if he has no DONTTHRUST flag. tracer.vel.z = 10 * tracer.mass //use whatever "force" you want to, but remember that it directly depends on the actor's mass. } } TNT1 A 0 A_Explode(); //adds an explosion if you want. Stop; ... In DECORATE, you have to write this in an actual function that you then have to use into this same projectile state (even if I don't really remember if you can do that in DECORATE...) It cost me a lot, since I don't use zscript, I had failure after failure but after so much, I got it. Once again, thank you very much! 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.