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: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.  (Read 1425 times)

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
[PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« on: April 04, 2014, 05:43:25 pm »
Hello Guys!

I just finished making another custom race on my server and it gives me this error in game on a different race for some reason.
It gives me the error in the picture below when I click on the Undead.

PICTURE


The error says that it is somewhere in the CharacterCreate.lua
So here is my CharacterCreate.lua

LINKS
CharacterCreate.lua - http://pastebin.com/QAWfMRXU

So how can I fix this?
can someone fix it for me and then re-upload it to a Pastebin and provide a link?

Please fix it for me or tell me a Newbie Guide for beginners (cuz I dunno lua so much).

If you want to help me in person, then add me on Skype.

My Skype Name : Waseem9116


Thank You! :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #1 on: April 04, 2014, 06:59:10 pm »
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #2 on: April 05, 2014, 12:08:18 am »
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #3 on: April 05, 2014, 02:03:21 pm »
Quote from: "spiderwaseem"
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.

It is impossible for it to be the same error if you tried what I said.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #4 on: April 05, 2014, 04:37:36 pm »
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.

It is impossible for it to be the same error if you tried what I said.

Ok, I tried again and I got this error below.
That is the error I get when I click on the Undead :
http://i.imgur.com/uFIjRfh.jpg
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #5 on: April 05, 2014, 04:52:16 pm »
Quote from: "spiderwaseem"
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.

It is impossible for it to be the same error if you tried what I said.

Ok, I tried again and I got this error below.
That is the error I get when I click on the Undead :
http://i.imgur.com/uFIjRfh.jpg

Nothing is displaying so I guess faction is returning nil.

Try adding this above the message:

Code: [Select]
if not faction then faction = "Alliance"; end
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #6 on: April 06, 2014, 11:22:03 pm »
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.

It is impossible for it to be the same error if you tried what I said.

Ok, I tried again and I got this error below.
That is the error I get when I click on the Undead :
http://i.imgur.com/uFIjRfh.jpg

Nothing is displaying so I guess faction is returning nil.

Try adding this above the message:

Code: [Select]
if not faction then faction = "Alliance"; end

ok, So Now it looks like this :

   -- Set backdrop colors based on faction
   if not faction then faction = "Alliance"; end
   message(faction)
   local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];
   local frame;
   for index, value in pairs(FRAMES_TO_BACKDROP_COLOR) do
      frame = _G[value];
      frame:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]);
   end
   CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);

   local backgroundFilename = GetCreateBackgroundModel();
   SetBackgroundModel(CharacterCreate, backgroundFilename);
end


And in game it gives me this when I click on Undead :

PICTURE : http://i.imgur.com/vwHBNXe.jpg

Any other Ideas?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [PROBLEM] CharacterCreate.lua Error. Please Help ASAP.
« Reply #7 on: April 07, 2014, 01:11:49 am »
Quote from: "spiderwaseem"
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
Quote from: "spiderwaseem"
Quote from: "stoneharry"
It says on line 302 backdropColor is said but is not defined.

If you go to line 302 we see this:

Code: [Select]
CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
You can see backdropColor is indexed at locations 4, 5, and 6. Each time backdropColor is 'nil' so has no value. Thus the error.

If we look up a bit we can see where backdropColor is defined:

Code: [Select]
       -- Set backdrop colors based on faction
        local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];

So you need to modify where FACTION_BACKDROP_COLOR_TABLE is defined for the faction.

At the top of the file we can see this:

Code: [Select]
FACTION_BACKDROP_COLOR_TABLE = {
        ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
        ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
};

So there is data for "Alliance" and "Horde" but not whatever you are passing in.

If you add the following line of code on line 297 then it should tell you what is being passed into that table:

Code: [Select]
message(faction)
You might also want to check if faction is nil.

Code: [Select]
if not faction then faction = "Alliance"; end


Hmm, I tried to do what you said but I still end up with the same error.

Is it fine if u could try to fix it for me and then re-upload it to Pastebin?
I would really appreciate that.

It is impossible for it to be the same error if you tried what I said.

Ok, I tried again and I got this error below.
That is the error I get when I click on the Undead :
http://i.imgur.com/uFIjRfh.jpg

Nothing is displaying so I guess faction is returning nil.

Try adding this above the message:

Code: [Select]
if not faction then faction = "Alliance"; end

ok, So Now it looks like this :

   -- Set backdrop colors based on faction
   if not faction then faction = "Alliance"; end
   message(faction)
   local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];
   local frame;
   for index, value in pairs(FRAMES_TO_BACKDROP_COLOR) do
      frame = _G[value];
      frame:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]);
   end
   CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);

   local backgroundFilename = GetCreateBackgroundModel();
   SetBackgroundModel(CharacterCreate, backgroundFilename);
end


And in game it gives me this when I click on Undead :

PICTURE : http://i.imgur.com/vwHBNXe.jpg

Any other Ideas?

Looks like it is working to me, if a little hackfixed...

Remove this line to get rid of the debug message:

"message(faction)"

The fact it is displaying a blood elf is because that XML button ID maps to that DBC record.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »