Thread Tools
Old August 3, 2002, 09:50   #1
Turambar
Call to Power II Democracy GameCivilization II PBEMCall to Power Democracy GameCTP2 Source Code Project
Prince
 
Local Time: 05:24
Local Date: November 1, 2010
Join Date: Apr 2002
Location: England
Posts: 310
Unit names
Is it possible to change the name of a unit during a game? For example if I've got 2 archers and during the game I want to change ones name from Archer to Dave and the other to Bob.
Turambar is offline  
Old August 3, 2002, 10:24   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:24
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Only by amking an army of one and then naming the army. But then it means you cannot stack Dave and Bob together without losing their identities.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old August 3, 2002, 14:57   #3
HuangShang
Call to Power II Democracy GameCTP2 Source Code Project
King
 
HuangShang's Avatar
 
Local Time: 22:24
Local Date: October 31, 2010
Join Date: Jul 2002
Location: Berkeley
Posts: 1,375
thats tight
HuangShang is offline  
Old August 5, 2002, 15:30   #4
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 05:24
Local Date: November 1, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
yes you can kill the arches and reincarnate as freed, bob ,Dave, and or sue. ( by turning them into special units with different name from archer).


It works well in the Samaria scenario. Only deferens in that is skill upgrade but look into it, it is possible
__________________
"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 August 5, 2002, 16:42   #5
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:24
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
You'd need an extra unit for every name of every normal unit. I think that option is a little unfeasable.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old September 9, 2002, 15:42   #6
Turambar
Call to Power II Democracy GameCivilization II PBEMCall to Power Democracy GameCTP2 Source Code Project
Prince
 
Local Time: 05:24
Local Date: November 1, 2010
Join Date: Apr 2002
Location: England
Posts: 310
Just saw this page http://apolyton.net/ctp2/modificatio...cbuiltin.shtml which contains:

Quote:
UnitRecord array
unitrecord.name - the unit type's name
unitrecord.attack - the unit type's attack value
unitrecord.defense - the unit type's defense value
unitrecord.cost - the production cost of the unit type
unitrecord.ranged - the unit type's ranged attack value
unitrecord.movement - the unit type's move points
Is it then possible to change unitrecord.name to call a unit Bob? Or unitrecord.attack etc to change a units stats during the game?
Turambar is offline  
Old September 9, 2002, 16:07   #7
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:24
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
They're read-only.

The unitrecord.name just accesses its name in gl_str.txt, for example:
UNIT_WAR_CHIEF "War Chief"

The unit stats should theoretically be able to be changed using the mod_UnitAttack() function, but its a weird function that probably does not work properly (ie. returns 1 - normal attack, or 0 - no attack)

So really, there is no way to alter any unitrecord array members, sorry.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old September 9, 2002, 20:04   #8
Dale
Emperor
 
Dale's Avatar
 
Local Time: 15:24
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
Actually, unitrecord.name is only a string, not an int or anything. So technically, what IW said is not 100% correct. The stored element in unitrecord.name = "Archer" for an archer, not ID_UNIT_ARCHER, and so forth.

This is the same for player.name, city.name and many other permanent array members.
Dale 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 01:24.


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