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 10-16-2004, 05:52 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Do you want to learn how to script?

Hey people!

Im working in a Script guide. Since graal people level scripting is worse we can see that walking around the playerworlds. I know there are many people that want to learn how to script, so I started this document. Its just the beta version, I hope have the final version soon.

This script guide is for who wants to start learing Graal Script. In the next versions until the final we will see more about Npc Server and we will learn how to map our scripts to Graal 3.0 script engine.

I know that probably the guide have some english mistakes, since English is my 3rd language. So if you find any english mistake, or any kind of problem, send me by mail to me fix to the next version:
[email protected]

Please use this post just to post questions or write a feedback, use the e-mail to report any errors to let this post clear.

Thank you

Amon-Ra
^_^

Ps. If you cant see the file, you can download Acrobat Reader here
Attached Files
File Type: pdf GScript_guide_beta0.5_part1.pdf (903.0 KB, 1615 views)
File Type: pdf GScript_guide_beta0.5_part2.pdf (624.1 KB, 1707 views)
Reply With Quote
  #2  
Old 10-16-2004, 06:10 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Woah, I'll be sure to read
__________________
Reply With Quote
  #3  
Old 10-16-2004, 07:02 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
KSI-GS, yo.
__________________
Reply With Quote
  #4  
Old 10-16-2004, 08:10 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
on the devide..

you've done "variable2 = variable2/2;" and you've said the answer is "1.25"

You hadn't assigned variable2 to anything :O.. I think?
Unless it's suppose to be "variable2 = variable1/2;" because variable1 = 2.50?

:o (i don't know if this is wrong or right)
__________________
Reply With Quote
  #5  
Old 10-17-2004, 03:01 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by xAndrewx
on the devide..

you've done "variable2 = variable2/2;" and you've said the answer is "1.25"

You hadn't assigned variable2 to anything :O.. I think?
Unless it's suppose to be "variable2 = variable1/2;" because variable1 = 2.50?

:o (i don't know if this is wrong or right)

Yes =) You are right. I will fixed that to the next version.

The right way is:

Variable1 = (10/2)/2;
Variable2 = Variable1/2;


Variable1 is 2.5 and Variable2 is 1.25

Reply With Quote
  #6  
Old 10-17-2004, 03:05 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Nice.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 10-17-2004, 04:17 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
I want to learn how to make my scripts work online
__________________
Reply With Quote
  #8  
Old 10-17-2004, 07:17 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Googi
I want to learn how to make my scripts work online
This usually fixes most peoples problems between offline and online scripts:
PHP Code:
//#CLIENTSIDE 
Reply With Quote
  #9  
Old 10-17-2004, 11:06 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Wow, those tutorials are awesome!

I'm going to base my scripting off them

Nicely done
__________________
Reply With Quote
  #10  
Old 10-17-2004, 01:03 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Slash-P2P
This usually fixes most peoples problems between offline and online scripts:
PHP Code:
//#CLIENTSIDE 
Not really.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #11  
Old 10-17-2004, 02:35 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by Googi
I want to learn how to make my scripts work online
I didnt make the Npc Server part yet, Im working on it. But you will use basicly the same things you see in the done part. So try out alot offline. Well the scripts you test offline will work if you comment "#CLIENTSIDE" at the first line:
//#CLIENTSIDE

There are many details we will see later in the script guide, like make a Serversided and clientsided parts in the same script and other things. But for all that, you will need to know everything we have until now. We will see how to work with Classes, weapons, NpcServer scripts... until the new datablocks on Graal 3.0 that few people know. And other stuffs

=)
Reply With Quote
  #12  
Old 10-17-2004, 02:38 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Could you go into more detail on how to cause lagg and what not in another document?

I hope the other documents what people are producing are as good as this.
__________________
Reply With Quote
  #13  
Old 10-17-2004, 02:43 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by xAndrewx
Could you go into more detail on how to cause lagg and what not in another document?

I hope the other documents what people are producing are as good as this.
I thought about that when doing the scripts.
Thats Why I descrypted "Events " like I did.
In the begin of the script guide we dont use events. But for the half of it until the end we will always use events. So the script part will just work if the event calls the script. Basicallythis is take care of the lag on Graal. Let the script just make what it has to do when it really needs to do. You dont need a "loop" to show a message. You can show the message once, it will be there forever. Thats the idea. If you be reading the script guide you will be learning how to sript right, without lags. Im thinking about this while writing it.
We will see later what events call the script twice and why. And I will always put some tips how to not lag the script in some parts.

=)
Reply With Quote
  #14  
Old 10-17-2004, 02:56 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Aslong as you keep adding tips I think it'll be great
Thanks again!
__________________
Reply With Quote
  #15  
Old 10-17-2004, 03:15 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by xAndrewx
Could you go into more detail on how to cause lagg and what not in another document?
There is a thread in this section called "Optimization Howto", posted by Stefan. This explain quite well how to reduce lag and what causes the lag, I believe that is what you are looking for.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #16  
Old 10-17-2004, 03:53 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by osrs
There is a thread in this section called "Optimization Howto", posted by Stefan. This explain quite well how to reduce lag and what causes the lag, I believe that is what you are looking for.
http://forums.graalonline.com/forums...65&postcount=1
Reply With Quote
  #17  
Old 10-17-2004, 06:23 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
I would rather see a guide use proper techniques the whole way through. Putting commands and events outside of event blocks is just lazy and careless. I see how you're structuring it so the begining is easy to follow for everyone, but I believe some people will think that that is an acceptable format.

The overall quality of the document looks nice though. You seem to have put some real effort into it, good job. I still hate PDFs though
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #18  
Old 10-17-2004, 06:29 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally Posted by Dach
I would rather see a guide use proper techniques the whole way through. Putting commands and events outside of event blocks is just lazy and careless. I see how you're structuring it so the begining is easy to follow for everyone, but I believe some people will think that that is an acceptable format.
Yeah, something like 'This shouldn't be done but it doesn't matter because you're just learning for now' should be added.

Quote:
Originally Posted by Dach
I still hate PDFs though
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #19  
Old 10-17-2004, 06:47 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 Dach
Putting commands and events outside of event blocks is just lazy and careless
Ditto for sleeps within loops.
__________________
Reply With Quote
  #20  
Old 10-17-2004, 07:17 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Slash-P2P
I knew it?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #21  
Old 10-17-2004, 07:26 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
VERY VERY VERY VERY VERY VERY VERY VERY VERY VERY VERY NICE AMON RA!

I've always been your fan man
__________________
Reply With Quote
  #22  
Old 10-18-2004, 02:22 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by Dach
I would rather see a guide use proper techniques the whole way through. Putting commands and events outside of event blocks is just lazy and careless. I see how you're structuring it so the begining is easy to follow for everyone, but I believe some people will think that that is an acceptable format.

The overall quality of the document looks nice though. You seem to have put some real effort into it, good job. I still hate PDFs though
=)
Ya, the idea is start from beginning not forgetting anything.. So how much we will learning, we learn new things to replace the old commands we used, so until the end we will be using the right way.

Thats why we start with a simple "message". Thats never good to use directly in the script like we did. But we cant start with too much information or the reader will give up to read it. I tryed to make like I like to learn, with alot of examples and many texts to explain each thing.
Reply With Quote
  #23  
Old 10-18-2004, 08:21 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
That doesn't justify a structure like this:

NPC Code:

if(timeout){
}
timeout=blah;

__________________
Reply With Quote
  #24  
Old 10-18-2004, 01:02 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by Kaimetsu
That doesn't justify a structure like this:

NPC Code:

if(timeout){
}
timeout=blah;

I made that to show who is reading that he/she needs to set the timeout value all the time again. Because when the script is called by timeout it back to 0. I could do "created||timeout" and set the timeout value at the end, or make any other way this. But I think this way is better to understand. Be sure he/she will understand and until the end will have a good knowledge.
Anyway I attached a file that explain that better to you.

have a nice day
Attached Thumbnails
Click image for larger version

Name:	image.jpg
Views:	187
Size:	267.4 KB
ID:	29967  
Reply With Quote
  #25  
Old 10-18-2004, 06:16 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 amonrabr
I could do "created||timeout" and set the timeout value at the end, or make any other way this. But I think this way is better to understand
I think it fosters bad habits. It essentially condones an approach that should by no means be utilised. Is that ever a good thing to do?

Quote:
Anyway I attached a file that explain that better to you.
Um, the highlighted text has absolutely no relevance to what we're discussing. Leave the sass to the experts, dawg.
__________________
Reply With Quote
  #26  
Old 10-18-2004, 06:26 PM
Darlene159 Darlene159 is offline
Administrator
Darlene159's Avatar
Join Date: Aug 2001
Location: Florida
Posts: 12,470
Darlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud ofDarlene159 has much to be proud of
I am glad you did this amonra...I'm going to see if I can learn something from it
Thanks
__________________
FORUM RULES
GRAAL BIBLE (Lots of useful info)
INFO ABOUT REPUTATIONS.
INFO ABOUT INFRACTIONS.
HOW TO APPLY FOR THE NON-GRAAL RELATED FORUM (<<READ THOROUGHLY!)

SUPPORT: http://support.toonslab.com

NOTE: YOU ARE RESPONSIBLE FOR YOUR OWN POSTS.
READ>THINK>POST
Reply With Quote
  #27  
Old 10-18-2004, 07:09 PM
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
Amon-Ra, I see no problem with posting errors here unless you're afraid of criticism. This thread should exist to foster the growth and development of your document, not simply to praise you.

That aside, to those who gave advice to Googi: //#CLIENTSIDE should by no means be the end-all solution to make offline scripts work online. For example, if you want to change someone's level, that will not solve it. In other cases, making everything clientside can leave your scripts vulnerable to trainer usage and cheating.
Reply With Quote
  #28  
Old 10-18-2004, 08:30 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
This should be stickied, I WILL be refering back to this in the future.
__________________
Reply With Quote
  #29  
Old 10-18-2004, 08:44 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Quote:
Originally Posted by Lance
Amon-Ra, I see no problem with posting errors here unless you're afraid of criticism. This thread should exist to foster the growth and development of your document, not simply to praise you.
Oookey
Reply With Quote
  #30  
Old 10-20-2004, 06:58 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by amonrabr
Oookey
Please don't be a jerk to people who are providing contructive critisism. If you can't take it, please feel free to stop posting.
Reply With Quote
  #31  
Old 10-20-2004, 01:53 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally Posted by Python523
Please don't be a jerk to people who are providing contructive critisism. If you can't take it, please feel free to stop posting.
How is he being a jerk there...?
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #32  
Old 10-20-2004, 03:28 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
Quote:
Originally Posted by GoZelda
How is he being a jerk there...?
I'm assuming the 'Oookey' was read as sarcasm, rather than just agreement to the prior statements.
__________________
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
  #33  
Old 10-20-2004, 05:50 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
contructive?
__________________
Reply With Quote
  #34  
Old 10-21-2004, 08:38 AM
nullify nullify is offline
Registerd Abuser
nullify's Avatar
Join Date: May 2004
Location: The cheese state.
Posts: 851
nullify has a spectacular aura about
I haven't really looked at these, but I have lots of respect for scripters that take their personal time to write a document that will help others. Keep it up.
By the way, for a third langauge, your english is quite good. Better than some native speakers.
Reply With Quote
  #35  
Old 10-21-2004, 08:40 AM
Nidonemo Nidonemo is offline
The Random One.
Nidonemo's Avatar
Join Date: Sep 2002
Location: Where the people are a lot nicer than here.
Posts: 352
Nidonemo is on a distinguished road
Send a message via AIM to Nidonemo
Sweet! Keep up the good work! I've always wanted to learn more about scripting, I just know like a few incredibly basic things.
__________________
Aoi Kitsune...
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 12:12 AM.


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