Projectile's Target

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
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Projectile's Target

Post by DBThanatos »

Is there a way to make a projectile recognize as the target for A_JumpIfCloser, the monster's target? Because right now, if a projectile has this funcion, it checks the distance with the shooter (a monsters calling the projectile with A_CustomMissile).

Quick example:

Code: Select all

Actor NewDoomImpBall : DoomImpBall replaces DoomImpBall 
{
	States
	{
	Spawn:
		BAL1 A 0
		BAL1 A 0 A_JumpIfCloser(128,"Death")
		BAL1 A 4 Bright
		Loop
	Death:
		TNT1 A 0 A_Stop
		BAL1 CDE 6 BRIGHT
		Stop
	}
}
And as soon as an imp fires, the projectile will go to the death state. So, it's checking for how close/far is the caller, instead of the real target.
It makes no sense, for example, with a seeker missile, that in theory, it has a real target, and still, it checks for the caller.

In the wiki, I saw about firemode 4, and even though it says that is for projectiles fired by other, I wanted to give it a shot. Not even like that worked.

So, is there a way to do this? And also, could this be considered a bug?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Projectile's Target

Post by Gez »

DBThanatos wrote:So, is there a way to do this?
Not as far as I know.
DBThanatos wrote:And also, could this be considered a bug?
Definitely not. A missile's target is its shooter, this is a non-intuitive, but fundamental, quirk of Doom. A_JIC measures the distance between an actor and its target, so if used by a missile, between the missile and its shooter. Working as intended.*

We could imagine a flag parameter to allow to specify closer to whom -- target, tracer, or master. This would be useful; though keep in mind that a projectile is normally dumb and has no idea what it's fired at, unless it's a homing missile, then it uses its tracer field. So even then, it wouldn't help in your example since this fireball is not homing.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: Projectile's Target

Post by DBThanatos »

Well, not in this example, but in what Im using it, it's indeed a seeker missile :P

So, yeah, maybe is time for a feature suggestion :P
Locked

Return to “Editing (Archive)”