Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Miscellaneous => Topic started by: flagg78 on February 03, 2014, 11:47:08 pm
-
ok im not fluent in any code but have done some programing long ago. with out going into all the back story of why, all i want to do is to have a different background model for males and females in the character select and creation screens. I have narrowed it down to the GlueParent.lua. in fact its this section here:
function SetBackgroundModel(model, name)
local nameupper = strupper(name);
local path;
SetSelectedSex(sex);
if ( sex == SEX_MALE ) then
path = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_Male.m2";
else
path = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_Female.m2";
end
if ( model == CharacterCreate ) then
SetCharCustomizeBackground(path);
else
SetCharSelectBackground(path);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end
this is of course my edited version. since i dont know lua at all i dont know the syntax where im going wrong.
right now i get an error for the setselectedsex line. if i take it out the game will load fine but it always points to the female background model. never the male. i dont know quite what im doing wrong and could use some help. Thanks.
ok also tried this:
function SetBackgroundModel(model, name)
local nameupper = strupper(name);
local pathm = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_Male.m2";
local pathf = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_Female.m2";
if ( model == CharacterCreate ) then
if ( sex == SEX_MALE ) then
SetCharCustomizeBackground(pathm);
else
SetCharCustomizeBackground(pathf);
end
else
if ( sex == SEX_MALE ) then
SetCharSelectBackground(pathm)
else
SetCharSelectBackground(pathf)
end
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end
same result. always female background model.
-
I am not sure what variables they are, but is it SEX_MALE ? Iirc, it's sex == MALE
Correct me if I'm wrong.
EDIT:
function SetBackgroundModel(model, name)
local nameupper = strupper(name);
local gender;
SetSelectedSex(sex);
if ( sex == SEX_MALE ) then
gender = "male";
else
gender = "female";
end
local path = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_"..gender..".m2";
if ( model == CharacterCreate ) then
SetCharCustomizeBackground(path);
else
SetCharSelectBackground(path);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end
Does this help? Not sure, would be a test worth to me.
-
i did it...sort of. ill post it here and why so if someone wants to they can do it also.
ok so mainly i wanted it for the creation screen so i can alter the attachment points to the background models to allow for large character models. i will take the coords for the character attachment and just move it back or down to allow for large toons. i dont have any playable females. i replaced them to make room for more races. i dont play females anyway and its just me here. so here is the edit i made for the glueparent.lua.
function SetBackgroundModel(model, name)
local nameupper = strupper(name);
local path = "Interface\Glues\Models\UI_"..name.."\UI_"..name..".m2";
if ( model == CharacterCreate ) then
local path = "Interface\Glues\Models\UI_"..name.."\UI_"..name.."_"..gender..".m2";
SetCharCustomizeBackground(path);
else
SetCharSelectBackground(path);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
SetLighting(model, nameupper)
end
this way it will use the normal background on the select screen but altered ones when creating a character. to allow setting facial features and stuff. there might be a better way but this is the one i could find. thanks Ascathos. i couldnt have managed it out without your help. as i said, im no coder.