Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Feature request (https://forums.graalonline.com/forums/forumdisplay.php?f=194)
-   -   New shoot commands variables (https://forums.graalonline.com/forums/showthread.php?t=134261780)

MrOmega 01-20-2011 03:45 AM

New shoot commands variables
 
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

Quote:

Originally Posted by MrOmega (Post 1624292)
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

Quote:

Originally Posted by Twinny (Post 1624310)
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:
Quote:

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

Quote:

Originally Posted by MrOmega (Post 1624320)
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:
PHP Code:

for (temp.pthis.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

Quote:

Originally Posted by Tigairius (Post 1624322)
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:
PHP Code:

for (temp.pthis.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.


All times are GMT +2. The time now is 01:19 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.