PDA

View Full Version : Does anyone


Mblackwell
05-23-2001, 02:13 PM
This is a question only for Eduke coders:

Has anyone come up with a way to emulate the "ifcanseetarget" command on any actor? I asked Matt if he would add an "ifcanseetarget <target>" command, and he said he would...... but only if it couldn't already be emulated. He asked me to check. So, here it is. Anyone got it?

cyborg
05-27-2001, 05:02 AM
No, but using a QuakeC traceline is more useful anyway.

Manson
05-27-2001, 02:08 PM
How is that relevant?

How quick do you need it to be?
You could use findnearactor to get the ID, and then get the angles, and dist to the target, and the make a sprite follow the path betwen the two actors, checking for walls, higher/lower sectors, and sprites.

The sprite detecting is going to be a little difficult, but shouldn't take more than a fiew days to do.

cyborg
05-27-2001, 03:07 PM
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Manson:
and the make a sprite follow the path betwen the two actors, checking for walls, higher/lower sectors, and sprites.<HR></BLOCKQUOTE>

That's a traceline. It's better to move along the build structure by calculation than to use a sprite to do it by inference.

cyborg
05-27-2001, 03:08 PM
And I can think of a really easy way of doing it using shotspark or a similar projectile as the traceline.

Manson
05-27-2001, 05:16 PM
I was thinking of the projectile way too, but it'll require redoing much of the game codes,,, Luckily I'm allready doing that, so I don't have any trouple smilies/images/icons/smile.gif

2nd:
------------------------------------
move along the build structure
------------------------------------
I don't understand. You mean the walls?

cyborg
05-27-2001, 05:44 PM
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Manson:
2nd:
------------------------------------
move along the build structure
------------------------------------
I don't understand. You mean the walls?<HR></BLOCKQUOTE>

Well, take the angle and elevation of a straight line you want to project. Now move along that line until you reach the edge of a sector. If you are able to move into another sector because the wall is connected to another wall do so. Otherwise stop and return information on wall to programmer. If you are above or below normal playing area (ie in floor or ceiling) calculate the intersection and return information to programmer.
Repeat logic steps until you reach an obstacle described and then do something with the result of the trace. Although I'm hazy on the precise details on how Build does this because I'd have to look at the source again but that's the basic concept behind projectiles like shotspark that instantly arrive at their targets.
Because you are using the build map structure to calculate this you directly move along the structure rather than create an object in the game world to indirectly move along the structure.

I'm confident Matteus could add such a feature in about five minutes seeing as all the code must be there already.

Manson
05-28-2001, 04:06 AM
Something like vectors?
I've already bugged Matt about 'em.

To use the old projectiles for this, you must define all sprites as enemies.
And set the auto-aim to 1 or 2.
I think I tried making a distance calculator this way with no luck.

Mblackwell
05-30-2001, 11:11 AM
Now you must know that a hard coded version of what you (Manson) are talking about through CONs would be :

A) Easy to use (Matt could set up a structure for it)
B) Faster

Manson
05-30-2001, 05:38 PM
The reason I've bugged Matt about vectors is, that they're faster and easier but, when they're not in, you must find some alternatives right?