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: Sepperate Orc and Troll UI?  (Read 1875 times)

Joxus

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 80
    • View Profile
Sepperate Orc and Troll UI?
« on: September 30, 2014, 03:47:21 pm »
I'm trying to set the background of the Troll to the cata one, but it keeps using the Orc UI I don't really know how to refer to the troll race and I couldn't see anything obvious in the LUA.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #1 on: September 30, 2014, 04:25:14 pm »
Quote from: "Joxus"
I'm trying to set the background of the Troll to the cata one, but it keeps using the Orc UI I don't really know how to refer to the troll race and I couldn't see anything obvious in the LUA.

It's handled in GlueParent.lua as far as I remember.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Joxus

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 80
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #2 on: September 30, 2014, 04:59:34 pm »
Quote from: "stoneharry"
It's handled in GlueParent.lua as far as I remember.

All I could find was GlueAmbienceTracks["ORC"] = "GlueScreenOrcTroll", and the same for DwarfGnome. Not sure what I can do with that. Other than that, litteraly nothing with Troll in it so kind of stuck I guess.

I'm not sure if it's too simple to change this since I read on some post "I managed to sepperate orc and troll UI" though I don't remember where.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Joxus

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 80
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #3 on: September 30, 2014, 05:27:58 pm »
Okay, I tried it like this:

GlueAmbienceTracks["ORC"] = "GlueScreenOrc";
GlueAmbienceTracks["TROLL"] = "GlueScreenTroll";

And nothing changed. I have the map UI_Troll in my models folder.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #4 on: September 30, 2014, 07:22:04 pm »
Quote from: "Joxus"
Okay, I tried it like this:

GlueAmbienceTracks["ORC"] = "GlueScreenOrc";
GlueAmbienceTracks["TROLL"] = "GlueScreenTroll";

And nothing changed. I have the map UI_Troll in my models folder.

TROLL is not being parsed into it. Look at where the table is accessed from.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Joxus

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 80
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #5 on: October 02, 2014, 06:09:17 pm »
Quote from: "stoneharry"
TROLL is not being parsed into it. Look at where the table is accessed from.

Sorry, but I have no idea where the parse data comes from. Where does it get the names then?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #6 on: October 02, 2014, 06:20:50 pm »
In GlueParent.lua we can see this function:

Code: [Select]
-- Function to set the background model for character select and create screens
function SetBackgroundModel(model, name)
    local nameupper = strupper(name);
    local path = "Interface\Glues\Models\UI_"..name.."\UI_"..name..".m2";
if ( model == CharacterCreate ) then
SetCharCustomizeBackground(path);
else
SetCharSelectBackground(path);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end

This is loading the backgrond based on a name.

If we look for all references to this function we can see in CharacterSelect.lua:

Code: [Select]
function CharacterSelect_SelectCharacter(id, noCreate)
if ( id == CharacterSelect.createIndex ) then
if ( not noCreate ) then
PlaySound("gsCharacterSelectionCreateNew");
SetGlueScreen("charcreate");
end
else
CharacterSelect.currentModel = GetSelectBackgroundModel(id);
SetBackgroundModel(CharacterSelect,CharacterSelect.currentModel);

SelectCharacter(id);
end
end

And CharacterCreate.lua:

Code: [Select]
...
local backgroundFilename = GetCreateBackgroundModel();
SetBackgroundModel(CharacterCreate, backgroundFilename);
end

GetCreateBackgroundModel is an internal function. I believe it gets that data from the CharRaces.dbc, but that is a guess.

You could hack it by saying:

Code: [Select]
-- This line of code is already called in the same function in CharacterCreate
local race, fileString = GetNameForRace();

-- Use this data to hack it
if race == "TROLL" then
backgroundFilename = "TROLL"
end

If you want to figure out what is in a variable, you can do this:

Code: [Select]
message(fileString);

Which displays it in a box.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Joxus

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 80
    • View Profile
Re: Sepperate Orc and Troll UI?
« Reply #7 on: October 13, 2014, 07:17:33 pm »
Quote from: "stoneharry"
In GlueParent.lua we can see this function:

Code: [Select]
-- Function to set the background model for character select and create screens
function SetBackgroundModel(model, name)
    local nameupper = strupper(name);
    local path = "Interface\Glues\Models\UI_"..name.."\UI_"..name..".m2";
if ( model == CharacterCreate ) then
SetCharCustomizeBackground(path);
else
SetCharSelectBackground(path);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end

This is loading the backgrond based on a name.

If we look for all references to this function we can see in CharacterSelect.lua:

Code: [Select]
function CharacterSelect_SelectCharacter(id, noCreate)
if ( id == CharacterSelect.createIndex ) then
if ( not noCreate ) then
PlaySound("gsCharacterSelectionCreateNew");
SetGlueScreen("charcreate");
end
else
CharacterSelect.currentModel = GetSelectBackgroundModel(id);
SetBackgroundModel(CharacterSelect,CharacterSelect.currentModel);

SelectCharacter(id);
end
end

And CharacterCreate.lua:

Code: [Select]
...
local backgroundFilename = GetCreateBackgroundModel();
SetBackgroundModel(CharacterCreate, backgroundFilename);
end

GetCreateBackgroundModel is an internal function. I believe it gets that data from the CharRaces.dbc, but that is a guess.

You could hack it by saying:

Code: [Select]
-- This line of code is already called in the same function in CharacterCreate
local race, fileString = GetNameForRace();

-- Use this data to hack it
if race == "TROLL" then
backgroundFilename = "TROLL"
end

If you want to figure out what is in a variable, you can do this:

Code: [Select]
message(fileString);

Which displays it in a box.

Excuse me for the late reply, I've been busy with school lately.

I've tried the hackfix but it didn't seem to be working, and yes it gets the strings from CharRaces.dbc, Troll is being parsed into it which I found out with the message(FileString); code.

I've even tried changing the names to a random one which worked, and the FileString also got changed to it without error, but litteraly nothing changed with the background (of course the model path/m2 filename was also changed to the word).

There is probably some other function that messes it up but I have no idea which.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »