Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Projectile Gani Script position? (https://forums.graalonline.com/forums/showthread.php?t=134259042)

coreys 05-04-2010 09:44 AM

Projectile Gani Script position?
 
I'm trying to script a smoke trail effect for a projectile that is shot using shoot(). I'm doing this in a gani script for the projectile gani.

Originally I was just using TShowImg's inside the gani script, but those would immediately disappear once the projectile hit, which didn't look pretty. So I handled all the image showing in a WNPC that would fade the images out and handle destroying them, and the gani script would just call a public function in that WNPC.

However, when doing that it would show the images at the projectiles shadow, rather than it's actual position...it wouldn't account for the z-axis and I have yet to find a way to do this. The objects z is always 0, so I can't manually subtract that from the y position. This is made especially strange since when creating the TShowImg's in the gani script and setting the x/y in there would account for the z-axis, but not otherwise.

This is extremely frustrating, as it makes doing this in an acceptable way...impossible.

DustyPorViva 05-04-2010 09:55 AM

player.z should work just fine.

Riot 05-04-2010 11:32 AM

Quote:

Originally Posted by coreys (Post 1574012)
I'm trying to script a smoke trail effect for a projectile that is shot using shoot(). I'm doing this in a gani script for the projectile gani.

Originally I was just using TShowImg's inside the gani script, but those would immediately disappear once the projectile hit, which didn't look pretty. So I handled all the image showing in a WNPC that would fade the images out and handle destroying them, and the gani script would just call a public function in that WNPC.

However, when doing that it would show the images at the projectiles shadow, rather than it's actual position...it wouldn't account for the z-axis and I have yet to find a way to do this. The objects z is always 0, so I can't manually subtract that from the y position. This is made especially strange since when creating the TShowImg's in the gani script and setting the x/y in there would account for the z-axis, but not otherwise.

This is extremely frustrating, as it makes doing this in an acceptable way...impossible.

Wouldn't it be possible to accomplish this with the particle system and the 'continueafterdestroy' boolean?

DrakilorP2P 05-04-2010 04:28 PM

Quote:

Originally Posted by Riot (Post 1574023)
Wouldn't it be possible to accomplish this with the particle system and the 'continueafterdestroy' boolean?

Yes.

coreys 05-04-2010 06:44 PM

Particle effects are not working well for this, by the time it starts emitting the projectile is about to land.

Quote:

Originally Posted by DustyPorViva (Post 1574015)
player.z should work just fine.

Why did that work o.O player refers to the projectile in a projectile gani?

salesman 05-04-2010 07:25 PM

Quote:

Originally Posted by coreys (Post 1574077)
Why did that work o.O player refers to the projectile in a projectile gani?

When I was using a gani script to display health on an NPC, I had to use player.attr[] instead of this.attr[]

No clue why, but it works

DustyPorViva 05-04-2010 08:59 PM

Quote:

Originally Posted by coreys (Post 1574077)
Particle effects are not working well for this, by the time it starts emitting the projectile is about to land.


Why did that work o.O player refers to the projectile in a projectile gani?

In gani scripts, the player object refers to the object that the gani is being set to.

coreys 05-04-2010 09:59 PM

Quote:

Originally Posted by DustyPorViva (Post 1574106)
In gani scripts, the player object refers to the object that the gani is being set to.

Good to know, thanks :)

Riot 05-05-2010 04:41 AM

Quote:

Originally Posted by coreys (Post 1574077)
Particle effects are not working well for this, by the time it starts emitting the projectile is about to land.

Well, you could call emitter.emit() to force an emission right away to see if that helps. You can also set the min/max delay to a really high number and just forcefully call it at the speed you want.

Last time I wanted an effect like this I used particles and even for short-lived ones it worked fairly well.

coreys 05-05-2010 06:55 AM

Quote:

Originally Posted by Riot (Post 1574230)
Well, you could call emitter.emit() to force an emission right away to see if that helps. You can also set the min/max delay to a really high number and just forcefully call it at the speed you want.

Last time I wanted an effect like this I used particles and even for short-lived ones it worked fairly well.

Yeah, calling emit() worked about the same.

DrakilorP2P 05-05-2010 06:39 PM

Quote:

Originally Posted by Riot (Post 1574230)
You can also set the min/max delay to a really high number

Or set emitautomatically to false.


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

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