Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: Tidus on August 21, 2013, 11:54:55 pm

Title: removing a race at character select
Post by: Tidus on August 21, 2013, 11:54:55 pm
I've been trying to remove a few classes (I know I know unusual) by using the two class and one race tutorials as a kind of guide.  I would've thought it'd be fairly simple lua and xml editing and it might be.  I just can't get it to work.

Using Khira's tutorial as a guide (since it's closest) here's what I've done.  I'm using the existing player races.  I still haven't decided which ones will be used in the final edit.  For now I just want 4.  Two horde and two alliance.  Let's say human, night elf, orc, and tauren.  They're all playable races already so no need to edit the chrRaces.dbc or the charBaseInfo.dbc as I'm fine with the class combinations for now.  Hence why it should all be lua/xml editing.

Don't need to worry about the gluestrings.lua since it's already filled in.  Only the charactercreate lua and xml should need editing according to the tutorial.

So first is charactercreate.lua.  Made the max_races = 4.  The portraits are fine so that should be all the editing necessary there.

Now on to the charactercreate.xml.  I want humans (#1), night elves (#3), orcs (#6), and tauren (#8).  So those are the buttons I'd still want to keep I presume.  So my charactercreateracebuttons are as follows:

<CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="-50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton3" inherits="CharacterCreateRaceButtonTemplate" id="3">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton1" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton6" inherits="CharacterCreateRaceButtonTemplate" id="6">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton8" inherits="CharacterCreateRaceButtonTemplate" id="8">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton6" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>

The result:

There's only the two race buttons, which is good.  I guess from the error that there's an issue with the other race buttons still being referenced, but I don't have a clue where that might be in the lua or xml to edit out.  Hope someone can help.  Thanks!
Title: Re: removing a race at character select
Post by: 40thzombie on August 23, 2013, 12:02:03 pm
To remove it (speaking from my own personal experience) Requires no lua editing at all i have removed a couple of classes by deleting that line of the ChrClasses.Dbc

For example if i wanted to get rid of warlock i would delete Row 9

Races im not too sure on but i believe that editing column 1 on the race you want gone and changing it from 12 to something else like 5 gets rid of it, however there is probably some lua editing in this one because when i tried to do it it ended up like this

(http://i.imgur.com/8lYSqFR.jpg)
Title: Re: removing a race at character select
Post by: 40thzombie on August 23, 2013, 03:08:35 pm
Ok so i managed to do what you wanted, will post what i did

1. Edit the ChrRaces.dbc column 1 change the 12 to anything else for the ones you want to disable

2. Find CharacterCreate.lua and change the MAX_RACES = to 4 then find

RACE_ICON_TCOORDS = {

Delete all the icon cords that arnt needed so if the races you want to keep enabled are the Human, Nightelf, Tauren and orc so it would look like this

RACE_ICON_TCOORDS = {
   ["HUMAN_MALE"]      = {0, 0.125, 0, 0.25},
   ["NIGHTELF_MALE"]   = {0.375, 0.5, 0, 0.25},
   
   ["TAUREN_MALE"]      = {0, 0.125, 0.25, 0.5},
   ["ORC_MALE"]      = {0.375, 0.5, 0.25, 0.5},

   ["HUMAN_FEMALE"]   = {0, 0.125, 0.5, 0.75},  
   ["NIGHTELF_FEMALE"]   = {0.375, 0.5, 0.5, 0.75},
   
   ["TAUREN_FEMALE"]   = {0, 0.125, 0.75, 1.0},  
   ["ORC_FEMALE"]      = {0.375, 0.5, 0.75, 1.0},
};

Save it and close it

3. Find CharacterCreate.xml

then find <CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1">

Replace that with

                     <CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="-50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton2" inherits="CharacterCreateRaceButtonTemplate" id="2">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton1" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton3" inherits="CharacterCreateRaceButtonTemplate" id="3">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton4" inherits="CharacterCreateRaceButtonTemplate" id="4">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton3" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>

Pack it into a MPQ Then it should work

Here is what it should look like

(http://i.imgur.com/W4R2DV1.jpg)
Title: Re: removing a race at character select
Post by: Hardisk on August 25, 2013, 09:45:13 am
Nice ! I was gonna try and find a solution myself then I found this thread :D

Any idea how to resize the Ally/Horde flag so it fits the icons ? And actually how to resize the entire race/class/character style tooltip ? Since I have less races there's no need for it to go down to the bottom , it can stop before.

Thanks!
Title: Re: removing a race at character select
Post by: XxXGenesisXxX on August 25, 2013, 11:28:15 am
Both flags are apart of a single image. If you were to scale it in any way, the whole image would scale and end up askew (Or at the very least unclean). Your best bet is to just extract the blp, convert it to png, and edit it down in size buy cutting a section out.
Title: Re: removing a race at character select
Post by: Tidus on August 27, 2013, 02:08:23 pm
Thanks!
Title: Re: removing a race at character select
Post by: Swampdog on December 26, 2013, 05:20:12 am
Quote from: "40thzombie"
Ok so i managed to do what you wanted, will post what i did

1. Edit the ChrRaces.dbc column 1 change the 12 to anything else for the ones you want to disable

2. Find CharacterCreate.lua and change the MAX_RACES = to 4 then find

RACE_ICON_TCOORDS = {

Delete all the icon cords that arnt needed so if the races you want to keep enabled are the Human, Nightelf, Tauren and orc so it would look like this

RACE_ICON_TCOORDS = {
   ["HUMAN_MALE"]      = {0, 0.125, 0, 0.25},
   ["NIGHTELF_MALE"]   = {0.375, 0.5, 0, 0.25},
   
   ["TAUREN_MALE"]      = {0, 0.125, 0.25, 0.5},
   ["ORC_MALE"]      = {0.375, 0.5, 0.25, 0.5},

   ["HUMAN_FEMALE"]   = {0, 0.125, 0.5, 0.75},  
   ["NIGHTELF_FEMALE"]   = {0.375, 0.5, 0.5, 0.75},
   
   ["TAUREN_FEMALE"]   = {0, 0.125, 0.75, 1.0},  
   ["ORC_FEMALE"]      = {0.375, 0.5, 0.75, 1.0},
};

Save it and close it

3. Find CharacterCreate.xml

then find <CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1">

Replace that with

                     <CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="-50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton2" inherits="CharacterCreateRaceButtonTemplate" id="2">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton1" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton3" inherits="CharacterCreateRaceButtonTemplate" id="3">
                        <Anchors>
                           <Anchor point="TOP" relativePoint="TOP" x="50" y="-61"/>
                        </Anchors>
                     </CheckButton>
                     <CheckButton name="CharacterCreateRaceButton4" inherits="CharacterCreateRaceButtonTemplate" id="4">
                        <Anchors>
                           <Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceButton3" relativePoint="BOTTOMLEFT" x="0" y="-21"/>
                        </Anchors>
                     </CheckButton>

Pack it into a MPQ Then it should work

Anyone had luck getting this to work lately?  One thing I noticed is that it looks like columns are different in my  3.3.5a (12340) chrRaces.dbc.  Column one is the race ID and column 2 is the one that I can enable and disable races.  Other than that, I followed this list verbatim but am getting a LUA error and alll the class buttons are showing the entire BLP instead of their individual class icons (same with the race and class round icons above the descriptions).

The error I'm getting is "InterfaceGlueXMLCharacterCreate.lua: 257: attempt to index a nil value"

Line 257 is the getglobal function for CharacterCreateRaceButton when the id comparison to the for loop iterator is false.

My MAX_RACES is set to 4 (only using human, dwarf, orc, and blood elf initially)
My BLPs have been edited to remove the other races
My RACE_ICON_TCOORDS have been updated to pull from the correct BLP positions (the four races show up correctly on the flags and the gender icons are correct then everything goes to hell lol)
The frame definitions match what is posted verbatim
All races except the four mentioned above have been set to 1 in chrRaces.DBC, the four above set to 12
Updated xml/lua files copied to Interface/GlueXML within my MPQ build folder
Updated BLP files copied into Interface/GLUES/CHARACTERCREATE within my MPQ build folder
Updated usrRaces.dbc file copied into DBFilesClient within my MPQ build folder
Patch-enUS-4.MPQ created within my Client335aNoggit/Data/enUS folder

I have made no changes serverside since I am just removing access to races from the client creation process. I did start setting up my dev environment for serverside today though but am currently using Steff's Trinity compile that comes within the Noggit tutorial download.

Also it appears that the gender buttons have quit working.  The only icons that show are female and when I click Male, I get another lua error: "InterfaceGlueXMLCharacterCreate.lua: 413: attempt to index global 'CharacterCreateGenderButtonMaleHighlightSetText ..."  (can't read where ... is...  close button covers it up)..  But that line of code is within the SetCharacterGender function when the female button is pressed.

Thanks in advance for any thoughts and/or suggestions!
Title: Re: removing a race at character select
Post by: Vlad on December 28, 2013, 02:27:51 am
Oh, the memories. <3 I love these errors.

(http://gyazo.com/d9570273ca33dd5cc7253c622c056875.png)
Title: Re: removing a race at character select
Post by: caduceus on December 30, 2013, 08:21:38 pm
I am trying to figure this out as well, where do you get the CharacterCreateRaceButtonTemplate ID? what is it based from. I keep getting the same error when I try to remove a race button.
Title: Re: removing a race at character select
Post by: Swampdog on December 30, 2013, 08:42:41 pm
If you set up your modding environment like Steff outlined in the Noggit tutorial, the template files are in D:WoWModdingClientFilesInterfaceGLUESCHARACTERCREATE where D: would be whatever drive you set it up in.  (In my case D:)

The files used by the character create screen are UI-CharacterCreate-Races.blp and UI-CharacterCreate-RacesRound.blp for races.  There are no IDs.  All race icons are in a single file.  Top row are male alliance, second row are male horde, third row are female alliance, and fourth row are female horde.

The way the UI knows what to display is controlled by the RACE_ICON_TCOORDS section within D:WoWModdingClientFilesInterfaceGlueXMLCharacterCreate.LUA.

I think the class icons are done the same way but I'm still stuck on what is causing my problem above.  My race icons display fine but something seems to have broken the gender selection process.  Spent two days on trying to figure it out and then gave up for now since nobody had any suggestions to offer... :(
Title: Re: removing a race at character select
Post by: Swampdog on December 30, 2013, 08:52:59 pm
This is a screenie of what I'm getting with my issue:

(http://imageshack.com/a/img822/8587/fvlu.jpg)
Title: Re: removing a race at character select
Post by: caduceus on December 30, 2013, 09:01:14 pm
But what I am asking is how do you figure out what order that the  RACE_ICON_TCOORDS are calling? I understand where all the files are & how to acquire them. My problem is them when I remove from CharacterCreate.xml

Code: [Select]
example: <CheckButton name="CharCreateRaceButton9" inherits="CharCreateRaceButtonTemplate" id="9">
<Anchors>
    <Anchor point="TOP" x="-42" y="-530"/>
</Anchors>
</CheckButton>

and

<CheckButton name="CharCreateClassButton9" inherits="CharCreateClassButtonTemplate" id="9">
<Anchors>
    <Anchor point="TOPLEFT" relativeTo="CharCreateClassButton8" relativePoint="BOTTOMLEFT" x="0" y="-18"/>
</Anchors>

I receive the same error as the original post.

Attempt to indexlocal 'button' (a nil value). Being unexperienced in UI work, I have no idea how the races are called per button.
Title: Re: removing a race at character select
Post by: Swampdog on December 30, 2013, 09:11:39 pm
The ID numbers are not race specific.  Mine are 1-4 and it still displays my blood elf icon which is race 8 in the chrRaces.dbc..  The CharacterRaceButtonTemplate is an XML template that I think is defined within the same XML file you are editing.  The only thing that it does is set up default frame properties and such which the code you posted inherits.  It doesn't really have anything to do with what image file is being called.
Title: Re: removing a race at character select
Post by: Portals on January 05, 2014, 06:09:39 am
Can someone do a tutorial like this for classes, I tried deleting a line from chrclasses.dbc but my wow crashes when I go to create a character.
Title: Re: removing a race at character select
Post by: Swampdog on January 05, 2014, 06:26:19 am
Quote from: "Portals"
Can someone do a tutorial like this for classes, I tried deleting a line from chrclasses.dbc but my wow crashes when I go to create a character.

Haven't seen one on removing a class but I have this one bookmarked for class creation..  It might give all the places you need to edit and such...

viewtopic.php?f=26&t=1840&hilit=Shell (http://modcraft.io/viewtopic.php?f=26&t=1840&hilit=Shell" onclick="window.open(this.href);return false;)
Title: Re: removing a race at character select
Post by: Portals on January 05, 2014, 06:53:25 am
Quote from: "Swampdog"
Quote from: "Portals"
Can someone do a tutorial like this for classes, I tried deleting a line from chrclasses.dbc but my wow crashes when I go to create a character.

Haven't seen one on removing a class but I have this one bookmarked for class creation..  It might give all the places you need to edit and such...

viewtopic.php?f=26&t=1840&hilit=Shell (http://modcraft.io/viewtopic.php?f=26&t=1840&hilit=Shell" onclick="window.open(this.href);return false;)

Still no help I am really new to this shit haha.
Title: Re: removing a race at character select
Post by: salagon on January 20, 2014, 05:35:12 pm
all those errors mean is you guys used an old version of the lua. Use either the ones from patch-enUS-3.MPQ or locale-enUS.MPQ.
Title: Re: removing a race at character select
Post by: stoneharry on January 26, 2014, 02:52:06 pm
The button IDs map to the class/race DBC's, from what I remember. Or something similar. So when you have a button or class for that which doesn't exist in the DBFilesClient, the client crashes.

The Lua errors are quite clear. You are moaning about them but not reading them.

It tells you the line number and the error - a nil value means that it is trying to use something that doesn't exist. Look at that line of code and the code around it, you can use the "message" function to display debug information to the screen. Usually when you fix the error the rest of the code executes fine and it goes from completely non-functional to perfect instantly.

A tip would be to not rely on "reloadui" from console when doing changes. It does give you a quick look at what you changed but it seems to render it in a different order to when the char creation screen is first loaded up on a new instance of WoW. I had a lot of issues trying to figure out why it would only sometimes work until I realised this then quickly fixed the issues.
Title: Re: removing a race at character select
Post by: caduceus on February 21, 2015, 12:56:48 am
[Solved]

So  I have the same issue.  Are the button ID's direct with the  CharRace.dbc ID's? Any help is greatly appreciated.

(http://i57.tinypic.com/16kw087.jpg)

Code: [Select]
<CheckButton name="CharCreateRaceButton1" inherits="CharCreateRaceButtonTemplate" id="1">
<Anchors>
<Anchor point="TOP" x="-42" y="-110"/>
</Anchors>
</CheckButton>
<CheckButton name="CharCreateRaceButton2" inherits="CharCreateRaceButtonTemplate" id="2">
<Anchors>
<Anchor point="TOP" x="-42" y="-170"/>
</Anchors>
</CheckButton>

The above entries are attaching to the left column first & second buttons which is Allience Human & Dwarf.  
However if the id's are going by the CharRace.dbc, this whould be Human & Orc. I'm completely turned around.