A bug regarding HITTARGET, HITMASTER and HITTRACER?

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

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 bug regarding HITTARGET, HITMASTER and HITTRACER?

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Major Cooke » Sat Dec 27, 2014 12:53 pm

Please submit new bug reports next time. It's not ideal for developers or contributors to fix bugs in a section that's CLOSED.

Anyway, I'll fix this.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by AFADoomer » Sat Dec 27, 2014 10:44 am

Sorry to bump this, but has anyone had any luck getting this to work on puffs spawned by rail or standard bullet attacks?

This doesn't work, even thought the graphical part of the puff spawns:

Code: Select all

Actor WeaponHit
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALWAYSPUFF
	+PUFFONACTORS
	+HITTARGET
	States
	{
		Spawn:
			TNT1 A 0
		XDeath:
			UNKN A 35 A_GiveInventory("Disintegration", 1, AAPTR_TARGET)
			Stop
	}
}
I've tried all of the Master/Tracer/Target variants, and assigned the puff to both rail and bullet attacks, with no luck. The UNKNA0 sprite shows up, but nothing is given. Using the same technique on a true projectile works fine.

EDIT:
For P_LineAttack, lines 769-771 of p_map.cpp have:

Code: Select all

if (puffDefaults->flags7 && MF7_HITTARGET) puff->target = trace.Actor;
if (puffDefaults->flags7 && MF7_HITMASTER) puff->master = trace.Actor;
if (puffDefaults->flags7 && MF7_HITTRACER) puff->tracer = trace.Actor;
Too many '&'s!

EDIT2:
For P_RailAttack, Line 4214:

Code: Select all

P_SpawnPuff(source, puffclass, x, y, z, (source->angle + angleoffset) - ANG90, 1, puffflags);
This spawns the puff, but doesn't assign that puff as 'thepuff', so I think that's why the actor pointers don't get assigned to that spawned puff.

Though I'm also not quite sure what line 4182 is trying to do:

Code: Select all

if (puffclass != NULL) thepuff = Spawn(puffclass, source->x, source->y, source->z, ALLOW_REPLACE);
Is it supposed to spawn a puff at the rail origin?

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by NeuralStunner » Sat Dec 20, 2014 7:51 pm

Major Cooke wrote:Throw in what?
Your most recent addition. It seems it's been merged, so apparently the devs are cool with it.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Major Cooke » Sat Dec 20, 2014 5:14 pm

NeuralStunner wrote:A formal suggestion might've needed to be along the lines of separate flags-SNIP-
No it doesn't. It can be super simple and it'd still fit the thread unless mods say otherwise. Pin the blame on me if they do, 'cause it's truthfully me who said it. :P You must not have seen some of my other suggestions back before I got into this coding.

Throw in what?

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by NeuralStunner » Fri Dec 19, 2014 1:50 pm

I was primarily seeking your opinion on the idea, first. A formal suggestion might've needed to be along the lines of separate flags for bouncing behaviors. If you're okay with throwing it in now then that's fine, too. :P

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Major Cooke » Fri Dec 19, 2014 1:46 pm

Done. Though next time, please do make a feature suggestions thread instead of asking in a bug report. :P

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by NeuralStunner » Thu Dec 18, 2014 4:55 pm

One last thought: What about integrating these behaviors with bouncing? I have a situation in which I'd like to make a missile react to certain enemies when it tries to bounce off them.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Major Cooke » Tue Dec 16, 2014 12:16 pm

I'll look into it. I just dont like working with the bullet code because it's confusing. Hard to tell sometimes if it's thepuff or puffDefaults on whom should get these things.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Ghastly » Tue Dec 16, 2014 11:05 am

NeuralStunner wrote:
D2JK wrote:Though I wish it worked for puffs too, but hey.
Agreed, and I don't imagine it would be any harder to do. The puff-spawning code already "knows" about victims.
Rail attacks are surprisingly easy to add that to as well.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by NeuralStunner » Tue Dec 16, 2014 10:39 am

D2JK wrote:Though I wish it worked for puffs too, but hey.
Agreed, and I don't imagine it would be any harder to do. The puff-spawning code already "knows" about victims.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by D2JK » Tue Dec 16, 2014 9:08 am

It works now, thank you for another useful addition!

Though I wish it worked for puffs too, but hey.

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Major Cooke » Mon Dec 15, 2014 10:27 am

Re: A bug regarding HITTARGET, HITMASTER and HITTRACER?

by D2JK » Sun Dec 14, 2014 12:44 pm

I can't get it to work either, trying to test the flag(s) with a code like this:
Spoiler:

A bug regarding HITTARGET, HITMASTER and HITTRACER?

by Fishytza » Wed Dec 10, 2014 7:27 am

According to Major Cooke's git log:
HITTARGET, HITMASTER, and HITTRACER.
A missile that dies hitting an actor will set this impacted actor as the new target/master/tracer, depending on specifications.
And according to the commentary in actor.h:
MF7_HITTARGET = 0x00004000, // The actor the projectile dies on is set to target, provided it's targetable anyway.
MF7_HITMASTER = 0x00008000, // Same as HITTARGET, except it's master instead of target.
MF7_HITTRACER = 0x00010000, // Same as HITTARGET, but for tracer.
The way I understand it, these flags are supposed to be used on missiles, correct? However, when I look at the code it seems that it's the victim's flags which are checked rather than the missile's.

This is what it looks like right now:

Code: Select all

		if (target->flags7 & MF7_HITTARGET)	mo->target = target;
		if (target->flags7 & MF7_HITMASTER)	mo->master = target;
		if (target->flags7 & MF7_HITTRACER)	mo->tracer = target;
But shouldn't it check mo's (the missile's) flags, like so?

Code: Select all

		if (mo->flags7 & MF7_HITTARGET)	mo->target = target;
		if (mo->flags7 & MF7_HITMASTER)	mo->master = target;
		if (mo->flags7 & MF7_HITTRACER)	mo->tracer = target;

Top