Jump to content

Shot that raises the monsters?


Recommended Posts

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!

Share this post


Link to post

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...)

Share this post


Link to post
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!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...