Changing projectile effects based on what is hit.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Changing projectile effects based on what is hit.

Post by Deathsong12 »

Is there currently any way to make a projectile perform differently if it hits a monster rather than a wall? Failing that, is it possible just to have a projectile produce a bloodspat upon hitting a monster and a puff upon hitting a wall, like a hitscan trace?
User avatar
Froon
Posts: 116
Joined: Tue Aug 30, 2005 8:42 pm

Post by Froon »

A rough-as-guts way you could try is something like this:

The projectile you fire has a damge of zero and no death frames. On death it spawns an actor of zero speed similar to itself.

This actor that has been spawned is tagged as friendly, has zero speed, and it's 'see' state loops to death, which will be the "hit wall" type animation.

It is also given a mellee attack, with damage the same as what the projectile was going to be, the mellee attack animation is the same as the "hit monster" type animation for your projectile. Also, the mellee attack ends with 'stop', as opposed to the standard 'goto see'.

As you can see, rough-as-guts, but for all intents and purposes, this should solve your problem.

Alternatively, if you are just after blood spat or bullet puff, you can always have the projectile have no visible death frames, but instead fire a custom bullet forward the moment it connects.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

I think that using the projectile's XDEATH states and CRASH states will make it use those animations when it hits an actor or an actor with NOBLOOD set (respectively).
User avatar
Deathsong12
Posts: 1083
Joined: Sat May 07, 2005 1:29 pm
Location: On the hunt

Post by Deathsong12 »

Okay. I'm just roughing out some stuff for WWE, that Froon will probbably make much better versions of at some point.
Locked

Return to “Editing (Archive)”