Thread Tools
Old March 26, 2003, 12:59   #1
ahenobarb
Prince
 
ahenobarb's Avatar
 
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"

ahenobarb is offline  
Old March 26, 2003, 13:25   #2
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
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".
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 26, 2003, 13:28   #3
ahenobarb
Prince
 
ahenobarb's Avatar
 
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.
ahenobarb is offline  
Old March 26, 2003, 13:33   #4
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
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).
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 26, 2003, 13:39   #5
ahenobarb
Prince
 
ahenobarb's Avatar
 
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
ahenobarb is offline  
Old March 26, 2003, 15:17   #6
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
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.
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 26, 2003, 15:38   #7
ahenobarb
Prince
 
ahenobarb's Avatar
 
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".
ahenobarb is offline  
Old March 26, 2003, 17:31   #8
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
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...
mapfi is offline  
Old March 27, 2003, 07:06   #9
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
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
The Big Mc is offline  
Old March 27, 2003, 07:10   #10
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
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.
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old March 27, 2003, 08:32   #11
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
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
The Big Mc is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 18:35.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team