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 10-28-2010, 12:00 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Copying Vars

HTML Code:
temp.obj = new TStaticVar();
temp.obj.myvartest = "heyeep";
temp.obj.manpoo = {"gee", "wizz"};


temp.n = new TStaticVar();
temp.n.test = "hey";
temp.n.debug = {"rarr", "lolol"};

temp.obj.copyfrom(temp.n);
When copying from another object, it seems to clear the list? Is this supposed to happen?

If so, is there a way to copy the vars from temp.obj to temp.n without deleting it all?
__________________
Reply With Quote
  #2  
Old 10-28-2010, 12:36 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
I just tried
PHP Code:
temp.obj.loadVarsFromArray(temp.n.saveVarsToArray(false)); 
but it seems to clear all existing variables as well =(
__________________
Reply With Quote
  #3  
Old 10-28-2010, 12:59 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Passing TStaticVars to this would work at a basic level.

PHP Code:
function stealValues(ab) {
  
temp.keys a.getdynamicvarnames();
  for (
temp.keytemp.keys) {
    
b.(@temp.key) = a.(@temp.key);
  }

__________________
Quote:
Reply With Quote
  #4  
Old 10-28-2010, 08:12 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Yeah, I thought of doing that but I thought there would be a built in way to resolve this though

Thanks!
__________________
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 03:13 PM.


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