Graal Forums

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

MysticHaste 07-02-2005 03:29 PM

Triggering a Projectile
 
Okay here is what is going on, in order to simplify this I'm going to put it into an Era style context.

I have a gun, when I click it on the ground I want it to shoot at the mousex/mousey, but when it reaches its target x/y i want it to explode, as if it has hit the ground.

(Imagine shooting a rocket at the ground in order to to explosion damage instead of a direct hit)

Is there a way I can change a projectile onces its fired, or will this require a complex equation to work out the exact gravity needed to get the projectile to hit the ground on said position?

Thanks for help in advance.

-MH/Dlaiyre Rain.

Evil_Trunks 07-02-2005 04:17 PM

Quote:

Originally Posted by MysticHaste
or will this require a complex equation to work out the exact gravity needed to get the projectile to hit the ground on said position?

yes

i've posted the equation info on the forum before too

I changed power

Velox Cruentus 07-02-2005 04:21 PM

Do you realize the lag it would case? You would have to change the serverside properties of the projectile... Then you would have to send the new coordinates to every client.

How projectile works is that it sends a projectile with a specific height/angle/power. It sends the height/angle/power to every client while it's at it. Then the serverside projectile goes on invisible. The other projectiles are individually kept on each client (as to reduce network lag in, having CPU lag go up to compensate, share the workload!).

You will not be able to.

Now, for the exploding projectiles, yes, you can.
You can assign properties to projectiles that once they hit, they have a trigger for the projectile serverside. You can fire more projectiles when your projectiles land. Just a warning however: Don't make ever-shooting projectiles, and don't make it an exponential outcome! It'll soon become thousands of projectiles in no time.

For the mousex,mousey, use some physics of yours...

It'll requite to work out the exact power and angle to hit. The "complex" equation, is...

http://www.staff.amu.edu.pl/~romango...le-motion.html

There. It's all on that site. Read and Learn. :)

MysticHaste 07-02-2005 05:19 PM

Quote:

Originally Posted by Velox Cruentus
Do you realize the lag it would case? You would have to change the serverside properties of the projectile... Then you would have to send the new coordinates to every client.

How projectile works is that it sends a projectile with a specific height/angle/power. It sends the height/angle/power to every client while it's at it. Then the serverside projectile goes on invisible. The other projectiles are individually kept on each client (as to reduce network lag in, having CPU lag go up to compensate, share the workload!).

You will not be able to.

Now, for the exploding projectiles, yes, you can.
You can assign properties to projectiles that once they hit, they have a trigger for the projectile serverside. You can fire more projectiles when your projectiles land. Just a warning however: Don't make ever-shooting projectiles, and don't make it an exponential outcome! It'll soon become thousands of projectiles in no time.

For the mousex,mousey, use some physics of yours...

It'll requite to work out the exact power and angle to hit. The "complex" equation, is...

http://www.staff.amu.edu.pl/~romango...le-motion.html

There. It's all on that site. Read and Learn. :)

The problem is I don't want the projectile to travel upwards, but rather directly to the target.

I was considering making my own 'projectile' type. Wouldn't be too hard to do, but If I can get by without it I'd prefer that. I am quite out of practice.

Velox Cruentus 07-02-2005 05:24 PM

Directly to the target? You want it to hit the ground, or just pass through the target?

MysticHaste 07-02-2005 05:30 PM

Hit the ground at the target, if it does not hit a block, or a player in the path it travels.

So
Shot -> Doesn't Hit a wall, or a player -> Reaches the Target X,Y -> Blows Up

Velox Cruentus 07-02-2005 05:32 PM

I don't think it's doable. You can, however, put the zangle extremely high. That would more likely to go over players.

Otherwise... You'll have to have a custom one. Custom. Showimg < 200 should be used, just make it fly there and when it reaches the area, make the explosion.

MysticHaste 07-02-2005 05:36 PM

Quote:

Originally Posted by Velox Cruentus
I don't think it's doable. You can, however, put the zangle extremely high. That would more likely to go over players.

Otherwise... You'll have to have a custom one. Custom. Showimg < 200 should be used, just make it fly there and when it reaches the area, make the explosion.

Showimg <200 = much lag.

I will make a trigger that sends the co-ords to each player and then executes clientside for each player, similar to shoot, but with my rules for gravity, thats my last resort anyway.


All times are GMT +2. The time now is 03:00 PM.

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