Reply
Reply
 
Thread Tools Display Modes
rollin's Avatar
Old (#1)
heyho,

my problem is I have a custom referencetarget object (tool provided by someone else)

this reference target has a bunch of vars .. like .name .color .allowexport and so on..


not how can I copy all the values of these vars from one instance of such an referencetarget to another.

let's say I have the vars a and b .. I can say b.name = a.name
that works.. but can I iterate through all vars in some way?

just saying b = a doesn't work.. it makes b = a but the connection to the original "object" is lost.. making b to b* and b != b*
a and b are connected to nodes somehow

talking about ogremax btw and its ogremax object settings
Offline , card carrying polycounter, 2,146 Posts, Join Date Oct 2004, Location munich, germany  
   Reply With Quote

monster's Avatar
Old (#2)
I don't have Ogremax, but there's a couple of things you can try.

b = copy a

This may prevent the problem you have with b = a.

showproperties a

This might show you all the properties so you can copy them manually.
Juan Martinez | Blog | Animator at Verse, Inc
Offline , polycounter, 962 Posts, Join Date Oct 2004, Location Dallas, TX USA Send a message via ICQ to monster Send a message via AIM to monster  
   Reply With Quote

LoTekK's Avatar
Old (#3)
You can also use the result (array) of showProperties (there's also showPropNames or something) to hack up an execute() loop so you wouldn't need to manually copy everything.
FlowMap Painter v0.9.2

teckArtist.com
LoTekK.com

"Has anyone really been far even as decided to use even go want to do look more like?" -DKK
Offline , dedicated polycounter, 1,395 Posts, Join Date Jan 2006, Location Singapore Send a message via MSN to LoTekK Send a message via Skype™ to LoTekK  
   Reply With Quote

cw's Avatar
Old (#4)
showproperties has some partner functions too - getproperty, setproperty, isproperty and hasproperty.

So you can say, theprops = getpropnames obj, then iterate over that array of names for your source object, store the properties and their values in arrays - then do the same for the target and check if isproperty obj #theropertyname then reapply the value to it, bada-bing.

Hope that mini wall of text helps.
Creative Assembly
Total War
Creature doodles
Offline , polycounter, 777 Posts, Join Date Jan 2006, Location UK  
   Reply With Quote

Reply

Thread Tools
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

Copyright 1998-2012 A. Risch