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 04-02-2007, 03:36 PM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
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?
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #2  
Old 04-02-2007, 03:53 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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.
Reply With Quote
  #3  
Old 04-02-2007, 04:04 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
For running Graal you need Graal yes
Reply With Quote
  #4  
Old 04-02-2007, 04:34 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Stefan View Post
For running Graal you need Graal yes
Funny that
Reply With Quote
  #5  
Old 04-02-2007, 05:01 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
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.
Reply With Quote
  #6  
Old 04-02-2007, 08:17 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
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
Reply With Quote
  #7  
Old 04-02-2007, 08:58 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Haha @ chandler.

I use gscript to check answers for statistics sometimes, since my rc is usually in front me.
__________________
Reply With Quote
  #8  
Old 04-02-2007, 09:06 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by PrinceOfKenshin View Post
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.
__________________
What signature? I see no signature?
Reply With Quote
  #9  
Old 04-02-2007, 09:19 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Kristi View Post
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!
Reply With Quote
  #10  
Old 04-02-2007, 10:33 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
You could buy a license to use the engine from Stephane I believe.
__________________
Deep into the Darkness peering...
Reply With Quote
  #11  
Old 04-02-2007, 11:04 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Angel_Light View Post
You could buy a license to use the engine from Stephane I believe.
I'm not even sure he'd sell that >.<
__________________
What signature? I see no signature?
Reply With Quote
  #12  
Old 04-03-2007, 12:32 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Stefan View Post
For running Graal you need Graal yes
Oh! No wonder my old computer doesn't work! I was trying to start graal without graal!
__________________
Reply With Quote
  #13  
Old 04-03-2007, 12:57 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Kristi View Post
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...
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #14  
Old 04-03-2007, 02:34 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Chandler View Post
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
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #15  
Old 04-03-2007, 03:56 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by JkWhoSaysNi View Post
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." =)
__________________
Reply With Quote
  #16  
Old 04-03-2007, 06:55 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Kristi View Post
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!
Reply With Quote
  #17  
Old 04-03-2007, 07:19 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by Chandler View Post
Friends Forever!
Pinky swear?!
__________________
Reply With Quote
  #18  
Old 04-03-2007, 10:22 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Chandler View Post
Friends Forever!
lol suck up!
__________________
Deep into the Darkness peering...
Reply With Quote
  #19  
Old 04-04-2007, 08:04 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Angel_Light View Post
lol suck up!
Why would I suck up to Kristi when I could suck up to Skyld!
Reply With Quote
  #20  
Old 04-04-2007, 08:27 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Angel_Light View Post
lol suck up!
How do you know they couldn't just be an awesome set of friends....
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #21  
Old 04-04-2007, 08:31 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by killerogue View Post
How do you know they couldn't just be an awesome set of friends....
I couldn't care less what he thought. We've worked together on Classic, for that matter.
Reply With Quote
  #22  
Old 04-04-2007, 08:35 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
We need Graal Applet, yes?
__________________
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 10:50 PM.


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