Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   "Shoot" Command (https://forums.graalonline.com/forums/showthread.php?t=42095)

GoZelda 01-19-2003 08:08 PM

"Shoot" Command
 
Can someone explain me the Shoot command, i don't understand it, but i need it for my Playerworld Project.

Python523 01-19-2003 08:52 PM

shoot x,y,z,angle,zangle,power,gani,params

x - the place on the x axis the projectile starts at
y - the place on the y axis the projectile starts at
z - the place on the z axis the projectile starts at
angle - the angle it moves at, use getangle(vecx(playerdir),vecy(playerdir)) to shoot it at the direction the player is facing
zangle
zangle - the verticle angle it shoots at, 0 gives it a 0 slope (basically it will shoot like this ----------------) and pi/2 will shoot it straight up
power - the strength of the projectile, make it 0 and it will move till it hits something
gani - the gani the projectile uses
params - params for the gani

tlf288 01-19-2003 10:05 PM

Quote:

Originally posted by Python523

zangle - the verticle angle it shoots at, 0 gives it a 0 slope (basically it will shoot like this ----------------) and pi/2 will shoot it

Use 3.14/2. As far as I know pi isn't a built in variable.

Python523 01-19-2003 10:08 PM

Quote:

Originally posted by tlf288


Use 3.14/2. As far as I know pi isn't a built in variable.

i just said pi because if someone doesn't know what pi is then he or she shouldn't script -.-

tlf288 01-19-2003 10:19 PM

Quote:

Originally posted by Python523

i just said pi because if someone doesn't know what pi is then he or she shouldn't script -.-

I am learning new things all the time... Does that mean I shouldn't script? :\

Loriel 01-20-2003 01:29 AM

pi is indeed a built in variable :)

tlf288 01-20-2003 03:02 AM

Quote:

Originally posted by Loriel
pi is indeed a built in variable :)
*checks*
*sees it is*

Well, then I take back what I said about it not being a built in variable. :|

GoZelda 01-20-2003 08:01 PM

I understand most of it, except for Z and zangle... i tryed to make a script but it soooo sucks

tlf288 01-20-2003 10:57 PM

Quote:

Originally posted by GoZelda
I understand most of it, except for Z and zangle
Z angle is the angle that it takes while going up\down. Just play around with it. Use numbers from 0.1 to 2.1 .

GoZelda 01-21-2003 06:02 PM

K, thanks people. Oh, and pi is 3.14 and another load of numbers behind, it won't stop. so, i DO know that :P

GoZelda 01-21-2003 08:12 PM

K, if have updated, here is the script. It's going fine, except for the fact that it is going the wrong direction! (I use g2k2 gani's now):
// NPC made by Cyrin
if (created) {
}
if (playertouchsme) {
toweapons Bow;
}
if (weaponfired){
if (playerdir=2){
shoot playerx+.5,playery,3.14*3/2,2.1,3.14/5,1,g2k2bolt,30;
}
if (playerdir=1){
shoot playerx,playery,150,3.14,3.14/2.5,1,re_arrow,0;
}
}

Please tell me what i have done wrong.Oh, and thanks Trevor and all of you, you helped me out a lot with the zangle stuff

tlf288 01-22-2003 12:02 AM

Quote:

Originally posted by GoZelda

if (playerdir=2){
...
}
if (playerdir=1){
...
}

You cant set a variable like that. more than likely your trying to check what the player's dir is. So use == not =.

GoZelda 01-22-2003 02:30 PM

thnaks, but that isn't the problem. When i'm in 2 (down) the arrows shoots like 0 (up)

Holyblade_Owner 01-22-2003 02:42 PM

Quote:

angle - the angle it moves at, use getangle(vecx(playerdir),vecy(playerdir)) to shoot it at the direction the player is facing
Did you read what jagen said?

GoZelda 01-22-2003 02:44 PM

didn't work

I played around with it a bit, it works fine now, except for the fact that the arrow lands right in front of me :'( here's shoot thingy:

if (playerdir=2){
shoot playerx+.5,playery,.1
,getangle(vecx(playerdir),vecy(playerdir))
,1.5,1,g2k2bolt,30;
}


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

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