"AddHeroClass" means what? [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

"AddHeroClass" means what? [Solved]

Post 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.
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Owning people in SWBF2
Contact:

Re: "AddHeroClass" means what?

Post 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)
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: "AddHeroClass" means what?

Post 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
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Owning people in SWBF2
Contact:

Re: "AddHeroClass" means what?

Post by Par3210 »

I don't think it's any different...
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: "AddHeroClass" means what?

Post 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.
User avatar
666rulerofclones
Command Sergeant Major
Command Sergeant Major
Posts: 281
Joined: Fri Aug 08, 2008 1:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: The Badger State!

Re: "AddHeroClass" means what?

Post 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.
Post Reply