Page 1 of 1

Need help with syntax

Posted: Fri Feb 19, 2010 4:05 pm
by Killerdude
fancone is a script object in radiant with data. I am trying to access the data from a thread but keep getting nil. Here is the script object ...

Isn't it peculiar the way the zeros do not line up for the fanspeed and clocktick?

Image


So in my main prior to level waittill spawn I have this -> $fancone thread modified_monitor_fan_speed
Then in modified_monitor_fan_speed thread I have -> iprintln self.TerminalVelocity

nil is what is printed out, so the self obj is not being created or my syntax is bad. If the self object is not being created than the way I created the thread with the script object is improper.

Does anyone know what I am doing wrong?

Posted: Sat Feb 20, 2010 11:06 am
by Rookie One.pl
You have to mark these custom key/value pairs as stuff you want to be accessible from script. Try putting a hash character '#' before the key names in the entity inspector (e.g. #TerminalVelocity, #FanSpeed, etc.).

Posted: Sat Feb 20, 2010 12:35 pm
by Killerdude
Thank you ...

I was beating my head against a wall for a full day trying to figure out what was wrong and all I needed was a '#'.

Can you do strings in the entity window? I tried it without quotes, no go. I tried it with double quotes <----- Real bad, corrupted my map file. Didn't try single quotes.

Posted: Fri Feb 26, 2010 11:15 pm
by jv_map
Try a $ :)

Posted: Tue Mar 02, 2010 12:10 pm
by Rookie One.pl
Like, a $ instead of the #? I didn't know that. :)

Posted: Wed Mar 03, 2010 9:44 pm
by jv_map
Yah a $ instead of the # gets the job done. No sense in it really but it works :)