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 05-18-2005, 06:32 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by Stefan
You mean temp. variables ?
In new Graal script variables are by default global (like in old scripting engine on clientside), and you can limit the scope by putting this., player., server., temp. etc. in front.
Well, I don't know how temp. vars act, but I was talking about variables that won't exist in (as example) a function called by the function, like

function foo() {
foovar = "hello";
bar();
}

Now function bar shouldn't have access to foovar, yet it does and it is one big source for errors.
Like when you use some function someone else made, and it changes a variable you use in your function that calls this 3rd party function.

EDIT: A-hah, so temp. vars replace them Well, that answers my question, thanks very much.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #2  
Old 05-18-2005, 06:48 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 Fry
Now function bar shouldn't have access to foovar, yet it does and it is one big source for errors.
Yes it can be confusing sometimes, but it was the only way in the old scripting engine to pass parameters to the called function so it cannot be just removed. It could be possible to add the possibility to modify the scope of variables by serveroptions may be, although it can be even more confusing if the same script works differently from server to server.
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 05:12 PM.


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