A_GiveToVictim, A_TakeFromVictim

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_GiveToVictim, A_TakeFromVictim

Re: A_GiveToVictim, A_TakeFromVictim

by Xaser » Wed Jan 15, 2014 3:17 pm

I've gotten around that limitation by calling A_SeekerMissile with SMF_LOOK in the death state, the idea being that the nearest monster is going to be the one that got hit. Probably not foolproof, but I haven't noticed a failure just yet.

You know, a SWITCHTRACERONHIT flag or something would be super handy if it's possible codewise for the projectile to grab a reference to what it strikes. Less hacks all around.

Re: A_GiveToVictim, A_TakeFromVictim

by Gez » Mon Jan 13, 2014 12:23 pm

Ed the Bat wrote:When the projectile hits something, does the actor it struck become its tracer, regardless of what it had originally set for that field?
Nope, it won't. You're right, using the tracer field will only work accurately when managing to hit the intended victim -- which is very far from guaranteed.

Re: A_GiveToVictim, A_TakeFromVictim

by Ed the Bat » Mon Jan 13, 2014 12:18 pm

Does the +SEEKERMISSILE option work, though? I'd thought of trying it out for myself a while back but never got around to testing it... When the projectile hits something, does the actor it struck become its tracer, regardless of what it had originally set for that field? Using A_GiveInventory with the Tracer pointer might give the item to the wrong actor, otherwise.

Re: A_GiveToVictim, A_TakeFromVictim

by NeuralStunner » Mon Jan 13, 2014 11:59 am

Gez wrote:It's a lot more work for a hackier result.
My reaction to 80% of pain state hacks ever suggested.

(Admittedly, A_RadiusGive still has its problems.)

Re: A_GiveToVictim, A_TakeFromVictim

by Ed the Bat » Sun Jan 12, 2014 6:26 pm

TheMightyHeracross wrote:I guess it would be a lot of edited actors, yeah. But there wouldn't be a lot to add to each, right? :?
There would be, by definition, infinitely more to add than what Gez suggested.

Re: A_GiveToVictim, A_TakeFromVictim

by TheMightyHeracross » Sun Jan 12, 2014 5:59 pm

I guess it would be a lot of edited actors, yeah. But there wouldn't be a lot to add to each, right? :?

Re: A_GiveToVictim, A_TakeFromVictim

by Gez » Sun Jan 12, 2014 5:29 pm

Better? That means editing all possible victims to add a special damagetype-dependent death, which can mess with other special damagetype-dependent deaths used for other purposes such as animation. It's a lot more work for a hackier result.

Re: A_GiveToVictim, A_TakeFromVictim

by TheMightyHeracross » Sun Jan 12, 2014 5:27 pm

Or even better, use A_GiveInventory in a special death state for that puff/projectile's damage type.

Re: A_GiveToVictim, A_TakeFromVictim

by Gez » Sun Jan 12, 2014 3:56 pm

There's no "victim" pointer.

You're better off using the tracer pointer and making your projectiles homing. Or use A_RadiusGive with a very short radius.

A_GiveToVictim, A_TakeFromVictim

by rollingcrow » Sun Jan 12, 2014 3:10 pm

A_GiveToVictim (string <type>, amount)
A_TakeFromVictim (string <type>, amount)

This function would be put on the death state of a projectile or spawn(?) state of a puff so it would give or take an inventory item to whatever it hit. It could be useful for giving or taking inventory items to actors on hit without having to use A_RadiusGive or custom pain states.

Top