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 03-15-2005, 12:01 AM
hottstuff911 hottstuff911 is offline
Scripter
hottstuff911's Avatar
Join Date: Jan 2005
Location: USA
Posts: 23
hottstuff911 is on a distinguished road
Send a message via AIM to hottstuff911
Help Scripting Projectiles

can anyone please teach me how to script projectile stuff please and tell me what parts of it does what please.
__________________

~Contact Info~
Aim: Grind64RyGuy
Email: [email protected]
Client Status:
Reply With Quote
  #2  
Old 03-15-2005, 01:14 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
shoot x,y,z,angle,zangle,power,gani,ganiattribute;

x-starting x of the projectile

y-" "y " "

z-" "z " "

angle-the angle at which the shot will fire, in radians. 0 is right, 3.14/2 is up, 3.15 is left, and 3.14*1.5 is down

zangle-same thing but for on the z axis, it decides how "up" the shot will be fired, with 0 being shot straight forward (not good to do, wont get anywhere becuase of the gravity), and 3.14/2 being straight up.

power- the force of the shot. 1 is the default graal arrow, and having 0 will make the projectile not be affected by gravity and travel at a speed of 1 (not sure if that's how it's meant, but my experience tells me this).

gani- gani of the projectile, if you put nothing it uses the player's gani without the player sprites (except for shadow). example: if the player is idle it will shoot a shadow.

gani attribute- same as with setani gani,ganiattribute;



Hope that helps, anyone can correct me if I put something wrong or misguiding here (but dont be an ass about it)


EDIT: forgot a few other things for setting up and recieving the projectile.


setshootparams param0,param1,ect.-for clientside, when recieved, there will be parameters based on what's set here, so if you have iut set as:
NPC Code:

setshootparams 1,2;


when recieved (I'll cover that next) with actionprojectile clientside it will have #p(0) as 1, and #p(1) as 2. if done serverside or with actionprojectile2, when recieved it will have #p(0) as the landing x(where the projectile hits the ground or something else), #p(1) as the landing y, and then #p(2) as 1, and #p(3) as 2.


Recieving:


actionprojectile-if on clientside, it reacts when hit by a clientside projectile. If on serverside it triggers if a clientside projectile lands (or if in a class npc when it's hit by one), and if done serverside, #p(0) is the land x, and #p(1) is the landing y, and the following params will be any ones that were set for the projectile. Otherwise the params are in order of what was set by the player, starting at #p(0).

actionsprojectile-a serverside projectile has landed (meaning a projectile sent by a serverside script). Params are the same as with serverside above. If put in a class npc or on clientside, it will react when hit by a serverside projectile (and params are as the player set)

actionprojectile2- clientside: a clientside projectile has landed. Params are same as actionprojectile on serverside. This command isnt used serverside.



I think that covers it all, hope this helps.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!

Last edited by falco10291029; 03-15-2005 at 01:24 AM..
Reply With Quote
  #3  
Old 03-15-2005, 01:29 AM
hottstuff911 hottstuff911 is offline
Scripter
hottstuff911's Avatar
Join Date: Jan 2005
Location: USA
Posts: 23
hottstuff911 is on a distinguished road
Send a message via AIM to hottstuff911
ok if you didn't make any mistakes i think this will really help me thanks.
__________________

~Contact Info~
Aim: Grind64RyGuy
Email: [email protected]
Client Status:
Reply With Quote
  #4  
Old 03-15-2005, 02:31 AM
hottstuff911 hottstuff911 is offline
Scripter
hottstuff911's Avatar
Join Date: Jan 2005
Location: USA
Posts: 23
hottstuff911 is on a distinguished road
Send a message via AIM to hottstuff911
do you think you can like make the part when it gets recived by like a player or a baddy they lose 1 hp.

because i dont get how to make that part from your instructions.

:'(
__________________

~Contact Info~
Aim: Grind64RyGuy
Email: [email protected]
Client Status:
Reply With Quote
  #5  
Old 03-15-2005, 11:02 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by hottstuff911
do you think you can like make the part when it gets recived by like a player or a baddy they lose 1 hp.

because i dont get how to make that part from your instructions.

:'(
Don't ask people to do your work for you. You're asking them to break the forum rules, man.
Reply With Quote
  #6  
Old 03-15-2005, 10:22 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
If we trust his words, it isn't illegal because it's only showing how to do it and he tried already.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #7  
Old 03-15-2005, 11:46 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
If we trust his words, it isn't illegal because it's only showing how to do it and he tried already.
The rules clearly say that you shouldn't ask for scripts. All the trust in the world wouldn't obviate this rule.
__________________
Reply With Quote
  #8  
Old 03-16-2005, 12:01 AM
hottstuff911 hottstuff911 is offline
Scripter
hottstuff911's Avatar
Join Date: Jan 2005
Location: USA
Posts: 23
hottstuff911 is on a distinguished road
Send a message via AIM to hottstuff911
how any one help me on to make a projectile script to make it shoot up and go far
__________________

~Contact Info~
Aim: Grind64RyGuy
Email: [email protected]
Client Status:
Reply With Quote
  #9  
Old 03-16-2005, 12:21 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
The rules clearly say that you shouldn't ask for scripts. All the trust in the world wouldn't obviate this rule.
Technically he asked for part of one
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #10  
Old 03-16-2005, 02:11 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
Technically he asked for part of one
You are saying that a subset of a script is not itself a script? How do you define the term?
__________________
Reply With Quote
  #11  
Old 03-16-2005, 02:37 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
You are saying that a subset of a script is not itself a script? How do you define the term?
It depends what we go by. If we go by the fact that any flag and command could be a script then yes, he is asking for one. But if you go by the fact that he is asking for help in a whole script by wanting help with a part, then he isn't. I go by the latter. I'm not sure how the rules are meant, but misinterpretation is more the writer's fault than mine.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #12  
Old 03-16-2005, 02:41 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
if you go by the fact that he is asking for help in a whole script by wanting help with a part
He's not "asking for help", he's asking for prepackaged NPC code. Again: How do you define the word 'script'?
__________________
Reply With Quote
  #13  
Old 03-16-2005, 02:47 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
He's not "asking for help", he's asking for prepackaged NPC code. Again: How do you define the word 'script'?
He asked for help because he didn't know that type of command. in fatc i gave a universal example not thew exact thing he needed. I define a script as a functioning.....script......but if someone asks for how to use a function in a flag I don't consider it to be a script if I give a universal example
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #14  
Old 03-16-2005, 03:07 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
I define a script as a functioning.....script......
Could you give me a non-recursive definition?
__________________
Reply With Quote
  #15  
Old 03-16-2005, 04:03 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
Could you give me a non-recursive definition?
an npc of any sort that has at least one flag and one function and does the desired effect. Also it can't be part of another one
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #16  
Old 03-16-2005, 04:17 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
an npc of any sort that has at least one flag and one function and does the desired effect
What does it mean to "have" a flag? Also, does this definition exist outside of your head? It seems quite arbitrary.
__________________
Reply With Quote
  #17  
Old 03-16-2005, 04:35 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
What does it mean to "have" a flag? Also, does this definition exist outside of your head? It seems quite arbitrary.
If (flag) function; <- Bare minimum to be a script, and it must work, and not be part of another. I don't believe something should be a part and a whole at the same time. As for where I got it, it would be basic experience and what i've found some others to believe to be a script.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #18  
Old 03-16-2005, 04:41 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
If (flag) function; <- Bare minimum to be a script, and it must work, and not be part of another
How do you test the third criterion? Anything can be added to another script.

Also, it is entirely possible to achieve fairly complicated effects without explicitly trapping any events. If I wrote some code to do so, would it not be a script?

Lastly, you are saying that there's no such thing as a malfunctioning script?

Quote:
I don't believe something should be a part and a whole at the same time
Indeed? Then you may have some disagreements with the real world, where that kind of thing happens all the time.

The ocean is a large collection of water. Half of the ocean is also a collection of water.

Quote:
As for where I got it, it would be basic experience
Non-admissable.
__________________
Reply With Quote
  #19  
Old 03-16-2005, 05:13 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
How do you test the third criterion? Anything can be added to another script.
If you see it and it is currently in another script, or meant to be, then it is.
Quote:
Also, it is entirely possible to achieve fairly complicated effects without explicitly trapping any events. If I wrote some code to do so, would it not be a script?
Never saw such a script, didn't know you could do anything without a flag.
Quote:
Lastly, you are saying that there's no such thing as a malfunctioning script?
I don't consider it a script, just some text meant to be a script. Until fixed, I don't consider it one. If you ask for a type of script from someone, you would think that it is meant to work, right?
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #20  
Old 03-16-2005, 05:50 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
If you see it and it is currently in another script, or meant to be, then it is.
So if I take somebody's script and then extend it, the original is no longer a script?

Quote:
Never saw such a script, didn't know you could do anything without a flag
Do not refer to them as flags. They are events.

Quote:
I don't consider it a script, just some text meant to be a script. Until fixed, I don't consider it one
Well, as I implied before, this is a definition that is specific (and probably unique) to you.
__________________
Reply With Quote
  #21  
Old 03-16-2005, 06:16 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by falco10291029
If we trust his words, it isn't illegal because it's only showing how to do it and he tried already.
Do you not understand the relevant rules?

Quote:
Originally Posted by the rules
1) Don't post here just asking for scripts, or asking for people to fix scripts that are beyond your skill level. The posters here aren't just some handy resource for scripting shortcuts. If you can't script something then don't try to produce it. If you're trying to make it to aid your learning then set your sights lower. If you want it for a server then go hire a scripter.

2) Likewise, don't post whole scripts for people. Post wordy solutions, certainly, but not things that people can just copy & paste into their levels without any effort.
Ba-da-boom.
Reply With Quote
  #22  
Old 03-16-2005, 06:56 AM
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
Hrm... For the projectiles, I have a problem with GS2. When I use the shoot command, although it works in GS, it doesn't in GS2. Is that a bug, or they did something to it?
Reply With Quote
  #23  
Old 03-16-2005, 02:37 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
Hrm... For the projectiles, I have a problem with GS2. When I use the shoot command, although it works in GS, it doesn't in GS2. Is that a bug, or they did something to it?
What exactly isn't working? Is it not firing the projectile? Are the events not being called?
__________________
Liek omigosh.

Reply With Quote
  #24  
Old 03-16-2005, 08:46 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 Velox Cruentus
Hrm... For the projectiles, I have a problem with GS2. When I use the shoot command, although it works in GS, it doesn't in GS2. Is that a bug, or they did something to it?
perhaps you are shooting a gani with a gani script?

it seems like playerenters often isnt called clientside in the v3.1 client on gani scripts/putnpc2s
__________________

Reply With Quote
  #25  
Old 03-16-2005, 10:50 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
So if I take somebody's script and then extend it, the original is no longer a script?
They are two seperate scripts.

Quote:
Do not refer to them as flags. They are events.
They are also flags, it doesn't really matter.
Quote:
Well, as I implied before, this is a definition that is specific (and probably unique) to you.
Of course,but I doubt there is an official definition, so any definition will be originally specific to someone.

Quote:
Originally Posted by Lance
Do you not understand the relevant rules?
WHat I gave couldn't be copypasted and work with his full script. I gave a universal example that wouldn't work (unless the person knew the commands and how to change the rest of the script to work with it, in which case they wouldn't ask for it anyway) by itself.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #26  
Old 03-16-2005, 10:56 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
They are two seperate scripts
Then the original is still a script, despite being part of another script?

Quote:
They are also flags, it doesn't really matter
They are a special type of flag. It matters because your terminology is at best ambiguous and at worst misleading.

Quote:
Of course,but I doubt there is an official definition
A script is simply a set of instructions to be executed by some interpreter. That's the definition.
__________________
Reply With Quote
  #27  
Old 03-18-2005, 02:00 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
Then the original is still a script, despite being part of another script?
You know what, I'll giv eup on this i really don't consider that to be in my def of a script i just wanted to justify my actions ;-P.

Quote:
They are a special type of flag. It matters because your terminology is at best ambiguous and at worst misleading.
Well I know what I mean when using it, sorry for misleading you all then.

Quote:
A script is simply a set of instructions to be executed by some interpreter. That's the definition.
By this definiton if I put this text here in an npc and it didn't do anything (it wouldn't) it'd still be a script and i couldn't post it here. Also by your definition one can't post the use of a comamnd, since it might be copy and pasted.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #28  
Old 03-18-2005, 02:15 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
By this definiton if I put this text here in an npc and it didn't do anything (it wouldn't) it'd still be a script and i couldn't post it here
There is no rule saying that you cannot post scripts.

Quote:
Also by your definition one can't post the use of a comamnd, since it might be copy and pasted.
You are misinterpreting the term 'whole script'. Still, perhaps it is an area in which the rules should be clarified.
__________________
Reply With Quote
  #29  
Old 03-18-2005, 02:32 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
There is no rule saying that you cannot post scripts.
It says no posting full scripts. The question is where does an example end and a full script begin?
Quote:
Still, perhaps it is an area in which the rules should be clarified.
Agreed
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #30  
Old 03-18-2005, 02:43 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
It says no posting full scripts
No it doesn't.

Besides, the text that we're typing isn't meant to be executed by any particular interpreter, so it's not a script.
__________________
Reply With Quote
  #31  
Old 03-18-2005, 03:07 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
No it doesn't.

Besides, the text that we're typing isn't meant to be executed by any particular interpreter, so it's not a script.
Quote:
Originally Posted by Lance
Likewise, don't post whole scripts for people

Full and whole mean the same thing basically right?
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #32  
Old 03-18-2005, 03:14 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
Full and whole mean the same thing basically right?
Yes. But there's context here that you're ignoring. First note that the rule in question is given directly after one that prohibits asking for scripts. Then note the word 'Likewise'.

Anyway, I already said that they could benefit from clarification, though I do not think they are particularly ambiguous at present. You'd pretty much need to be trying to misinterpret them.
__________________
Reply With Quote
  #33  
Old 03-18-2005, 05:04 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
Yes. But there's context here that you're ignoring. First note that the rule in question is given directly after one that prohibits asking for scripts. Then note the word 'Likewise'.

Anyway, I already said that they could benefit from clarification, though I do not think they are particularly ambiguous at present. You'd pretty much need to be trying to misinterpret them.
No, I am just confused at how far of an extent they go to. I know I tried giving a universal example for recieving a projectile, one that would need to be edited to be used, but apparently that isn't allowed, so I am not sure what is.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #34  
Old 03-18-2005, 05:56 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
I know I tried giving a universal example for recieving a projectile, one that would need to be edited to be used, but apparently that isn't allowed
What makes you think so?
__________________
Reply With Quote
  #35  
Old 03-19-2005, 12:07 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by falco10291029
No, I am just confused at how far of an extent they go to. I know I tried giving a universal example for recieving a projectile, one that would need to be edited to be used, but apparently that isn't allowed, so I am not sure what is.
No, you didn't. He posted: "do you think you can like make the part when it gets recived by like a player or a baddy they lose 1 hp."

You proceeded to post a script that did just that.

That is against the rules, as has already been indicated.
Reply With Quote
  #36  
Old 03-19-2005, 01:19 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Originally Posted by Lance
No, you didn't. He posted: "do you think you can like make the part when it gets recived by like a player or a baddy they lose 1 hp."

You proceeded to post a script that did just that.

That is against the rules, as has already been indicated.
Alright, universal example with playerhearts-=1 added.....

Quote:
Originally Posted by Kaimetsu
What makes you think so?
I made one that got deleted.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
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 04:20 AM.


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