View Full Version : Unknown property???

03-17-2012, 12:17 PM
Encountered quite strange issue... I've got my own structure defined and I try to assign some value to one of it's properties using dropdown lis. It shows me:

struct Axle (
lenght = 0.0, -- axle lenght in [m]
yPos = 0.0, -- = carLenght/2-distanceFromFront
wRadius = 0.0, -- wheels' radius in [m]
wWidth = 0.0, -- wheels' width in [m]
wMass = 0.0, -- wheels' mass in [kg]
susp = 1, -- suspension type
drive = false -- if the axle is a driving one
global axles = #() -- array to keep axles' properties
for i=1 to nrVal do (append axles Axle)
rollout AxleRollout "Axles' Properties" width:140 height:366 (
on axle_list selected sel do ( -- set the chosen axle's suspension type
axles[axle_spin.value].susp = sel

What have I done wrong?

03-17-2012, 12:47 PM
(append axles Axle)should be(append axles Axle())you were collecting references to the struct definition rather than actual instances

03-17-2012, 01:24 PM
Kinda better...
Now it says it has argument count error:
"append wanted 2, got 3"
... though I only changed "Axle" to "Axle()"

for i=1 to nrVal do ( append axles Axle() )

Ok, nvmd, I changed to
axles[i] = Axle()
and it works. The above issue is quite interesting though. Any ideas why did it throw such error?

03-17-2012, 02:27 PM
for i=1 to nrVal do ( append axles (Axle()) )

03-17-2012, 11:31 PM
my bad, lo made the correction for me

CGTalk Moderation
03-17-2012, 11:31 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.