Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-08-2005, 07:15 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Skyld
Note that you can also use SPC and NL operators, the former inserting a space and the latter inserting a new line (effectively, a "\n"), i.e.
PHP Code:
one "Doris";
res "Hello" SPC one
... producing "Hello Doris!".
SPC and NL look ugly


Quote:
Originally Posted by Skyld
This is bad:
PHP Code:
res "My my, " #s(clientr.stringname); 
You would use the following:
PHP Code:
res "My my, " clientr.stringname
Please do not mix old gscript and gscript.
I beat you to it >:P
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #2  
Old 12-08-2005, 07:17 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by ApothiX
SPC and NL look ugly
I am not sure about you, but I would rather do the following:
PHP Code:
this.text "Some text" NL
            
"Some more text" NL
            
"Yet another line"
... rather than:
PHP Code:
this.text "Some text\n" @
            
"Some more text\n" @
            
"Yet another line\n"
Quote:
Originally Posted by ApothiX
I beat you to it >:P
Your need for competition is bewildering.
__________________
Skyld
Reply With Quote
  #3  
Old 12-08-2005, 07:20 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Skyld
I am not sure about you, but I would rather do the following:
PHP Code:
this.text "Some text" NL
            
"Some more text" NL
            
"Yet another line"
... rather than:
PHP Code:
this.text "Some text\n" @
            
"Some more text\n" @
            
"Yet another line\n"
Perhaps NL is good, but 'this.text = "Blah " @ variable' looks better than 'this.text = "Blah" SPC variable', IMO.

Quote:
Originally Posted by Skyld
Your need for competition is bewildering.
Stop spoiling my moments of glory.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #4  
Old 12-08-2005, 07:22 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by ApothiX
Perhaps NL is good, but 'this.text = "Blah " @ variable' looks better than 'this.text = "Blah" SPC variable', IMO.
I agree with you on the rather unnecessary use of SPC, but I suppose it falls down to preference.
Quote:
Originally Posted by ApothiX
Stop spoiling my moments of glory.
I think you have an unusual idea of glory.
__________________
Skyld
Reply With Quote
  #5  
Old 12-08-2005, 07:39 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
... I once again apoligize for something I posted here.
In this case, my only intent was to provide something useful.

Question : why is mixing gs1 and gs2 bad if it makes the npc work?

Also, from the first reply to my post, if you had read my post you would have seen that I DID RTFM several times already and only yesterday did this solution dawn upon me.

From the volume and content of his posts, it appears that Skyld is the most knowledgable about gs2 other than Stefan.

I vote Skyld write the gs2 version of npcprogramming.doc (in some html or php format) with such useful exaples of sample code in context. Becasue such a thing would be most helpful, as a companion to the wiki, in my opinion, which is based on my experience.

I vote for Skyld to do it becasue such an example based tutorial is something that I think many people will need, and I would write one and use it ... if it would not be so harshly criticized by apparently angry and overly critical people, such as some but not all of the poeple who post here seem to be.
And Skyld has a very good way of explaining gs2 in a way that I understand it. Thank you, Skyld.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #6  
Old 12-08-2005, 07:52 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by prozac424242
... I once again apoligize for something I posted here.
In this case, my only intent was to provide something useful.
Don't apologise for it. A significant portion of your post was useful.
Quote:
Originally Posted by prozac424242
Question : why is mixing gs1 and gs2 bad if it makes the npc work?
Because new gscript is capable of doing everything old gscript is, and in a nicer fashion.
Quote:
Originally Posted by prozac424242
From the volume and content of his posts, it appears that Skyld is the most knowledgable about gs2 other than Stefan.
I'm not too sure about that!
Quote:
Originally Posted by prozac424242
I vote Skyld write the gs2 version of npcprogramming.doc (in some html or php format) with such useful exaples of sample code in context. Becasue such a thing would be most helpful, as a companion to the wiki, in my opinion, which is based on my experience.
That's quite a large task, with quite a lot to explain, however, I may write some tutorials sometime.
Quote:
Originally Posted by prozac424242
I vote for Skyld to do it becasue such an example based tutorial is something that I think many people will need, and I would write one and use it ... if it would not be so harshly criticized by apparently angry and overly critical people, such as some but not all of the poeple who post here seem to be.
Don't take it too personally. The fact that you are trying to improve is a fairly large step forward.
Quote:
Originally Posted by prozac424242
And Skyld has a very good way of explaining gs2 in a way that I understand it. Thank you, Skyld.
You're welcome.
__________________
Skyld
Reply With Quote
  #7  
Old 12-09-2005, 08:24 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Skyld
I agree with you on the rather unnecessary use of SPC, but I suppose it falls down to preference.

I think you have an unusual idea of glory.
hmmm... variables that self-concatenate... yikes..... That scares me... Couldn't stefan had just recommended defining your own variables and going

SPC = " ";
NL = "\n";
function(string@SPC@string@NL@string);

I generally would do the above only if I'm lazy though, otherwise I'd write in the space and the new line myself. I can see how SPC can be really really useful when trying to debug something in a hurry using the NPC's chat string.
Reply With Quote
  #8  
Old 12-09-2005, 09:57 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by jake13jake
hmmm... variables that self-concatenate... yikes..... That scares me... Couldn't stefan had just recommended defining your own variables and going

SPC = " ";
NL = "\n";
function(string@SPC@string@NL@string);

I generally would do the above only if I'm lazy though, otherwise I'd write in the space and the new line myself. I can see how SPC can be really really useful when trying to debug something in a hurry using the NPC's chat string.
Well, they're not really variables.
__________________
Skyld
Reply With Quote
  #9  
Old 12-09-2005, 06:10 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
hmmm... variables that self-concatenate... yikes..... That scares me... Couldn't stefan had just recommended defining your own variables and going

SPC = " ";
NL = "\n";
Actually, they are comparible to a C's #define directive,
PHP Code:
#define SPC @ " " @
#define NL @ "\n" @ 
Quote:
Originally Posted by jake13jake
function(string@SPC@string@NL@string);
That's even more ugly than what it really is.. 'function(string SPC string NL string);'
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 12-10-2005, 04:18 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
Actually, they are comparible to a C's #define directive,
PHP Code:
#define SPC @ " " @
#define NL @ "\n" @ 

That's even more ugly than what it really is.. 'function(string SPC string NL string);'
#define is just a find/replace all
Reply With Quote
  #11  
Old 12-09-2005, 09:46 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by ApothiX
Perhaps NL is good, but 'this.text = "Blah " @ variable' looks better than 'this.text = "Blah" SPC variable', IMO.
The more applicaple usage of SPC is;
this.text = variable SPC variable2;
Which is many times more appropriate than;
this.text = variable @ " " @ variable2;

Thank you for your time!
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial

Last edited by Dach; 12-09-2005 at 09:48 PM.. Reason: SHUTUP
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 09:13 AM.


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