Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-02-2005, 03:29 PM
MysticHaste MysticHaste is offline
Registered User
Join Date: Dec 2003
Location: Australia
Posts: 109
MysticHaste is on a distinguished road
Send a message via AIM to MysticHaste
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.
__________________
spread the herat <3

Quote:
Originally posted by unixmad
Still not sure if it was not someone smoking to mush
Reply With Quote
  #2  
Old 07-02-2005, 04:17 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
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
__________________

Reply With Quote
  #3  
Old 07-02-2005, 04:21 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to 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.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #4  
Old 07-02-2005, 05:19 PM
MysticHaste MysticHaste is offline
Registered User
Join Date: Dec 2003
Location: Australia
Posts: 109
MysticHaste is on a distinguished road
Send a message via AIM to MysticHaste
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.
__________________
spread the herat <3

Quote:
Originally posted by unixmad
Still not sure if it was not someone smoking to mush
Reply With Quote
  #5  
Old 07-02-2005, 05:24 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Directly to the target? You want it to hit the ground, or just pass through the target?
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #6  
Old 07-02-2005, 05:30 PM
MysticHaste MysticHaste is offline
Registered User
Join Date: Dec 2003
Location: Australia
Posts: 109
MysticHaste is on a distinguished road
Send a message via AIM to MysticHaste
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
__________________
spread the herat <3

Quote:
Originally posted by unixmad
Still not sure if it was not someone smoking to mush
Reply With Quote
  #7  
Old 07-02-2005, 05:32 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to 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.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #8  
Old 07-02-2005, 05:36 PM
MysticHaste MysticHaste is offline
Registered User
Join Date: Dec 2003
Location: Australia
Posts: 109
MysticHaste is on a distinguished road
Send a message via AIM to MysticHaste
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.
__________________
spread the herat <3

Quote:
Originally posted by unixmad
Still not sure if it was not someone smoking to mush
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:32 PM.


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