PDA

View Full Version : Graal Scripting Tutorial


CyrisMustang
01-29-2010, 11:49 AM
I've been looking for Graal Scripting Tutorials ever since Graal 2002, and never have I found anything more than the Newbie Scripter's Bible (which was last updated in... 2002). Ever since then I've pretty much only fiddled with clientside stuff on my own. I realize now how unfriendly it must be to people who want to script and I want to help because there are so few resources left out there for Graal, especially now with GS2.

Would anybody like to help me compile a more comprehensive Graal Tutorial, that details in-depth knowledge of NPC scripting, level editing, gani animation, and other stuff?

Here's some of what I have completed right now. I'd love people to correct errors and mistakes or contribute.

http://eoegaming.com/GraalProgramming.doc

Nalin
01-29-2010, 04:10 PM
You could always use npcprogramming.doc. It is pretty decent.

CyrisMustang
01-29-2010, 04:55 PM
npcprogramming.doc is good, but there are a lot of things it doesn't tell you. I want to make something better.

Basically I'm trying to make something that encompasses everything, kind of like a mini-textbook. I'm sure there's a lot of people who come and ask "how 2 program 4 fish" and chase them off with pitchforms and torches, but I want to make something that would answer any question about Graal.

Unfortunately I don't know everything, so I'd like to request some help or support on making this thing. After all, there are still some things I don't grasp well, like join or many of the server-side exclusive commands.

Beholder
01-29-2010, 05:13 PM
People ask me what I did to learn how to script, the answer?
Trial and Error. (And have them throw a hissy fit saying that it's "f**king impossible")

Playing around with the code, learning what it means, how it works, and eventually how it can be twisted to your whims. If you have the ability to see patterns, solve puzzles, while generally being logical and knowing English, you will do fine with self-practice.

Shiny
01-29-2010, 05:26 PM
newfeaturesxxxx.txt are good at explaining just about every single feature added to Graal in pretty good depth. This is good once you get the hang of things and want to learn new functions/events. In fact, I think it's far from a boring read because of all the detail put into it. For example, it explains the shoot function, but not only explains how to use it, but the physics/math that projectiles use(in detail enough that I was able to replicate the code and make my own 'realistic' projectiles at like, age 14). Also explains the formulas behind AP and spar ratings as well, I think.

Before GS2(and documentation started sucking ass) hit main Graal you couldn't ask for scripting help on the main forums before being directed to newfeaturesxxxx.txt

CyrisMustang
01-29-2010, 05:30 PM
Well, the main concept for this project is to help others learn as well. However, if this is project seems unnecessary or ineffective, then I apologize.

Downsider
01-29-2010, 05:39 PM
if (plauerenterz) {
set the pleyrs' name to bob
give the pleyr a lot o money
}

if (palyer touches me ) {
give the player a gun
}

Beholder
01-29-2010, 05:39 PM
Well, the main concept for this project is to help others learn as well. However, if this is project seems unnecessary or ineffective, then I apologize.

No no it's fine.
Its just, difficult to teach someone "logic" when they expect it to be just handed to them. o_o
They have to earn it, a tutorial could help, but they still have to understand it will take some work and things will not always go as planned. :P

CyrisMustang
01-29-2010, 05:46 PM
I understand. Since I'm still a student, I usually like having lots of documentation to read up on to make sure that I'm doing the right thing. Even in Graal, I had so much trouble with learning callnpc because there was absolutely no information back then on how Graal indexed NPCs and there were no examples for the longest time (until I discovered Graal Reborn, thank goodness).

I think if we included examples in the method's page, it would be a lot more helpful to everybody, especially with the less recognized and more advanced commands.

SeraphX
01-29-2010, 06:30 PM
if (plauerenterz) {
set the pleyrs' name to bob
give the pleyr a lot o money
}

if (palyer touches me ) {
give the player a gun
}

gave me errors

Spooon
01-29-2010, 09:31 PM
There is a thread already. Lemme find it.

___Merged doublepost__________________

http://forums.graal.in/forums/showthread.php?t=1166

It's even stickied. >:|

CyrisMustang
01-29-2010, 10:09 PM
There is a thread already. Lemme find it.

___Merged doublepost__________________

It's even stickied. >:|

That is simply the commands.rtf. Beholder revealed things within that thread (i.e. drawovertrees, spyfire), proving that there are things that have not been documented well enough yet or at all (I am still struggling to figure out the validity of copyflagss).

I think everyone misunderstands what my project is. I am not trying to put together an elementary guide. I am trying to make a comprehensive guide leaving as little room as possible for confusion. It's like the difference between an dictionary and an encyclopedia.

For example, when you read the comment for triggeraction, does it tell you the level of tolerance for the trigger area? Does it tell you what layers the draw commands operate on? Does it explain how players and arrows are indexed? Does it tell people how bitflags work in order to hide multiple options of showstats?

I am in no way putting down Cadavre, I have great respect for all the developers in this community. However, these are all questions that you know the answers to, and can answer. It's easy for you to say "Lol I know this it should be basic knowledge". However, I don't think everyone can use the beautifully compiled commands.rtf to get the answers to those questions. I want to answer those questions and provide a better understanding of what each command offers. It's hard to completely describe a command with one line. That's why npcprogramming.doc is so helpful. I'm trying to expand the more recent one, and produce an even more complete programming guide.

I'm sorry if I passed off as rude, no offense was intended.

Downsider
01-29-2010, 10:23 PM
I was going to say something witty about how you made a thread saying you didn't understand a certain concept of Graal and/or only fiddled with Graal in the first post yet wanted to make a comprehensive, in-depth guide, but then I clicked the link and saw that it was actually a well-done tutorial with PICtURESZ!!11

Spooon
01-29-2010, 10:37 PM
That is simply the commands.rtf. Beholder revealed things within that thread (i.e. drawovertrees, spyfire), proving that there are things that have not been documented well enough yet or at all (I am still struggling to figure out the validity of copyflagss).

I think everyone misunderstands what my project is. I am not trying to put together an elementary guide. I am trying to make a comprehensive guide leaving as little room as possible for confusion. It's like the difference between an dictionary and an encyclopedia.

For example, when you read the comment for triggeraction, does it tell you the level of tolerance for the trigger area? Does it tell you what layers the draw commands operate on? Does it explain how players and arrows are indexed? Does it tell people how bitflags work in order to hide multiple options of showstats?

I am in no way putting down Cadavre, I have great respect for all the developers in this community. However, these are all questions that you know the answers to, and can answer. It's easy for you to say "Lol I know this it should be basic knowledge". However, I don't think everyone can use the beautifully compiled commands.rtf to get the answers to those questions. I want to answer those questions and provide a better understanding of what each command offers. It's hard to completely describe a command with one line. That's why npcprogramming.doc is so helpful. I'm trying to expand the more recent one, and produce an even more complete programming guide.

I'm sorry if I passed off as rude, no offense was intended.

I said 'drawovertrees;', not Beholder.

CyrisMustang
01-29-2010, 10:40 PM
I said 'drawovertrees;', not Beholder.
I apologize.

I was going to say something witty about how you made a thread saying you didn't understand a certain concept of Graal and/or only fiddled with Graal in the first post yet wanted to make a comprehensive, in-depth guide, but then I clicked the link and saw that it was actually a well-done tutorial with PICtURESZ!!11
I wanted to call upon you guys to help. I know little to nothing about server-side stuff, and you guys have probably been inside the source code of Graal to make sure that all the stuff I have is correct.

Spooon
01-29-2010, 10:42 PM
We don't use server-side scripts because we don't have a NPC-Server. I don't know what you are asking for. If you know the commands you should get an idea of what you need to do. If you need help with a certain part of a script someone on here should be able to help you.

CyrisMustang
01-29-2010, 10:48 PM
We don't use server-side scripts because we don't have a NPC-Server. I don't know what you are asking for. If you know the commands you should get an idea of what you need to do. If you need help with a certain part of a script someone on here should be able to help you.
Essentially, I am looking for people to help me create a very in-depth tutorial for Graal.

Nalin
01-30-2010, 12:33 AM
Essentially, I am looking for people to help me create a very in-depth tutorial for Graal.
I have attached some of the npc-server documentation I have. Instead of asking for help in general, you should probably ask for specific help on specific commands. It would be more productive than what you are currently doing. Trust me on this.

Start with the commands.rtf on these forums. It has been updated to contain virtually every single clientside scripting command. I really doubt there are any missing commands; if there are, let me know so I can update it again. Build off of that. If you need help with a specific command, ask us here.

I personally wouldn't bother with the serverside commands right now. We don't have a working npc-server. Plus, if we did get a working npc-server, we wouldn't use GS1 for scripting.

CyrisMustang
01-30-2010, 12:37 AM
Thanks a lot for that documentation, it looks like it will help a lot. My general plan was to just write on everything in commands.rtf, but perhaps I'll omit some server-side stuff. I'll keep the requests in mind, and thanks for the help.