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 06-21-2005, 10:57 AM
EmpireOwnsYou EmpireOwnsYou is offline
Banned
Join Date: Mar 2005
Posts: 12
EmpireOwnsYou is on a distinguished road
thiso with strings but not variables?

I tried accessing a variable is thiso inside of a get npc, and it would not work, but it worked fine with a string. Why is this? (I fixed my problem already with a differant solution, just wondering why?)
Reply With Quote
  #2  
Old 06-21-2005, 12:44 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 EmpireOwnsYou
I tried accessing a variable is thiso inside of a get npc, and it would not work, but it worked fine with a string. Why is this? (I fixed my problem already with a differant solution, just wondering why?)
In the old scripting engine there are thiso. string variables but not thiso. numeric variables. In the new scripting engine both work.
Reply With Quote
  #3  
Old 06-21-2005, 12:46 PM
EmpireOwnsYou EmpireOwnsYou is offline
Banned
Join Date: Mar 2005
Posts: 12
EmpireOwnsYou is on a distinguished road
Quote:
Originally Posted by Stefan
In the old scripting engine there are thiso. string variables but not thiso. numeric variables. In the new scripting engine both work.
I'll have to try learning the new scripting engine some time.
Is it very powerful? Like can do more with it than regular gscript?

Btw thanks for moderating the post...
Reply With Quote
  #4  
Old 06-21-2005, 03:29 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by EmpireOwnsYou
I'll have to try learning the new scripting engine some time.
Is it very powerful? Like can do more with it than regular gscript?

Btw thanks for moderating the post...


It's object oriented and it is strict. A lot stricter then the old scripting engine.


....Yes, you can do more with the new scripting engine.
Reply With Quote
  #5  
Old 06-21-2005, 04:16 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Gambet
It's object oriented and it is strict. A lot stricter then the old scripting engine
In what way?
__________________
Reply With Quote
  #6  
Old 06-21-2005, 04:30 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Kaimetsu
In what way?

setshape ,32,32;

would not work in GS2, but would work in GS1, rather


setshape 1,32,32;


would work in both.
Reply With Quote
  #7  
Old 06-21-2005, 04:38 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Quote:
Originally Posted by Kaimetsu
In what way?
you have to do things correctly
__________________

Reply With Quote
  #8  
Old 06-21-2005, 10:55 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Kaimetsu
That's not what weak typing means.

That's what I was taught in my computer class (not programming exactly..just the basics on computers and typing and such). I was taught that it is a strict system that only allows a few exceptions (meaning lazy scripting) to the strictness (if that is a word?) of the system, so as long as the system can understand what you are trying to command it to do/perform. If that is not the definition, then please educate me.


Quote:
Originally Posted by Kaimetsu
I think that's the third time you've repeated yourself. You claim doesn't become any more persuasive just because you've reiterated it. So far you've given only one example to support your statement, and we've already seen that it is factually inaccurate!

My example was accurate. It seems recently Stefan made the system less-strict. Nonetheless, I think it's fairly obvious that GS2 is more strict. Why? Because unless Stefan made it less strict(er), then you wouldn't be able to pull off things you can on GS1 to GS2. GS2 is a more strict system, so that would make it strict(er) than GS1.
Reply With Quote
  #9  
Old 06-21-2005, 11:00 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Gambet
That's what I was taught in my computer class (not programming exactly..just the basics on computers and typing and such). I was taught that it is a strict system that only allows a few exceptions
I will charitably assume that it is the fault of your school, and then tell you that your school sucks.

Quote:
My example was accurate
Whether or not it previously was, it certainly isn't any longer. The point is that GS2 is supposed to be backwards-compatible. Meaning that, in principle, it should accept anything that would be acceptable in GS1. How can it possibly be more strict?

Quote:
I think it's fairly obvious that GS2 is more strict. Why? Because unless Stefan made it less strict(er), then you wouldn't be able to pull off things you can on GS1 to GS2
...what?

Quote:
GS2 is a more strict system, so that would make it strict(er) than GS1.
Nice tautology there. But it's still rooted in an unsupported assertion.
__________________
Reply With Quote
  #10  
Old 06-21-2005, 11:18 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
It is backwards compatible, but not EVERYTHING works.

Did you see what happened to Era? When they moved everything from their dev server to their main server (when they added GS2), they had to close Era down because not everything worked as it should. The GS2 system is strict, and although it is backwards compatible, it is backwards compatible only to GS1 commands that were scripted correctly.

setshape ,32,32;

That is not correct. GS2 would not understand that, yet GS1 would.


NOW it's different since Stefan made the system less strict. Just not sure how less strict he made it.
Reply With Quote
  #11  
Old 06-21-2005, 11:24 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Gambet
It is backwards compatible, but not EVERYTHING works
By design? The Graal client is still being developed. The incompatibilities are not parts of the language; its syntactic and semantic features are wholly distinct from its software implementation.

Quote:
setshate ,32,32;

That is not correct. GS2 would not understand that, yet GS1 would
1) Untrue. I don't know why you're making this claim after it's been so unequivocally disproven.
2) To speaking of GS2 "understanding" an expression is meaningless. It's a language, not an interpreter.
__________________
Reply With Quote
  #12  
Old 06-21-2005, 11:28 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Kaimetsu
1) Untrue. I don't know why you're making this claim after it's been so unequivocally disproven.
2) To speaking of GS2 "understanding" an expression is meaningless. It's a language, not an interpreter.

Oh, yes, I forgot who I was talking to. My mistake on using the wrong word, even though you knew what I meant .



Anyways, my example WAS true. I don't believe it's been announced anywhere that GS2 has become less strict, so before Stefan posted what he did, I was still correct.
Reply With Quote
  #13  
Old 06-21-2005, 11:30 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Gambet
Oh, yes, I forgot who I was talking to. My mistake on using the wrong word, even though you knew what I meant
Don't be stupid. If you don't state your beliefs in a precise, meaningful manner then I'm forced to guess at what you mean. That kind of thing only leads to misunderstandings. If you'll learn to express yourself properly then there won't be a problem.

Quote:
Anyways, my example WAS true
No, because you're still conflating the language with the implementation of the interpreter. Do you not understand the difference?
__________________
Reply With Quote
  #14  
Old 06-22-2005, 12:41 AM
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 are a few things that are incompatible between the two scripting engines, which make it sometimes look more strict. The main problem are variables like "this.x". While in the new scripting engine you can access everything in an object-oriented manner, meaning "this." could be replaced by "thiso." if not inside a with-clause, by other objects or be removed if you just want to access variables of the object the script is running for, in the old engine it was a special construct which only redirects to the dynamic (non-built-in) scripting variables of the npc the script is running for.
I wouldn't say the new scripting engine is more strict though, it's just not running 100% of the old scripts in exactly the same way the old engine would do it. The new scripting engine is also about more than just a different syntax description, it is also running scripts in a more optimized way, allowing scripts running other scripts, allowing the C++ engine to directly call script functions and doing something with the return values, is producing byte code so that the data sent to clients is smaller and needs less processing power and less updates on the client.
Reply With Quote
  #15  
Old 06-23-2005, 05:31 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
Is it possible to return a variable name with a function to be used with an opperator?
Function Script:
NPC Code:
return makevar("clientr." @ this.flag @ "item_" @ getitemvar(archetype,"count"))[0];


NPC Code:
getitemvar(archetype,"qty") += 2;


Doesn't work for me in the way I would like.

Also it would be nice if GS2 was only activated in a script by header like Kaimetsu has stated:
Quote:
Originally Posted by Kaimetsu
I'd personally like a system where the two languages are completely distinct, and the scripter announces that he wants to use GS2 by use of a special header. Like, one of those //#HEADER things.
Though I believe it best if this feature was available by server option. False at default.
__________________
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:36 PM.


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