Page 1 of 1
"AddHeroClass" means what? [Solved]
Posted: Mon Aug 31, 2009 12:59 pm
by 666rulerofclones
I was looking through the setup_teams.lua and I came across this line;
Code: Select all
-- add hero class if available
if side[hero] then
AddHeroClass(side[hero])
Anyone have any idea what that does? It sure looks interesting. The FAQ had nothing that I could find about it.
Re: "AddHeroClass" means what?
Posted: Mon Aug 31, 2009 1:29 pm
by Par3210
....
This is the normal code... to add any unit as the hero.
For instance:
Code: Select all
AddUnitClass(REP, "rep_inf_ep3_rifleman",1, 2)
Re: "AddHeroClass" means what?
Posted: Mon Aug 31, 2009 1:35 pm
by 666rulerofclones
Par3210 wrote:....
This is the normal code... to add any unit as the hero.
For instance:
Code: Select all
AddUnitClass(REP, "rep_inf_ep3_rifleman",1, 2)
I thought that was a different function entirely. It has its own place in setup_teams.
Code: Select all
-- add unit classes in type order
for _, type in ipairs(typeList) do
if side[type] and (not teamItems or not teamItems[name] or teamItems[name][type]) then
AddUnitClass(team, side[type][1], side[type][2], side[type][3])
end
end
-- add hero class if available
if side[hero] then
AddHeroClass(side[hero])
end
end
end
Re: "AddHeroClass" means what?
Posted: Mon Aug 31, 2009 1:37 pm
by Par3210
I don't think it's any different...
Re: "AddHeroClass" means what?
Posted: Mon Aug 31, 2009 3:36 pm
by [RDH]Zerted
Its so you can have hero="inf_some_heroclass", in your SetupTeams section along with the rest of them soldier="", sniper="", etc...
There is a bug/missing feature in the v1.3 patch. If you use that SetupTeams syntax or the function directly, that unit won't be registered for the FakeConsole commands. Meaning commands using SetClassProperty won't effect any units added with AddHeroClass. I posted about it in the v1.3 topic a few weeks ago.
Re: "AddHeroClass" means what?
Posted: Mon Aug 31, 2009 10:57 pm
by 666rulerofclones
[RDH]Zerted wrote:Its so you can have hero="inf_some_heroclass", in your SetupTeams section along with the rest of them soldier="", sniper="", etc...
There is a bug/missing feature in the v1.3 patch. If you use that SetupTeams syntax or the function directly, that unit won't be registered for the FakeConsole commands. Meaning commands using SetClassProperty won't effect any units added with AddHeroClass. I posted about it in the v1.3 topic a few weeks ago.
That explains it. Thanks Zerted.
STAFF: this topic can be
locked now.