Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-26-2004, 03:28 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
The GK bow

its cool, im wondering what commands are needed to get somethin like it.

I know this.angle=getangle(mousex-playerx,mousey-playery); gives you the angle the mouse is pointin at, but how do I get like to power it needs?

Btw, i dont know any sine or cosine, havn't taken trig yet. Or whatever sine and cosine are taught in
Reply With Quote
  #2  
Old 02-26-2004, 04:34 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
use shoot, it's in newfeatures and most updated commands.rtf, but if you don't get it search the forums I'm sure it's been explained in detail before
Also check out the arrow gani in Graal shop and the image to see how that works. Well that's about it other than handing you an algorithm, see how far you get.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #3  
Old 02-26-2004, 10:26 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
I know how to use shoot. I just need an algorithm for the z and the power to match mouse location.
Reply With Quote
  #4  
Old 02-27-2004, 02:24 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Problem solving is a valuble skill; learn it.
Reply With Quote
  #5  
Old 02-27-2004, 02:54 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Try getting from point A to point B before comming here (point C).
__________________
Reply With Quote
  #6  
Old 02-27-2004, 03:46 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by Gman4pwnu
I know how to use shoot. I just need an algorithm for the z
you mean the z value you give in the shoot function after the x and y? that is the player's z, it's part of the initial position of your projectile

Quote:
and the power to match mouse location.
Ouch, that requires knowledge of some (basic) physics, I won't give this to you since most likely you'll just copy and paste and that takes all the fun out of me teaching it to you , meh there have been some decent bow scripts posted on here anywho

hmm, I just realized I never finished my physics tutorial on projectiles... darn
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #7  
Old 02-27-2004, 04:54 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
I remember seeing an arrow game you made where you click the target and it shot the arrow at it. You had an equation for the power, it was too confusing for me at the time. =X
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #8  
Old 02-27-2004, 05:05 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
I think he meant the z angle when he mentioned 'z'. Well anyways, I doubt GK bows have different angles so you can set the z to a constant angle, something like pi/6. The power is sort of hard to explain...i'll try to come up with an easy way of explaining it later =\
__________________
Reply With Quote
  #9  
Old 02-27-2004, 06:33 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by ZeLpH_MyStiK
I think he meant the z angle when he mentioned 'z'. Well anyways, I doubt GK bows have different angles so you can set the z to a constant angle, something like pi/6. The power is sort of hard to explain...i'll try to come up with an easy way of explaining it later =\
pi/4 will give you the greatest disance on level ground

that power algorythm I made was a bit more complicated than I inititially thought it would be... ohwell
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #10  
Old 02-27-2004, 03:10 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
You know some stuff, but you don't know how to do that?
__________________
V$:CONFL16T
Reply With Quote
  #11  
Old 02-27-2004, 03:46 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
(Note: I don't have Graal installed here, so I cannot check the definition of power within the shoot command. As a result i'm giving pointers to 2 solutions, so pick whichever one is relevant for the shoot command (ie: whether power is launch velocity or distance to travel))

Solution One - Velocity Based
If power is related to the speed at which the projectile is launched, then the distance travelled if i remember correctly would be proportional to power^2. As I dont know how close the Graal physics are to real life, I can't verify that, nor am I able to give you any constants, as I do not know what constants graal uses internally. You can rearrange to find power from distance fairly easily.

Solution Two - Distance Based
If the power is related to how far you want it to travel, then you can use a rearrangement of the pythagorous theorem to calculate the distance.

If you still need help after this, send a Forum PM, or drop me an e-mail.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #12  
Old 02-27-2004, 05:21 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
We was doing about Velocity In science today, It's interesting.
__________________
V$:CONFL16T
Reply With Quote
  #13  
Old 02-27-2004, 08:03 PM
XxDarkrazorxX XxDarkrazorxX is offline
Uber Master
XxDarkrazorxX's Avatar
Join Date: Jan 2004
Location: The Netherlands
Posts: 162
XxDarkrazorxX is on a distinguished road
Send a message via AIM to XxDarkrazorxX Send a message via MSN to XxDarkrazorxX
newfeatures2004-V3:

- new script variable 'gravity': when you
change that variable then the behaviour
of projectiles changes - by default the z attribute
of a projectile is decreased by 2 each second
(0.1 each frame); if you increase the gravity,
then the arrows fall down faster, if you decrease
the gravity then arrows fly longer; if you
decrease the gravity and shoot it in a low angle
(between 0 and 0.5) you can easier simulate
pistoles or guns;
don't forget to change the gravity variable on both
client and server side
__________________
|\ ______
|......\.....\
|...|..|......\
/...|..|..|....\
\...|..|......./
_|....|.......\
\___/|__|__\
Reply With Quote
  #14  
Old 02-27-2004, 08:39 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by XxDarkrazorxX
newfeatures2004-V3:

- new script variable 'gravity': when you
change that variable then the behaviour
of projectiles changes - by default the z attribute
of a projectile is decreased by 2 each second
(0.1 each frame); if you increase the gravity,
then the arrows fall down faster, if you decrease
the gravity then arrows fly longer; if you
decrease the gravity and shoot it in a low angle
(between 0 and 0.5) you can easier simulate
pistoles or guns;
don't forget to change the gravity variable on both
client and server side
shouldn't use that just to affect how far a projectile goes
it is meant more for shooting in areas of different gravity (obviously) or when shooting something heavy (as in pertaining to the air resistance really, like a cannonball or something)
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #15  
Old 02-28-2004, 01:08 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Quote:
Originally posted by Dach
...or when shooting something heavy (as in pertaining to the air resistance really, like a cannonball or something)
Actually a cannonball doesn't accelerate towards the ground any faster than say, a small pebble. The density of an object doesn't affect its falling speed.

Sorry... but I had to be fussy :P
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #16  
Old 02-28-2004, 01:32 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
What do you mean? Every object has a different terminal velocity...
Reply With Quote
  #17  
Old 02-28-2004, 01:58 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Maybe so, but they are all affected by gravitational acceleration the same, and with the comparatively low vertical components of velocity at launch, air resistance becomes a negligible issue.

For a projectile to reach terminal velocity, were talking a flight time of some 30 to 40 seconds at least.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #18  
Old 02-28-2004, 03:15 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
all objects on earth fall at 32 feet per second.

And btw people, a ton of feathers weighs the same as a ton of lead
Reply With Quote
  #19  
Old 02-28-2004, 04:31 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally posted by R0bin
all objects on earth fall at 32 feet per second.

And btw people, a ton of feathers weighs the same as a ton of lead
o.O I prefer a better unit
9.80665 meters per second squared ;p
__________________
Reply With Quote
  #20  
Old 02-28-2004, 06:04 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
A tonne of something will fall more slowly then a tonne of something else if you shape it so there is more surface or drag.

Also, it doesn't take 30-40 seconds to reach terminal velocity, jump out of an airplace and drop penies from your hand, the pennies fly up (fall slower) and are at their terminal velocity, while you are at yours.
Reply With Quote
  #21  
Old 02-28-2004, 06:32 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Ok we should probably stop with this, it doesn't apply to GScripting =\
__________________
Reply With Quote
  #22  
Old 02-28-2004, 07:16 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
Better unit? Pfffffffft imperial rules.
Reply With Quote
  #23  
Old 02-28-2004, 08:12 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
oooh, Physics time! *cracks knuckles* oh, man they really cracked, ow...

It is true that if you were to drop a bowling ball and a tennis ball at the same time from the same height they would hit the ground at presicely the same moment. This is because the acceleration due to gravity is the same for every object on earth (granted the acceleration does differ from place to place, trust me). But it is not also true that if you drop a feather and a ball of, well any sort, the ball would hit first. This is because of air resistance. While it is not obvious, air resistance affects most flying objects. Baseballs, bullets, planes, birds, and even arrows are among these things. So um, this is getting boring so I'll just say that ICBST an arrow is affected by air resistance on a much greater level than a tossed bowling ball or well even a much heavier arrow....

ICBST means it can be shown that, or it can be bs'ed that (according to my phys class)



hey, a tonne is different than a ton fellers
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #24  
Old 02-28-2004, 08:18 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
Heck, anyway, if you go drop a 3 tonne safe and a tennis ball, what hits first? The object with the greatest terminal velocity. What are you people talking about.
Reply With Quote
  #25  
Old 02-28-2004, 01:51 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
All objects accelerate towards earth at 32fps/9.80665mps, not fall at this speed.

With reference to the 30/40 second claim, were talking about a single projectile fired from the ground, and hence it has to accelerate to zero (top of its flight) then back down to the terminal velocity.

You may or may not know that give or take minimal external forces, the object should hit the ground at the same sort of speed (in the vertical component) as it was launched with.

In my original claim I was estimating terminal velocity to be arround 200 metres per second, although i checked and this is wrong. More accurate figures are 55mps for most objects, ranging up to about 80mps for somthing like a cannonball. These lead to approx estimation of 11 seconds and 16 seconds to reach terminal velocity, although its likely to be more, as the magnitude of acceleration will decrease as the velocity tends towards the terminal velocity.

Phew :P

Now thats sorted, who ever said back to the NPC's is right. I highly doubt Graal uses sophisticated physics with air resistance and terminal velocity, so my solutions from a few posts above would still stand.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #26  
Old 02-28-2004, 04:11 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
I wish it did use advanced physics.

I tried to make a physics engine once, but it turned out to be a fancy jumping script where you could jump off walls, was fun, but no what i wanted it to be.
Reply With Quote
  #27  
Old 02-29-2004, 12:11 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
I think it was Eric and stefan that made the bows, I was on watching them test it a long while ago.
Reply With Quote
  #28  
Old 02-29-2004, 06:15 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Er1c hated me...meh
I liked Pir =P
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #29  
Old 02-29-2004, 10:09 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Er1c should come back..
__________________
V$:CONFL16T
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:25 AM.


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