PDA

View Full Version : New shoot commands variables


MrOmega
01-20-2011, 03:45 AM
As far as I know there is no way to read the current anistep, or stop a projectile while in mid-air.

so basically I would like

shoot.anistep
shoot.stop(); ( or end(); or destroy();)

edit: While I'm at it would be nice to be able to read the current x/y/z a shoot is at while, so I could add like a sparkle trail or something behind the gani.

smirt362
01-20-2011, 05:27 AM
Vouch

Twinny
01-20-2011, 05:35 AM
edit: While I'm at it would be nice to be able to read the current x/y/z a shoot is at while, so I could add like a sparkle trail or something behind the gani.

Couldn't you add that sparkle trail in the gani using an emitter?

Lance
01-20-2011, 05:53 AM
Couldn't you add that sparkle trail in the gani using an emitter?

Not just could, but should!

-----

Also, I remember reading something about an onPlayerShoots serverside event, where the first parameter is the player object and the second parameter is a TProjectile object, which in theory should allow you to remove projectiles in flight. As mentioned in the other thread, I haven't done anything like that so I have no personal experience with it.

TProjectile exposes these, which may or may not be useful for your purposes:

angle - float (read only)
fromplayer - object
horiz - boolean (read only)
params - string
speed - float (read only)
x - float (read only)
y - float (read only)
z - float (read only)
zspeed - float (read only)
destroy()

MrOmega
01-20-2011, 06:30 AM
I currently do use it in the gani and how with TServerProjectile do I determine which projectile needs to modified?

Tigairius
01-20-2011, 06:45 AM
I currently do use it in the gani and how with TServerProjectile do I determine which projectile needs to modified?

Give each projectile a unique identifier in the parameters, and then check the parameters to verify that it is the correct projectile. There are quite a few ways to find projectile objects. Here is one example:

for (temp.p: this.level.projectiles) {
if (temp.p.params[0] == "specialprojectile") {
temp.p.destroy();
}
}


Or something of this sort. I don't quite remember how I was doing it on Unholy Nation about 4 years ago.

This will destroy any projectile in the level with the parameter "specialprojectile."

Another great way to capture the projectile object is by using onPlayerShoots(player, projectile).

MrOmega
01-20-2011, 08:56 AM
Give each projectile a unique identifier in the parameters, and then check the parameters to verify that it is the correct projectile. There are quite a few ways to find projectile objects. Here is one example:

for (temp.p: this.level.projectiles) {
if (temp.p.params[0] == "specialprojectile") {
temp.p.destroy();
}
}


Or something of this sort. I don't quite remember how I was doing it on Unholy Nation about 4 years ago.

This will destroy any projectile in the level with the parameter "specialprojectile."

Another great way to capture the projectile object is by using onPlayerShoots(player, projectile).

Did not know of that function, cool thanks Tig.