This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [HELP] Third Side( Scourge faction) for WoW  (Read 2191 times)

Supora

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 143
    • View Profile
[HELP] Third Side( Scourge faction) for WoW
« on: December 09, 2013, 05:22:06 pm »
Hey guys. Some days ago I've started to trying to add new faction for WoW. I've already done with dbc's and some core stuff but I can't compile my sources because of  error. Original sources contain this part:
Code: [Select]
       static uint32 TeamForRace(uint8 race);
        uint32 GetTeam() const { return m_team; }
        TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
        void setFactionForRace(uint8 race);
And I've changed it to:
Code: [Select]
       static uint32 TeamForRace(uint8 race);
        uint32 GetTeam() const { return m_team; }
TeamId GetTeamId() const { if ( m_team == ALLIANCE ) { return TEAM_ALLIANCE; } else if ( m_team == HORDE ) { return TEAM_HORDE;} else if ( m_team == SCOURGE ) { return TEAM_SCOURGE;} else { return TEAM_ALLIANCE;} }
        void setFactionForRace(uint8 race);
Maybe it's not a good solution but( I'm not really good at c++)...
And there I've got an error: 'SCOURGE' is undeclared identifier and the same with TEAM_SCOURGE. But I've already edited enum of Team and TeamID in SharedDefines.h(pic). In Visual Studio it shows this values.
Here is the pic:

So maybe someone can help me to fix this.
Thanks
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Morfium

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 96
    • View Profile
Re: [HELP] Third Side( Scourge faction) for WoW
« Reply #1 on: December 12, 2013, 03:33:06 pm »
Hey since nobody answered you I'll give it a shot. :)
Your code looks right, except that the default value is horde in the initial code and alliance in yours, but that shouldn't really matter.

It might be the case, that visual studio is unable to to understand the needed order to compile.
That means: If you rightclick your sollution and just create the whole sollution it will try to create each subporject at a time. If your changes to m_team are in a subproject that is compiled after your posted code, then this error might pop up.
So the best way would be to compile the subprojects in order, or at least the one with your enum at first and then the whole sollution afterwards.

I hope that was understandable. >_<
Intellisense might have been updated even if  the binaries are still the old uncompiled ones. :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Mr. DK

  • Moderators
  • Model Change Addict
  • *****
  • Posts: 224
    • View Profile
Re: [HELP] Third Side( Scourge faction) for WoW
« Reply #2 on: December 13, 2013, 01:20:10 am »
I kinda dont get why you have 2 cases retuning Alliance... I think the last else is unnecessary.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
I am Thor! Supreme commander of the Asgard Fleet!

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [HELP] Third Side( Scourge faction) for WoW
« Reply #3 on: December 13, 2013, 01:48:07 am »
Right away...

Code: [Select]
  TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : m_team == HORDE ? TEAM_HORDE : TEAM_SCOURGE; }

Worked flawlessly for me. Also, just keep the Team enum numbered as it is and just add Scourge as team to the bottom. But that's more codestyle than what not.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Supora

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 143
    • View Profile
[SOLVED] [HELP] Third Side( Scourge faction) for WoW
« Reply #4 on: December 22, 2013, 02:05:18 pm »
Thnx Ascathos. Your code worked just fine. Here is the result:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »