PDA

View Full Version : wiki.graal.net/


killerogue
08-31-2006, 04:33 PM
Is it just me? Or is http://wiki.graal.net not working for anyone? As when I try it it says "No Page". :[ I need to get on the wiki.

Spark910
08-31-2006, 04:47 PM
Hmm yea (you spelt it wrong in your post, but it appears to be down).

KuJi
08-31-2006, 04:52 PM
mysql error, happened to the forums last night.

Darlene159
08-31-2006, 05:03 PM
Hmm yea (you spelt it wrong in your post, but it appears to be down).Fixed.

killerogue
08-31-2006, 05:16 PM
Ah, thank you Darlene. And sorry bout that Spark. :p

excaliber7388
08-31-2006, 06:04 PM
http://wiki.graal.us/Main_Page
Has the same general content, if you need anything untill the bible is back up (I check it often).
Although it's unofficial...

excaliber7388
09-07-2006, 06:26 PM
I think something is still wrong, I can't save any changes, it just goes to the preview, and nothing happens, no matter how many times I hit save page x_X

Elk
09-07-2006, 07:19 PM
works forme

excaliber7388
09-07-2006, 08:02 PM
Nope, still can't
Could this be caused by a slow connection?
Or the page being to large?
Here it is:

http://img208.imageshack.us/img208/7503/darkrivalnamething5gd.png

[[Image:dr-ss.png|thumb|center|175px]]
Dark Rival is an rpg style server with an epic, three part storyline, huge quests, and a huge world to explore. Everything from questing, leveling, training with a certain weapon to become better with that specific weapon, tons of weapons , swords, skills, and spells, a combat system involving multiple attacks and blocks, and so much more.


== '''News:''' ==
[[Image:events_out.png|thumb|left|150px]]

Dark Rival recently changed quite a bit. We have now switched to a new overworld, new rpg system, new weapons, and more. Also, the DR computer has been finished and is quite usefull. Look foward to new baddies, huge quests, and a growing overworld!

== '''About:''' ==


Dark Rival first went online July 27th 2005. From there it grew from having around 400 levels to well over 1000 now, and it's STILL growing! Dark Rival remains to be one of the fastest growing servers around! Dark Rival also has some of the most unique elements, including a storyline, weapons, and the general feel that Dark Rival brings to Graal. RPG elements will also soon be added, in the prequel and sequel, as well as weapon skills in the current game. DR offers plenty of jobs, skills, quests, and mysteries for the player to solve. It plays like a classic server, but is much more complex. Dark Rival will continue to grow, hopefully, you can be a part of it!
[[Image:pic_darkrivalgui.png|thumb|center|175px]]
[[Image:darkrival_wiki.png|thumb|center|175px]]

== '''Story:''' ==


Dark Rival is basically a three part story, played out on three different overworlds. So far, only one of these overworlds is near completion, and will soon be replaced by an even larger overworld. This is actually the middle part of the story. You play as yourself in the first part, taking over for a hero who has disapeared. Then you enter a flashback, and play as the old hero, finding out more about the plot. Finally, you team up to defeat the 'Dark Rival' in the final part, introducing new ways of playing graal. After that, it's up to the players to see what direction Dark Rival will go in, as they have to 'rebuild' the world after Ceverous (the Dark Rival) is defeated, and there will be a power struggle for control of the world, as 2 nations fight for control. It's going to be a very realistic, time and player based server, and I hope you can be a part of it!

== '''Play Now:''' ==


Follow this link to play Dark Rival now!

Join in on the action!

graal://Dark Rival
*note, you sill have to type in Dark Rival in the box, this feature has been disabled in the newest versions of graal.

== '''Website:''' ==


http://darkrivalonline.tripod.com

'''Staff application (we need LATs NATs and GATs):'''
We are rebuilding the website, for now, simpley email [email protected],com your account, nick, skills, past exp, what position you want, and at least 2 examples of your work.

== '''Jobs:''' ==


'''Fishing'''
-fish using two different rods to earn money.
[[Image:fishing_pic.png|thumb|left|150px]]

'''Mining'''
-mine up loose rock, then search through the piles to find minerals
[[Image:pic_mining.png|thumb|left|150px]]

'''Shoveling'''
-search the ground for money, this can only be done on soft grass
[[Image:shoveling_pic.png|thumb|right|150px]]






'''Wood Chopping'''
-Help an elderly man build his lodge by chopping and delivering wood to him from the local area.
[[Image:wood.gif|thumb|left|150px]]

'''Soon to come'''

-Fighting

-Gardening

-Bounty Hunting






== '''Current staff:''' ==
Admins:

Excaliber, Excaliber7388 (Owner): [email protected]

Shad, xshadx (Manager)

== '''Hiring!''' ==

We are hiring LATs, NATs, GATs, Events, and Gps. We also could use someone who can convert normal levels into gmap format.
::LATs::

LATs, (Level Administration Team) would be responsible for the uploading, maintnence, and developement of levels. Currently, we are making a new overworld, so much of the work would go to making a unique world.

NATs, (NPC Administration Team) would be responsible for the uploading, maintnence, and creation of new and exciting scripts and NPCS. Dark Rival has many weapons, and unique systems, and the NAT's input is greatly appreciated.

GATs, (GFX Administration Team) would be responsibe for the uploading, maintnence, and creation of new, unique graphics.


== '''How to become a good staff member'''==
ALWAYS practice your skills. If yo're an LAT, look at levels other players have made the Graal forums, [http://forums.graalonline.com]is a great place to do this.
The forums aren't just good for LATs, however, they provide help on scripting, ganis, and gfx. It's a great place to learn, and become a part of the Graal community. I suggest to all current DR staff, and to all potential staff, to take advantage of the forums, Graal Bible, and any other resources they can find to become better developers. If you want to become an Events Team member, or a GP, I suggest asking other Events/GPs on multiple servers about their jobs, what they have to do, and how they became staff. Play on the server a lot, follow all the rules on that server, and play events. Really, this goes for all possitions as well. Get to know the server before you apply. Dark Rival, and the rest of Graal for that matter, is always looking for more developers, and more staff. It's not to hard to learn, so get a jump on it now! I hope to see you as staff on Dark Rival in the future!
-Excaliber Owner/Creator of Dark Rival

excaliber7388
09-07-2006, 08:09 PM
== '''Excaliber's Scripting Guide''' ==
I'm hoping this allows people to learn how to script a bit easier, I believe all staff should know some scripting basics, and I find other GS2 guides hard to follow.

Starting:

Level NPCs:

A level NPC is an npc that functions in a specific level. These are the most common on most servers. They are also a very important part of developement.

A script:
<pre>
//this is a note
/*

this is also a note, these help make scripts more clear
this type of note can go on as longe as it's inclosed
*/
//#CLIENTSIDE
//This tells the computer that the following
//script will be on the players client,
//as opposed to the server, this is very important.
function onPlayertouchesme()
//this checks if the player has touched the NPC
{ // starting bracket
message("Hey!"); //displays a message above the NPC
}//closing bracket
</pre>
The above script checks to see if the event, playertouchsme is true, then acts on what is in the bracket. It is important to include this clientside, because too many serverside scripts can cause problems for an NPC server, however thay are more secure. If you wanted to do the last script serverside, you would omit the //#CLIENTSIDE , and add the shape to the NPC:
<pre>
function onCreated()
{
setshape(1,32,32);
setimg("block.png");
//img can also be done in the box above the script
}
function onPlayertouchsme()
{
message("You made a serverside script!");
}
</pre>
This takes a bit longer than clientside commands, and it takes up serverside script time, however, for secure actions, it may be necessary.
A secure script example:
<pre>
function onCreated()
{
this.account="Excaliber7388";
setshape 1,32,32;
chat="Excaliber's Chest";
}
function onPlayertouchsme()
{
if(player.account==this.account)
{
chat="This is a secure message!";
}
}
</pre>
First, I would like to quickly point out the 'if' statement. Some guides go into this a lot, but it's actually quite simple. The if statement is a very important part of scripting. It's what allows the NPC to make choices. The code withing the brackests of an if statement will only execute if the statement is true. Also, there is a catchall statement you can use, else. If the if statement is not true, the else will exectue it's script, other wise it is ignored.
Example:
<pre>
//#CLIENTSIDE
function onCreated()
{
this.a=1;
}
if(this.a==1)
//always use '==' for comparasons, NEVER just '=' as '=' is for assignments
{
this.b=2;
}
else if(this.a==2) //will only execute if first is false, AND this.a==2
{
this.b=3;
}
else //catch all if above 2 statements are false
{
this.b=4;
}
</pre>
Now, in the above example, this.b will always be 2, however, it's the format that's important.
<pre>
if(statement)
else if(statement)
else if(statement //may be used many times
else //catch all
</pre>
Now, back to serverside and clientside scripts:
By putting the checks on serverside, you disable a hackers ability to send an action from their client. So, this script is much more secure, and can only be accessed by the specified account (Excaliber7388 in this case). Dark Rival does these checks serverside as well, but we also apply a different method, to avoid having too much serverside script time:
<pre>
function onCreated()
{
this.account="Excaliber7388";
setshape 1,32,32;
chat="Excaliber's Chest";
}
function onActiontouched()
{
if(player.account==this.account)
{
chat="Yup, this is still secure, yay!";
}
}
//#CLIENTSIDE
function onPlayertouchsme()
{
triggeraction(x,y,"Touched","Touched";//no params needed
}
</pre>
This script will take up more time, but the playertouchsme check is clientside. Would this help much? Probably not, in fact, sending the action in this case would probably create more lag than having the script serverside. However, if a large portion of the script is serverside, and can be moved to clientside without risking security, it may be a good idea.
Serverisde timeouts=bad idea.
You shouldn't send to many actions to serverside, especially if you do so quickly. You should always limit the serverside timeouts, and the amount of time between actions to the server from client should be spaced out. Also, you should never have a timeout shorter than .05 on serverside, though it is possible, please do not do it. Dark Rival has had problems in the ast regarding serverside loops, however these have ben fixed.
Here are two examples of serverside scripts, the first it VERY bad, the second is more productive:
<pre>
function onCreated()
{
setshape 1,32,32;
}
function onActiontime()
{
for(server.i=0;server.i<5;server.i++)
//WHY use server for this???
//for loops, use this. it works only for this NPC
{
sleep(.01);
//WAY to short of a sleep time for the server
}
server.time+=.1;
}
//#CLIENTSIDE
function onCreated()
{
settimer(.05); //minimum clientside timeout
}
function onTimeout()
{
trigegraction(x,y,"time","time");
settimer(.05);
//will cause a loop through the timeout, sending action
//to serverside TOO quickly, AND while the server is
//still working on the last action. This WILL cause the
//server to crash.
}
</pre>
If you put the above script on a server, say goodbye to your NPC server, because it will crach pretty quickly!
A better version:
<pre>function onCreated()
{
setshape 1,32,32;
//setshape is needed for all level NPCs triggeractions
//this setsit to a square of tiles 32 pix by 32 pix
}
function onActiontime()
{
server.time++;
//no need for incredible accuracy
}
//#CLIENTSIDE
function onCreated()
{
settimer(1);
}
function onTimeout()
{
triggeraction(x,y,"time","time");
settimer(1);
}
</pre>
This will execute the script less often, however, it still is an unlimited loop. Don't have too many of these NPCs, or you could have problems!

Now, you may have noticed this line in the bad script:
<pre>
for(server.i=0;server.i<5;server.i++)
</pre>
This is a 'for' loop. There are many types of loops, however the foor loop isn't the easiers to learn first. Therefore, I will show you the 'while loop' first.
The while loop executes whatever is held within it's brackets as lond as the statement within it is true. The while loop is just like an if statement, but you cannot use else with a with statement.
format:
<pre>
wile(statments)
{
//commands
}
//if statment is still true, it will loop
</pre>
here's a script example:
<pre>
//#CLIENTSIDE
function onCreated()
{
this.size=10;
}
while(this.size<=20) //while this.size is less than or equal to 20
{
chat="The fish was " @[email protected] " centimeters long!";
//as the story is retold....
sleep(.5);
this.size=this.size+1;
//increment the size
}
</pre>
The above script will run through the loop until this.size is equal or greater than 20.
Some important things to know:
<pre>
if(a==b) means if a is equal to b
if(a<b) means if a is less than b
if(a>b) means if a is greater than b
if(a<=b) means if a is less than or equal to be
if(a>=b) means if a is greater than or equal to be
a++ is the same as a=a+1
a-- is the same as a=a-1
a+=b means a=a+b
a-=b means a=a-b
a*=b means a=a*b (multiplied by b)
a/=b means a=a/b
++a is just like a, but it will add to a before anything else in the line,
this is not important to know now
--a just like ++a, but with subtraction
a%b Modulus, basically, its a/b and th remainder is the output
for example 10%3=1
</pre>
These may be helpfull in loops, or in any other rational expressions you may use. (Well, it's important for all scripting!)
Now, recall this line:
<pre>
chat="The fish was " @[email protected] " centimeters long!";
</pre>
The output for this is: The fish was (size here) centimeters long!
The script NEEDS to know where a variable is, so if you want to put it in between a string you surround it with the '@' symbol. Or if it's at the end, you only put the '@' at the beggining of the variable. The variable and the '@' do NOT go in the quotes. Example:
<pre>
//#CLIENTSIDE
function onPlayertouchsme()
{
chat="Well hi there, " @[email protected] " I like your sword, " @player.swordimg;
}
</pre>
This would display the player's account, and sword image.

Now, back to the 'for' loop.
This a very interesting loop it's format is as follows:
<pre>
for(command;expression;command)
{
}
</pre>
Here's an example:
<pre>
//#CLIENTSIDE
function onPlayertouchsme()
{
for(this.i=0;this.i<10;this.i++)
{
chat="Loops: " @this.i;
sleep(.5);
}
}
</pre>
This loop would be activated when the player touchs it.
It would go through 10 loops, displaying the count, and taking .5 seconds for each loop (due to the sleep() command)
Now remember this while loop?
<pre>
function onCreated()
{
this.size=10;
}
while(this.size<=20)
{
chat="The fish was " @[email protected] " centimeters long!";
//as the story is retold....
sleep(.5);
this.size=this.size+1;
//increment the size
}
</pre>
There's an easier way of doing it with a for loop, in fact all loops done with wile can be replaced by for.
<pre>
for(this.size=10;this.size<=20;this.size++)
{
chat="The fish was " @[email protected] " centimeters long!";
sleep(.5);
}
</pre>
See? Much shorter and easier to use!
Once you know the format of a for loop, you can make longer and more complex loops as well, and they'll take less time to script, which is always a bonus.

excaliber7388
09-07-2006, 08:10 PM
Some more detail on actions:
An action is an effective way to use a portion of script more than once, have one script act on another script, more script to serverside from clientside (and the other way) and more.
So how do you use them? Here's the format:
<pre>
triggeraction(x,y,"params[0]","params[1]");
</pre>
You must have two parameters, but you can have as many as you want a quick example:
<pre>
function onCreated()
{
setshape 1,32,32;
}
function onActiontrigger()
{
player.chat="Account: " @params[1]@ " Sword " @params[2]@ " head: " @params[3];
}
//#CLIENTSIDE
function onPlayerchats()
{
if(player.chat=="Who am I?") //amnesia? multiple identities?
{
triggeraction(x,y,"trigger",player.account,player.swordimg,player.headimg);
}
}
</pre>
See? You can make more than one parameter.
Now, there are a few differences between a level NPC with a triggeraction, and a weapon with a triggeraction. Weapons need their location (serverside or clientside) as the first parameter, params[0] is the one after it. Here, you can have just one parameter, and the x and y is always 0 (because the npc server is at 0,0), and you need to include the name of the weapon in the action.
here's an example:
<pre>
//weapon script with a triggeraction
//Weapon name: Fire Ball
function onActionserverside()
{
if(params[0]=="mp")
{
playermp-=10
}
}
//#CLIENTSIDE
function onWeaponfired()
{
if(playermp>=10)
{
shootfireball(playerdir);
triggeraction(0,0,"serverside","Fireball","mp");
}
else
{
player.chat="Not enough mp!";
}
}
</pre>
This nifty little weapon will cost 10 mp per use, and fires a fireball in the direction the player is facing. Hopefully, you can learn to make many weapons of your own!
Triggeractions can be used in shops as well (and these are the scripts people ask for the most).
<pre>
//a shop script, yay!
function onCreated()
{
setshape 1,32,32;
}
function onActionbuy()
{
if(playerrupees>=100)
{
addweapon Fire Ball;
playerrupees-=100;
}
}
//#CLIENTSIDE
function onPlayerchats()
{
if(player.chat=="buy fire ball")
{
triggeraction(x,y,"buy","buy");
//the level npc triggeraction type
}
}
</pre>
There, now you can make a little shop that sells a Fire Ball weapon. Have fun with it, search the commands, there's plenty of easy weapons you can make, and the weapon script is easy to follow and modify as well. Hopefully, you know enough about parameters to make more than one weapon for sale in the same NPC, just make the weapon name part of the action, then check for that parameter before they can buy.
Now there are other types of loops. One I commonly see is a timeout loop. You should understand why. Back with GS1, it was a bit easier to tell what was happening in the script. In GS1 the script for function onTimeout() would be displayed as if(timeout). It was a bit easier to tell that when a timeout was done, it set a flag that if(timeout) would check. function onTimeout does the same thing, however, for new users this may be harder to tell. here's an example of an NPC that uses a timeout loop:
<pre>
//#CLIENTSIDE
function onCreated()
{
settimer(1);
}
function onTimeout()
{
player.chat="Counter: " @this.time;
this.time++;
settimer(1);
//after 1 second, the timeout loop will restart
}
</pre>
This would cause the player to count up every second.
You may have noticed that the variables often start of with client. or this. There are actually a few prefixes, each does a different thing:
<pre>
client. variable is saved to the client, it can be modified on the clientside or serverside, and read from either.
clientr. variables can be rad from server or clientside, but only written from serverside. This is more secure, but only if you use it right.
server. variables are saved to the server, can only be written on the serverside, read on either side
serverr. more secure version of server. read only on clientside
this. is a variable that only functions in the NPC it is in. This prevents NPCs from morifying each others variables
temp. only exists in between the brackets of a function
</pre>
To use scripts effectivly, you should know how to use each of these.
I will add more over time.

Some important commands can be found here:
page:http://wiki.graal.net/index.php/Creation/Dev/Script/Starting_Guide#Introduction
Which is also helpful for learning how to script. Enjoy!

--[[User:Excaliber7388|Excaliber7388]] 00:13, 8 May 2006 (CEST)

killerogue
09-07-2006, 09:11 PM
It just doesn't show for me and I have no clue why.

KuJi
09-07-2006, 09:18 PM
Excaliber - why do you mix GS2 with GS1 in that guide?

Aswell as you using chat = "Blah"; and then sometimes using message("Blah");

You should pick one way =o

excaliber7388
09-07-2006, 09:20 PM
Excaliber - why do you mix GS2 with GS1 in that guide?

Aswell as you using chat = "Blah"; and then sometimes using message("Blah");

You should pick one way =o
Yeah, I have to fix it, but I can't save the page x_X

killerogue
09-07-2006, 09:33 PM
I can't access the wiki. WTF?

Skyld
09-07-2006, 09:41 PM
Yeah, I have to fix it, but I can't save the page x_X
You should, uh, put scripting help into the scripting section of the Wiki, not into your own personal page.

excaliber7388
09-07-2006, 09:50 PM
You should, uh, put scripting help into the scripting section of the Wiki, not into your own personal page.
Also true ;)

Admins
09-09-2006, 05:34 PM
It is true that the wiki is not working right now, you cannot submit additions or modifications. It should hopefully be fixed in a few days.