$targetname command in radiant

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

$targetname command in radiant

Post by erick »

Today I was looking at a gas chamber map and the person used $targetname/some value i forget
and then on the same entity they had
targetname/same value as the $targetname
What is the "$targetname" for because I use just plain old "targetname"?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

$

Post by tltrude »

Far as I know, the "$targetname" value will stay the same if the entity is cloned. If you use just "targetname" the value will change to "t1", "t2", "t3", etc... when cloned.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Some scripts work better if in radiant you use $targetname and the # symbol for a number eg. key: #bla value: 1 this is called type casting where the $ is for strings and the # is for numbers . You can't really do that with scripting though but in script you would put "" around strings . Also as tom said the $ charactor is recognized by radiant as having special meaning .
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Always use 'targetname'. Otherwise targetname arrays won't work correctly in the script (that is if you have more than one entity with the same targetname).
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

jv_map wrote:Always use 'targetname'. Otherwise targetname arrays won't work correctly in the script (that is if you have more than one entity with the same targetname).
Are you sure it is not the other way around JV $targetname instead of targetname ? Not sure if it makes that much difference really but I think it has in some scripts .
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

It is the first mentioned way around :)
Image
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

another question

Post by erick »

Okay with that cleared up what does this mean? :? (Found in the same script as before)

Code: Select all

level.sealed = 0
level.bdseal = 1
level.dimlights = 0
Where do people come up with these strange level variables because I have no clue what they mean. There isn't the slightest hint in the .map file or the script.
I am just wondering how people come up with their own level variables? :?
I need some major help with level variables.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Re: another question

Post by wacko »

erick wrote:Where do people come up with these strange level variables because I have no clue what they mean. There isn't the slightest hint in the .map file or the script.
I am just wondering how people come up with their own level variables? :?
I need some major help with level variables.
That's all in (and out of) their mind. :)
Most variables they and you will use aren't system variables but just invented to store and use information for later use.
"level" means that this variable will be available and valid for all threads in ur script, whereas "local" would be only for the thread it's in. Another local.somevariable in another thread would be a seperate variable.
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post by Condor »

I use "$targetname" for example for triggers at locked doors, which are used very often, but for script_objects etc I would use "targetname", because clones get a new, automatically generated unique name.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Condor wrote:...clones get a new, automatically generated unique name.
They don't if you clone entities with Ctrl+Space instead of Space only
Post Reply