Graal Forums

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

napo_p2p 09-21-2005 07:14 AM

Projectile Speed
 
I'm not very familiar with Graal projectiles...

How do you get them to go faster?

I have the angle calculated by:
NPC Code:
((playerdir%4+1)/4)*(pi*2)


(basically, that shoots a projectile in the players direction).

Now, I'm a little confused on how to set the zangle and power. I want the projectile to go straight (so I've been trying a zangle of 0). But, when I change the power, the projectile appears at a certain point in front of the player and disappears right away.

Any suggestions?

Ajira 09-21-2005 02:11 PM

An easier way to do the angle would be to use 'getangle(vecx(playerdir),vecy(playerdir)).

And basically, when the power of the projectile is not equal to 0, it will shoot along the zangle. So when the power is 1 and the zangle is 0, it would crash right in front of the player. You need to raise the zangle to see it fly. To make the projectile go straight, put both the zangle and power to 0, but you can't change the speed of the projectile. I wish you could though >.<

napo_p2p 09-21-2005 06:04 PM

Quote:

Originally Posted by Ajira
An easier way to do the angle would be to use 'getangle(vecx(playerdir),vecy(playerdir)).

lol, didn't see that (I'm a unit circle freak).

Quote:

Originally Posted by Ajira
(. . .) you can't change the speed of the projectile. I wish you could though >.<

I wish you could too :(.

Thanks a lot for the help. :cool:

Velox Cruentus 09-22-2005 03:13 AM

You can change the speed of a projectile... But throwing it straight up? I don't see the use;

For Ajira, you can shoot almost straight(or straight, for that matter), lower the grav, and it goes faster with the force you put it in.

napo_p2p 09-22-2005 04:10 AM

Quote:

Originally Posted by Velox Cruentus
You can change the speed of a projectile... But throwing it straight up? I don't see the use;

For Ajira, you can shoot almost straight(or straight, for that matter), lower the grav, and it goes faster with the force you put it in.

Which brings me to my next question xP.

When 'gravity' is changed, does it affect all projectiles, or just the projectiles shot after 'gravity' was changed?

ForgottenLegacy 09-22-2005 04:48 AM

Quote:

Originally Posted by napo_p2p
Which brings me to my next question xP.

When 'gravity' is changed, does it affect all projectiles, or just the projectiles shot after 'gravity' was changed?

Looks like this calls for _someone_ to do some testing on a server! I honestly have no clue whether or not it's immediately updated or if it's for all projectiles launched after the update. Would be a worthy thing to test. Go for it!

Ajira 09-22-2005 05:34 AM

Quote:

Originally Posted by Velox Cruentus
You can change the speed of a projectile... But throwing it straight up? I don't see the use;

For Ajira, you can shoot almost straight(or straight, for that matter), lower the grav, and it goes faster with the force you put it in.

Hmm, totally forgot about gravity.

ZeLpH_MyStiK 10-10-2005 05:00 AM

o my gosh
NPC Code:

gravity=0;
then shoot command with zangle 0 and power y;


as y approaches infinity, the speed of projectile also approaches infinity, while going straight.
meaning as long as gravity is set to 0 and zangle set to 0, varying the power will give you a different speed while shooting straight.

[edit] gravity is immediately in effect once set, and will affect all projectiles clientside. [/edit]

napo_p2p 10-10-2005 08:07 PM

Quote:

Originally Posted by ZeLpH_MyStiK
o my gosh
NPC Code:

gravity=0;
then shoot command with zangle 0 and power y;


as y approaches infinity, the speed of projectile also approaches infinity, while going straight.
meaning as long as gravity is set to 0 and zangle set to 0, varying the power will give you a different speed while shooting straight.

[edit] gravity is immediately in effect once set, and will affect all projectiles clientside. [/edit]

Thanks a lot for the reply.

I managed to get projectiles to go faster. Nevertheless, your reply helps.

Again, Thanks ;D.


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

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