Emulating the Tracer

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
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Emulating the Tracer

Post by Xaser »

Whelp. Here I was thinking this change would be simple... :P

In a certain project of mine, I'm trying to edit the Revenant's tracer projectile to refrain from spawning BulletPuffs (which make a nice 'ping' sound now) and instead emit a neat spiraling trail, but it's turned out to be a little tougher than I thought. I took a look at [wiki]A_Tracer[/wiki] on the wiki and was a bit surprised at first at how complex the function is. It wasn't hard to figure out the idea, though, but I'm a bit wary at trying to emulate its behavior using the generic A_SeekerMissile. I want the new projectile to behave exactly like RevenantTracer in terms of movement (and thus, gameplay), and I naturally can't use A_Tracer because it automatically spawns that nasty puff.

After a bit of study of the special seeking function, I came up with this quick snippet of (untested) "code" that I think should do the trick, as far as chance and timing:

Code: Select all

ACTOR TracerTong : RevenantTracer replaces RevenantTracer
{
	States
	{
	Spawn:
		FATB A 0
		FATB A 0 A_Jump(128,"NoSeek")
		FATB A 0 A_SeekerMissile(??,??)
		FATB AB 2 BRIGHT  //Insert fancy A_SpawnItemEx's here
		Goto Spawn+2
	Noseek:
		FATB AB 2 BRIGHT
		Goto Noseek
	}
}
But is this right? I could be missing something, so I'm hoping that if there's any flaws in it (sans one obvious one), one of you guys can spot it better than I can.

And the obvious flaw? I'm not sure what values for A_SeekerMissile are exactly equivalent to A_Tracer, and my source-code searches are always futile (can't grasp the math yet). Can someone tell me which values are right on the money? "Close enough" won't cut it here -- the monster and his pet tracer are supposed to behave exactly the same as the original aside from the fancy new trail effect. I won't let that slide this time. ;)

Thanks in advance for the assistance. Funny how there always seem to be problems that are way over my head, no matter how long I work on this kind of stuff. :P
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Emulating the Tracer

Post by XutaWoo »

Wouldn't it just be easier to make the weapons to define which puff they use and not make the bulletpuff be replaced? :P
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Emulating the Tracer

Post by Xaser »

I thought about doing that, but stopped when I realized I'd have to edit every hitscan monster's firing function as well. That's not even considering custom ones. ;)

I figured I'd go about it this way because someone else down the line may be looking to do the same thing. Or maybe I'm just a confusion addict... :P
User avatar
theDooMguy47
Posts: 109
Joined: Tue Apr 14, 2009 8:05 pm
Location: Lake Titicaca, Nicaragua

Re: Emulating the Tracer

Post by theDooMguy47 »

not to be completely anal, but technically that doesn't emulate A_Tracer's behavior, because it chooses weather or nor to seek based on what game tic it is spawned on...
...but I'm sure you knew that. On a more helpful note, could you just replace the RevnantTracerSmoke actor?
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: Emulating the Tracer

Post by phi108 »

Yeah, looking at the code in zdoom.pk3, the tracer smoke uses the bulletpuff sprites, but it's an entirely from scratch actor. Replacing it should not affect anything else.


EDIT: OK, i've confused myself, so you want to have the tracer spawn a new smoke actor more often?

Then just replace Revenanttracersmoke and use code like this in the new tracer:

Spawn:
FATB A 1 BRIGHT A_Tracer
FATB A 1 BRIGHT a_spawnitemex("NewRevenanttracersmoke",...,...,...)
FATB B 1 BRIGHT A_Tracer
FATB B 1 BRIGHT a_spawnitemex("NewRevenanttracersmoke",...,...,...)
Loop


EDIT: Im confused again, so from your code example, you just need to replace Revenantracersmoke, not the tracer itself.

But i'm confused, so I don't know what is real anymore.
Last edited by phi108 on Fri Jun 19, 2009 8:31 am, edited 2 times in total.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Emulating the Tracer

Post by Gez »

TracerTong. Heh.


Anyway, from my understanding of the math in the code, emulating A_Tracer's movement pattern with the generic equivalent is impossible; the maximum turning angle used by A_Tracer is greater than what A_SeekerMissile allows. See this thread for the discussion.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Emulating the Tracer

Post by Macil »

phi108 wrote:EDIT: OK, i've confused myself, so you want to have the tracer spawn a new smoke actor more often?
No, he wants to remove the smoke actor (or replace it with something else).

If the A_Tracer spawns a unique actor, he can probably just replace it.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Emulating the Tracer

Post by Gez »

Agent ME wrote:If the A_Tracer spawns a unique actor, he can probably just replace it.
[wiki=Classes:RevenantTracerSmoke]It does.[/wiki]
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Emulating the Tracer

Post by Xaser »

A_Tracer spawns RevenantTracerSmoke and BulletPuff. They alternate. I can't use A_Tracer at all because it spawns the darn puff -- that's the problem here.
theDooMguy47 wrote:not to be completely anal, but technically that doesn't emulate A_Tracer's behavior, because it chooses weather or nor to seek based on what game tic it is spawned on..
Okay, it's not exact, but I'm afraid it's the closest I'm going to get unless some sort of game-clock check is added in DECORATE.
Gez wrote:Anyway, from my understanding of the math in the code, emulating A_Tracer's movement pattern with the generic equivalent is impossible; the maximum turning angle used by A_Tracer is greater than what A_SeekerMissile allows.
Well, this is a bummer. I suppose there's nothing I can do but mosey on over to the Feature Suggestions area and see if something can be done. Is there any specific reason A_SeekerMissile's angle is clamped to such a low value anyway?
Gez wrote:TracerTong. Heh.
I was wondering if anyone would notice. :P


Thanks all for the help so far. These things always turn out more difficult than they should be. ;)
User avatar
InsanityBringer
Posts: 3392
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: Emulating the Tracer

Post by InsanityBringer »

You could try using A_Tracer2 for your seeking. It should be the same aside from the no every 4 tic limitation and lack of spawning.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Emulating the Tracer

Post by Xaser »

Thank you! Another function I didn't even know existed until now...

It does mention that the seeking angle is "slightly larger" -- by how much? Will this make Mr. Revvie much more dangerous than he already is, or is the difference limited to a couple of degrees or so?

Hmm, I feel a bit dense now. :P
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Emulating the Tracer

Post by Ghastly »

I was messing around with Captain Toenail's upgraded SFX Tracer, and found out that A_Tracer2 is noticably quite a bit more aggressive than A_Tracer. Though, I tried A_SeekerMissile, and the closest I got was (8, 8) or (9, 9). I'm not sure if there's anything closer than that.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Emulating the Tracer

Post by Macil »

It sounds like a good Feature Request could (and should) be made to counter some of the problems mentioned here.
Locked

Return to “Editing (Archive)”