Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2011, 06:55 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Question What is the difference?

Hey there.

While I where making scripts (so when I´m gold again I can upload them) I realized something and wanted to ask it.

What is the difference between
PHP Code:
function onCreated() {
this.bla = ...;
thiso.bla = ...;
temp.bla = ...;

and all that

Like I said on top I´m currently Trial again so I can´t test stuff. Maybe someone can explain me the differences
__________________
MEEP!
Reply With Quote
  #2  
Old 05-26-2011, 06:57 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
Take a look at http://gscript.graal.net/CategoryVariablePrefix, it contains some explanations and examples of usage.
__________________
Skyld
Reply With Quote
  #3  
Old 05-26-2011, 07:10 PM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
Quote:
Originally Posted by callimuc View Post
PHP Code:
function onCreated() {
this.bla = ...;
thiso.bla = ...;
temp.bla = ...;

this. prefix points to the current object.
PHP Code:
with (object) {
  
this.somevar 2;
}
echo(
object.somevar); 
thiso. prefix points to the object that is running the script.
PHP Code:
thiso.someothervar 4;
with (object) {
  
this.somevar thiso.someothervar;
}
echo(
object.somevar); 
temp. prefixed vars will be destroyed once the function that contains them has run.
Reply With Quote
  #4  
Old 05-26-2011, 07:16 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
thanks saw that in the link
__________________
MEEP!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:31 PM.


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