Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Epic fail. (https://forums.graalonline.com/forums/showthread.php?t=85041)

Raelyn 04-07-2009 04:05 PM

Epic fail.
 
I am trying to learn gscript, (I fail, I know.) and I was just trying something that LOOKS like it should work, but doesn't.

NPC Code:

if (created) {
setstring player.hp,10;
sleep 2;
if (player.hp == 10){
message Roger that!;
}
if (player.hp != 10){
message Fail!;
}
}



Code produces Fail!. :/ Help?

fragman85 04-07-2009 04:11 PM

Use PHP tags please...

btw. try:

PHP Code:

//#CLIENTSIDE
if (created) {
  
player.hp 10;
  
sleep 2;
  if (
player.hp == 10){
    
message Roger that!;
  }
  else {
    
message Fail!;
  }


Not sure tho, since it's GS1...

Raelyn 04-07-2009 04:25 PM

Quote:

Originally Posted by fragman85 (Post 1481932)
Use PHP tags please...

btw. try:

PHP Code:

... 

Not sure tho, since it's GS1...

Ahh, that worked, thank you.

Codein 04-07-2009 05:01 PM

Quote:

Originally Posted by Raelyn (Post 1481936)
Ahh, that worked, thank you.

I think it'd be much more appropriate to change it all to GS2.

PHP Code:

function onCreated() {
  
player.hp 10;
  
  
sleep(2);
  
  if (
player.hp == 10) {
    
message("Roger that!");
  } 

  else {
    
message("Fail!");
  }


However, I don't know where you're testing this.

Raelyn 04-08-2009 01:46 AM

Quote:

Originally Posted by Codein (Post 1481946)
I think it'd be much more appropriate to change it all to GS2.

PHP Code:

... 

However, I don't know where you're testing this.

Where can I get the commands.rtf for GS2? I only have the same old one...

I might as well learn GS2 I guess since I am starting pretty much from scratch. :asleep:

napo_p2p 04-08-2009 02:26 AM

Quote:

Originally Posted by Raelyn (Post 1482116)
Where can I get the commands.rtf for GS2? I only have the same old one...

I might as well learn GS2 I guess since I am starting pretty much from scratch. :asleep:

There isn't one for GS2, but if you haven't checked out the wiki, it's worth taking a look.

http://wiki.graal.net/index.php/Gscript

Raelyn 04-08-2009 03:00 AM

Quote:

Originally Posted by napo_p2p (Post 1482136)
There isn't one for GS2, but if you haven't checked out the wiki, it's worth taking a look.

http://wiki.graal.net/index.php/Gscript

I just tried that GS2 version of the code I was trying to do, and it doesn't work in the editor...

Tigairius 04-08-2009 03:01 AM

Quote:

Originally Posted by Raelyn (Post 1482149)
I just tried that GS2 version of the code I was trying to do, and it doesn't work in the editor...

Editor doesn't support GS2.

Raelyn 04-08-2009 07:50 AM

Quote:

Originally Posted by Tigairius (Post 1482150)
Editor doesn't support GS2.

So then how do I test my code?

napo_p2p 04-08-2009 08:29 AM

Quote:

Originally Posted by Raelyn (Post 1482204)
So then how do I test my code?

You would need to do that on a server. If you don't have a server to test things on, there's a server called Testbed Server that's open for anyone to experiment with scripts.

cbk1994 04-08-2009 09:59 PM

Quote:

Originally Posted by Raelyn (Post 1482116)
I might as well learn GS2 I guess since I am starting pretty much from scratch. :asleep:

Indeed, it's not worth your time to learn GS1 - it's confusing/makes no sense, and has none of the new features that are being added to GS2.

Raelyn 04-09-2009 10:58 AM

Quote:

Originally Posted by cbk1994 (Post 1482356)
Indeed, it's not worth your time to learn GS1 - it's confusing/makes no sense, and has none of the new features that are being added to GS2.

The only thing annoying me about GS2 is the inability to test it offline and the lack of a simple commands.rtf outlining all the commands and their use.

Schetti 04-09-2009 11:51 AM

Quote:

Originally Posted by Raelyn (Post 1482458)
The only thing annoying me about GS2 is the inability to test it offline and the lack of a simple commands.rtf outlining all the commands and their use.


yea so true ... it always finds a fail and I dont have all in GS2(because I dont know all commands) Its pretty annyoning to find the mistake

fragman85 04-09-2009 12:17 PM

You can use /scripthelp on RC :o

Also try wiki.graal.net.

Oh and most of the functions in GS1 and GS2 are very similar :o

Schetti 04-09-2009 12:22 PM

Quote:

Originally Posted by fragman85 (Post 1482474)
You can use /scripthelp on RC :o

That doesnt give the answers to all.

Quote:

Originally Posted by fragman85 (Post 1482474)
Also try wiki.graal.net.

Until I found

Quote:

Originally Posted by fragman85 (Post 1482474)
Oh and most of the functions in GS1 and GS2 are very similar :o

just 1 () missing and all nag me about I dont use GS2


All times are GMT +2. The time now is 09:03 AM.

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