Notifications
Clear all

[Closed] Help!!! Sturcture Definition Problem

Hi guys, im new here and any help anyone can give me will be very much appresiated!

So this is where i am so far!..
I have created a box name:vg01 and have also created a struct vgprog (r, e, i, obj).

vg01 = vgprog r:10 e:2 i:5 obj:$vg01

What i want to be able to do is select $vg01 and then from here gain access to the values within vg01 – That is within the struct vgprog.

I have tryed doing this:
select $vg01
a = $.name

I thought from here i could use a command like:

a.r to access the values within vg01.r, however this is not working, i think the problem is that a returns the value “vg01” –in a string literal.

Is there anyway i can do this?

Cheers guys.

3 Replies
 eek

huh? anyway…

struct test

(

a = 10,

b = 20,

c = 30

)

Theres no function that need variables of the struct so you dont need to instance it ( if i remember)

What you want sounds like a custom attribute instead though.

testCA = attributes testAttibs
(
parameters testParams
(
testA type:#float
)
)

custAttributes.add testCa $box01

$box01.testCa.testA = 20.0

$box01.testCa.testA

something like that.

Thanks for that eek! i will take a look at custom attributes instead!

Im trying to set up a system using cellular automata, so i need to be able to loop through all the objects in the scene, access there test values and do some kind of evaluation with the returned values.

something like this:

select $box
boxarray = getcurrentselection
for i = 1 in boxarray do
(
a = $i.testCa.testA
… then use pass the value a on to another evaulation…
)
Am i on the right track?!

 eek

pretty much i think.

for i = 1 to array.count do
(

append testArray (i.testCa.testVal)

)

for i = 1 to testArray.count
(

do funky algorithm

)

you can store arrays in CA’s too, just not nested ones. Cellular autonomy is something im interested too!