March 26, 2003, 12:59
|
#1
|
Prince
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
|
Unit.name vs. unit.type
What is the difference between the unit.type and the unit.name? Unit.type I understand it's UNIT_WARRIOR, UNIT_ARCHER, etc., but what is unit.name? Warrior Ebert? Bill the Archer? Does every unit have a unique name? If so, what form is the name, alpha or numeric, i.e. "unit Jimmy-Jo-jo" or "unit 56718"
|
|
|
|
March 26, 2003, 13:25
|
#2
|
Deity
Local Time: 00:35
Local Date: November 2, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
I don't think I ever actually bothered to test this but I'm pretty sure unit.type returns UNIT_WARRIOR (or 70, rather, which is the index of UNIT_WARRIOR in units.txt) whereas unit.name returns "Warrior".
|
|
|
|
March 26, 2003, 13:28
|
#3
|
Prince
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
|
Quote:
|
Originally posted by Locutus
I don't think I ever actually bothered to test this but I'm pretty sure unit.type returns UNIT_WARRIOR (or 70, rather, which is the index of UNIT_WARRIOR in units.txt) whereas unit.name returns "Warrior".
|
So the name is not unique? That's too bad.
Where's my lemur poo? I need to shake some work arounds.
|
|
|
|
March 26, 2003, 13:33
|
#4
|
Deity
Local Time: 00:35
Local Date: November 2, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Nope, it's defined in gl_str.txt. You can give armies (including armies consisting of 1 unit) unique names, but not units (and you can't retrieve these unique names with SLIC).
|
|
|
|
March 26, 2003, 13:39
|
#5
|
Prince
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
|
Quote:
|
Originally posted by Locutus
Nope, it's defined in gl_str.txt. You can give armies (including armies consisting of 1 unit) unique names, but not units (and you can't retrieve these unique names with SLIC).
|
Hey, that may just be what I am looking for!
How do you name single unit armies?
How do you access the armies name with SLIC? All I see under army is owner, location, size?
Can you automatically assign a single unit to an army and give the army a unique name with SLIC?
Thanks
|
|
|
|
March 26, 2003, 15:17
|
#6
|
Deity
Local Time: 00:35
Local Date: November 2, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
You can set the name in-game with the army manager (press '.', or right-click, select army manager). But like I said, it's not possible to access the name in SLIC.
|
|
|
|
March 26, 2003, 15:38
|
#7
|
Prince
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
|
Quote:
|
Originally posted by Locutus
You can set the name in-game with the army manager (press '.', or right-click, select army manager). But like I said, it's not possible to access the name in SLIC.
|
Oops, read too fast. Didn't see the apostrophe "t".
|
|
|
|
March 26, 2003, 17:31
|
#8
|
Prince
Local Time: 23:35
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
unit.type returns the index number, not a string - the other one? never used it...
|
|
|
|
March 27, 2003, 07:06
|
#9
|
King
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
|
unit.name if I am right is used in strings .
So you can make a massage box saying
Are warrior is dead
as apposed to
Are unit_warrior is dead
as for the rest i thinck Locutus has delt with it.
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
|
|
|
|
March 27, 2003, 07:10
|
#10
|
Deity
Local Time: 00:35
Local Date: November 2, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Quote:
|
Originally posted by The Big Mc
Are unit_warrior is dead
|
Actually, that would become 'A(re?) 70 is dead', but aside from that, you're right.
|
|
|
|
March 27, 2003, 08:32
|
#11
|
King
Local Time: 22:35
Local Date: November 1, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
|
There has always got to be something.
The big mc every time he does \ says anything wrong.
Besides is there a good guide to making strings. I don't thick there is just some rubbish one cobbled together in the slic stuff on apolyton.
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 18:35.
|
|