August 3, 2002, 09:50
|
#1
|
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.
|
|
|
|
August 3, 2002, 10:24
|
#2
|
Prince
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
|
|
|
|
August 3, 2002, 14:57
|
#3
|
King
Local Time: 22:24
Local Date: October 31, 2010
Join Date: Jul 2002
Location: Berkeley
Posts: 1,375
|
thats tight
|
|
|
|
August 5, 2002, 15:30
|
#4
|
King
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
|
|
|
|
August 5, 2002, 16:42
|
#5
|
Prince
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
|
|
|
|
September 9, 2002, 15:42
|
#6
|
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?
|
|
|
|
September 9, 2002, 16:07
|
#7
|
Prince
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
|
|
|
|
September 9, 2002, 20:04
|
#8
|
Emperor
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.
|
|
|
|
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 01:24.
|
|