PDA

View Full Version : Firing projectiles...



Cguy
10-13-2000, 03:10 PM
Ok, basically I'm aiming for two projectiles to be fired in opposite vectors when the player enters a specific sector. Here's what I have so far:

code

entered:
FireProjectile(projectile, '0 1 0');
FireProjectile(projectile, '0 -1 0');

Assuming that '0 1 0' is the vector. Is that correct or do those numbers stand for something else? I imagine I also need to set the velocity. Can that be handled through the cog, or do I just base the projectile off of _weapon.tpl and edit the template's velocity?

By the way, getting hit by one projectile has to spell instant death for the player, and they also have to be destroyed when either coming in contact with the player or the opposite wall.

I have to set up a touched message and add in DamageThing for when the player comes into contact with the arrows in order for them to kill the player, correct?

What command do I need to use for the projectiles to be destroyed when coming in contact with a solid object?

zagibu
10-14-2000, 12:44 AM
most of these things are controlled in the template itself (proj speed, damage, binded cog, destroyed when touching surface/player etc...) just get yourself the static.jkl from GaS, the template reference (here on massassi) and the jkspecs (for the correct syntax of fireprojectile...there have to be LOTS more variables in the command, like i.e. shooters origin, played sound, autoaim etc...), then copy one of gunboy's projectiles (i recommend the one of the beretta). They are already set to be destroyed when hitting a solid thing. And give them an incredible damage, like 201 and it will kill the player with one hit.

[This message has been edited by zagibu (edited October 14, 2000).]

zagibu
10-14-2000, 12:48 AM
you could also control the velocity in the cog, but that's a bit difficult...you have to do some vectorcalculation...look it up in the jkspecs on code-alliance

Gandalv the Gray
10-14-2000, 03:48 AM
You can use ParseArg(), but that only changes it locally.

Cguy
10-15-2000, 07:56 AM
Ok, well in which order do the variables go?
In other words, would I do this? FireProjectile(ghost*, projectile, fireSound, autoAIMX,Y or Z FOV);?

The ghost would reference the shooter's origin, and autoAIM*FOV would set the vector direction?

zagibu
10-17-2000, 08:04 AM
why don't you just check the jkspecs? It's described very detailed there...