Need help with syntax

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

Need help with syntax

Post 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?
[Rome wasn't mapped in a day!]
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.).
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

Post 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.
[Rome wasn't mapped in a day!]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Try a $ :)
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Like, a $ instead of the #? I didn't know that. :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yah a $ instead of the # gets the job done. No sense in it really but it works :)
Image
Post Reply