Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Using Gscript for personal reasons (https://forums.graalonline.com/forums/showthread.php?t=73238)

PrinceOfKenshin 04-02-2007 03:36 PM

Using Gscript for personal reasons
 
I was wondering if its possible to use gscript and the graal level editor to make another game. I just never really looked into it and i was wondering if there is a way when i finish the overworld to make something so that it can run all the overworlds without having to use Graal. Anyone got an idea? or is it not possible?

Twinny 04-02-2007 03:53 PM

Gscript and the levels are apart of the game itself... you could make another game with a similar language interpreter and level reader but...you can't use actual graal things without using the graal client.

Admins 04-02-2007 04:04 PM

For running Graal you need Graal yes :D

Twinny 04-02-2007 04:34 PM

Quote:

Originally Posted by Stefan (Post 1295859)
For running Graal you need Graal yes :D

Funny that ;)

Gambet 04-02-2007 05:01 PM

No, GScript isn't an official programming language outside of Graal. GScript is simply a mixture of several different programming languages, all compiled together to be used to develop Graal, and nothing more.


It's not like C++ or C, which are official programming languages that can be used to build all types of games.

Chandler 04-02-2007 08:17 PM

This isn't really the place, but I used Graal script for something I did at work:
HTML Code:

function onCreated()
  {
    //Remove the current values
  for (temp.currentVar: getstringkeys("this."))
    unset("this."@ temp.currentVar);
 
  this.allowedNetworks = {"Orange", "O2", "T-Mobile", "Vodafone"};
  this.numberLength = 11;
 
    //Load the file with the text information stored
  temp.fileContent.loadlines("temp/myData.txt");
  for (temp.currentVar: temp.fileContent)
    {
      //Load the arrays from the file
    temp.callDetails = temp.currentVar.tokenize("=");
    temp.mobileDetails = temp.callDetails[1].tokenize(",");
   
      //Organize the arrays data
    temp.csaName = temp.callDetails[0].substring(4);
    temp.mobileNumber = temp.mobileDetails[0].substring(1);
    temp.mobileOperator = temp.mobileDetails[1];
    temp.messageSent = temp.mobileDetails[2].substring(0, 1);
   
      //Record all the repeated fields information.
    this.calculateData(temp.csaName, {"mobileNumbers", "mobileOperators", "sentMessage"}, {temp.mobileNumber, temp.mobileOperator, temp.messageSent});
   
    this.totalCalls++;
    this.("totalCalls_" @ temp.csaName)++;
    }
    //Finally draw the statistics!
  this.drawStatistics();
  }
function calculateData(csaName, callNames, callDetails)
  for (temp.callDetail: temp.callDetails)
    {
      //Don't do the statistics if the information isn't correct!
    if (this.allowedNetworks.index(temp.callDetails[1]) == -1)
      continue;
    if (temp.callDetails[0].length() != this.numberLength)
      continue;
     
    temp.varName = temp.callNames[temp.callDetails.index(temp.callDetail)];
    switch(temp.varName)
      {
        //Check for multiple callers
      case "mobileNumbers":
        if (this.allNumbers.index(temp.callDetail) != -1)
          this.repeatedCalls++;
        this.allNumbers.add(temp.callDetail);
      break;
        //Add all the calls done by a mobile operator
      case "mobileOperators":
        this.("calls_"@ temp.callDetail)++;
      break;
        //Add all messages sent
      case "sentMessage":
        if (temp.callDetail)
          {
          this.("messagesSent_"@ temp.csaName)++;
          this.("messagesSent_"@ temp.callDetails[1])++;
          this.messagesSent++;
          }
      break;
      }
    }
function drawStatistics()
  {
    //Finally output the information
  temp.outputMessages = {
    "Mobile Statistics:",
    format(_("Total SMS Calls: %d"), this.totalCalls),
    format(_("Total Messages Sent: %d"), this.messagesSent),
    format(_("Total Not Sent: %d"), abs(this.totalCalls - this.messagesSent)),
    (this.repeatedCalls > 0? format(_("Repeated Calls: %d"), this.repeatedCalls): ""),
  };
  for (temp.currentOperator: getstringkeys("this.messagesSent_"))
    if (this.allowedNetworks.index(temp.currentOperator) != -1)
      temp.outputMessages.add(format(_("%s Sent: %d / %d"), temp.currentOperator, this.("messagesSent_"@ temp.currentOperator), this.("calls_"@ temp.currentOperator)));
    else
    if (this.("messagesSent_"@ temp.currentOperator) > this.lastSent[1])
      this.lastSent = {temp.currentOperator, this.("messagesSent_"@ temp.currentOperator)};
  temp.outputMessages.add(format(_("Most Sent: %s [%d]"), this.lastSent[0], this.lastSent[1]));
     
  for (temp.currentMessage: temp.outputMessages)
    echo(temp.currentMessage);
  }

hehe

Kristi 04-02-2007 08:58 PM

Haha @ chandler.

I use gscript to check answers for statistics sometimes, since my rc is usually in front me.

godofwarares 04-02-2007 09:06 PM

Quote:

Originally Posted by PrinceOfKenshin (Post 1295849)
I was wondering if its possible to use gscript and the graal level editor to make another game. I just never really looked into it and i was wondering if there is a way when i finish the overworld to make something so that it can run all the overworlds without having to use Graal. Anyone got an idea? or is it not possible?

It isn't possible because GScript is a language that manipulates the Graal engine, and it would be completely unusable in other situations.

Chandler 04-02-2007 09:19 PM

Quote:

Originally Posted by Kristi (Post 1296001)
Haha @ chandler.

I use gscript to check answers for statistics sometimes, since my rc is usually in front me.

Yeah... It's alot easier then actually having to program an output program when you can just echo it!

Angel_Light 04-02-2007 10:33 PM

You could buy a license to use the engine from Stephane I believe.

godofwarares 04-02-2007 11:04 PM

Quote:

Originally Posted by Angel_Light (Post 1296043)
You could buy a license to use the engine from Stephane I believe.

I'm not even sure he'd sell that >.<

cbk1994 04-03-2007 12:32 AM

Quote:

Originally Posted by Stefan (Post 1295859)
For running Graal you need Graal yes :D

Oh! No wonder my old computer doesn't work! I was trying to start graal without graal! :\

napo_p2p 04-03-2007 12:57 AM

Quote:

Originally Posted by Kristi (Post 1296001)
Haha @ chandler.

I use gscript to check answers for statistics sometimes, since my rc is usually in front me.

Hmm, I thought I was the only one who did that...

JkWhoSaysNi 04-03-2007 02:34 PM

Quote:

Originally Posted by Chandler (Post 1296015)
Yeah... It's alot easier then actually having to program an output program when you can just echo it!

I use perl (or occasionally php) from command line for those kind of things. Using Gscript seems a bit pointless

Kristi 04-03-2007 03:56 PM

Quote:

Originally Posted by JkWhoSaysNi (Post 1296372)
I use perl (or occasionally php) from command line for those kind of things. Using Gscript seems a bit pointless

In windows, my rc is usually open, and a console is not (obviously). In my usual state it is easiest to pop in a gscript. How "pointless." =)

Chandler 04-03-2007 06:55 PM

Quote:

Originally Posted by Kristi (Post 1296392)
In windows, my rc is usually open, and a console is not (obviously). In my usual state it is easiest to pop in a gscript. How "pointless." =)

Friends Forever!

Kristi 04-03-2007 07:19 PM

Quote:

Originally Posted by Chandler (Post 1296434)
Friends Forever!

Pinky swear?! :D

Angel_Light 04-03-2007 10:22 PM

Quote:

Originally Posted by Chandler (Post 1296434)
Friends Forever!

lol suck up! :p

Chandler 04-04-2007 08:04 AM

Quote:

Originally Posted by Angel_Light (Post 1296474)
lol suck up! :p

Why would I suck up to Kristi when I could suck up to Skyld! ;)

killerogue 04-04-2007 08:27 AM

Quote:

Originally Posted by Angel_Light (Post 1296474)
lol suck up! :p

How do you know they couldn't just be an awesome set of friends....:whatever:

Chandler 04-04-2007 08:31 AM

Quote:

Originally Posted by killerogue (Post 1296644)
How do you know they couldn't just be an awesome set of friends....:whatever:

I couldn't care less what he thought. We've worked together on Classic, for that matter. ^^

Inverness 04-04-2007 08:35 AM

We need Graal Applet, yes?


All times are GMT +2. The time now is 12:47 PM.

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