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
  #16  
Old 09-17-2003, 05:48 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Re: Brief explanations about some new features: (NEW SCRIPT ENGINE)

Quote:
Originally posted by Python523
The new features
Mh, i really need to read the functions stuff more careful because variable passing is a bit unclear to me. Or i think XD does it work like this:

NPC Code:

if (playerenters){
a=10;
b=10;
c=7;
multiply_em(a,b,c);
}
function multiply_em(d,e,f){
g=d*e;
h=g*f;
message #v(h);
}
//very simple, lol.


i should get as outcome (10*10)*7 (=700), right...?

Also, can we do this:

Is there a way to use a "message" that uses a function? I mean like this (Javscript):
NPC Code:

alert("You have" + getcash(client.taxreturn,client.salary) "dollars!);
function getcash(x,y){
this.cash=x*y;
return this.cash;
}

__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #17  
Old 09-17-2003, 05:51 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by adam



Becouse there isn't one dedicated tutorial maker among us.
*ahem ahem* *points at self* I made a new commands.rtf ... This sounds fun XD Sorry for double post B.T.W.
Also, tutorials and stuff:
http://www.freewebs.com/graaleditor
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #18  
Old 01-31-2004, 11:45 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
There is more in the new scripting engine though:

1. Compatible to old scripts
2. Object-oriented with variant variables
3. Easier access to variables
4. Powerful GUI
5. Additional functions for catching and invoking events
6. Loading and saving files

And more...
Reply With Quote
  #19  
Old 01-31-2004, 11:51 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Ok, thats' just mean. Telling us about all the things we cannot have.

And clear your pm box already. hehe.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #20  
Old 02-01-2004, 12:21 AM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Holy ****! Object-Oriented? That's just awesome!

I haven't been using object-oriented things for a long time, but they were awesome... Erm, for you who don't know... How can I explain:

Object Oriented is something that you can somewhat have a whole new ****load of arrays in a variable, along with it's own function set and all!

As in PHP:
NPC Code:

class dog{
var health;
function bark(){
setcharprop #c,Woof Woof!;
}
function whimper(){
setcharprop #c,Err... Err...!;
}
function attack(otherdog){
otherdog->hurt(5);
}
function hurt(damage){
health = health - 5;
if (health <= 0)
setcharprop #c, Arg... I'm dead;
}
}
if (playerenters){
dog = new dog(10);
healthydog = new dog(100);
healthydog-> bark();
dog-> whimper();
healthydog-> attack(dog);
dog-> attack(healthydog);
healthydog-> attack(dog);
}



Erm... Yea, that seems right... It's having a whole basin of function into a variable... It's basically like classes, but much easier to control... Perhaps in a hat shop, you could have One NPC having control of all the hats there, instead of all the hats having itself as a class...

Say, could we do:
NPC Code:

if (playerenters){
npcs[index].OBJECT-> Function(data1,data2);
}


?
It would be awesome if we could... Anyhow! When is the new engine planned to be released? You got me anxious (Well, more then I actually am).
__________________
- Rance Vicious
Reply With Quote
  #21  
Old 02-01-2004, 04:42 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Wow old gscript was so much easier. I think i'll just stick to the old gscript unless certain new features don't work the old way.
__________________
Reply With Quote
  #22  
Old 02-01-2004, 05:12 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Termina_Owner

<stuff>
It isn't really anything like php's version of OOP
Reply With Quote
  #23  
Old 02-01-2004, 05:40 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
Function parameters -- can you pass by reference?
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #24  
Old 02-01-2004, 07:06 AM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
Quote:
Originally posted by ZeLpH_MyStiK
Wow old gscript was so much easier. I think i'll just stick to the old gscript unless certain new features don't work the old way.
I dont see anything harder about the new engine. I just see many new features that will make it better than the old one.
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #25  
Old 02-01-2004, 05:14 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
The new engine isn't there to make it harder, dudes.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #26  
Old 02-01-2004, 07:50 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally posted by xManiamaNx


I dont see anything harder about the new engine. I just see many new features that will make it better than the old one.
Look at the syntax for the for loops, it's more confusing.
(Sounds like Python: for i in range(1,5)
__________________
Reply With Quote
  #27  
Old 02-02-2004, 01:23 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
Quote:
Originally posted by Termina_Owner

As in PHP:
NPC Code:

if (playerenters){
dog = new dog(10);
healthydog = new dog(100);
healthydog-> bark();
dog-> whimper();
}



It would be awesome if we could... Anyhow! When is the new engine planned to be released? You got me anxious (Well, more then I actually am).
You can call functions of other npcs if they are declared public (public function ...).
The class system is the same like the old Graal class system, except that you can join and leave at any time you want. You can do things like

myvar = "test";
myvar.join("dogs");
myvar.whimper();

which is then using the dogs class
Reply With Quote
  #28  
Old 02-02-2004, 05:54 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by Stefan


You can call functions of other npcs if they are declared public (public function ...).
That's pretty cool This could be an alternative for a lot of sets, triggeractions etc...h
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
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 04:13 AM.


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