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 01-23-2007, 12:44 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
Variable linking?

How do I link a TGraalVar to another so when I change one the other reflects the change?
__________________
Reply With Quote
  #2  
Old 01-23-2007, 01:18 AM
Cyrioux Cyrioux is offline
Registered User
Join Date: Jul 2002
Location: germany
Posts: 10
Cyrioux is on a distinguished road
If you are talking of TGraalVar as object just use addcontrol and change vars reversibly at the child node with getparent?

Im talking nonsense... these are GUI functions. X_o

Well, script your own function. :>
Reply With Quote
  #3  
Old 01-23-2007, 01:20 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 Inverness View Post
How do I link a TGraalVar to another so when I change one the other reflects the change?
I think b = a.link() might be what you are looking for, but I am not certain how well it works.
__________________
Skyld
Reply With Quote
  #4  
Old 01-23-2007, 01:28 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
Quote:
Originally Posted by Skyld View Post
I think b = a.link() might be what you are looking for, but I am not certain how well it works.
I've tried that about 10 times, and its never once worked so I came here to ask.
__________________
Reply With Quote
  #5  
Old 01-23-2007, 03:54 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
I did testing with .link() awhile back and was rather unsatisfied with the results I got.

HTML Code:
  this.var = 4;
  temp.var = this.var.link();
  temp.var++;
  echo("temp.var - " @ temp.var @ " this.var - " @ this.var);
Outputs: temp.var - 5 this.var - 4

HTML Code:
function onCreated()
{
  this.var = 1;
  getVar()++; // Works
  
  temp.var = getVar();
  temp.var++;
  echo("temp.var - " @ temp.var @ " this.var - " @ this.var);
}

function getVar()
{
  return this.var.link();
}
Outputs: temp.var - 3 this.var - 2
Reply With Quote
  #6  
Old 01-23-2007, 05:36 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
I would really like if this was fixed >_>
__________________
Reply With Quote
  #7  
Old 01-23-2007, 03:21 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
Well for normal variant variables (TGraalVar) the linking is undone once you assign them to some other variable, but it works as function parameter (passing arrays to a function which can modify it). It is not planned to make it work in other ways.
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 03:24 PM.


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