PDA

View Full Version : Error in my layout.lua



Narghul
06-29-2007, 10:18 AM
----------------------------------------------------------------------------------------
-- Text Format Vars
-- (HP/MP text and status bars)
-- $miss = Missing hp/mp
-- $cur = current hp/mp
-- $max = Max hp/mp
-- $perc = Percent hp/mp
--
-- (Name/Level text)
-- $name = Name
-- $level = Level
-- $class = Class
-- $guild = Guild
-- $race = Race
-- $rname = PvP Rank Name
-- $rnum = PvP Rank Number
-- $key = Key Binding
--
-- Element Names
-- hp, mp, xp, combo, target
-- name, level, class, race
-- pvp, leader, master, feedback
-- group, status, buff, debuff
-- raidtarget, highlight, pet, portrait
--
-- StatusBar Animations-- glide
----------------------------------------------------------------------------------------

local function hudalpha()
if (event == "UNIT_HEALTH") and arg1 ~= "player" then return end
for _,v in pairs( { Nurfed_hudplayer, Nurfed_hudtarget, Nurfed_pet_hudframe } ) do
if not UnitAffectingCombat("player") then
if not UnitName("target") then
if (UnitHealth("player") == UnitHealthMax("player")) then
v:SetAlpha(0.0) --full, ooc, no target
else
v:SetAlpha(0.6) -- ooc, no target, NOT FULL
end
else
v:SetAlpha(0.8) -- OCC, Target
end
else
v:SetAlpha(1.0) -- IC
end
end
end

local f=CreateFrame("FRAME")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("UNIT_MANA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", hudalpha )

ManaBarColor[0] = { r = 0, g = 1, b = 1, prefix = TEXT(MANA) }; -- mana

if (not Nurfed_UnitsLayout) then

Nurfed_UnitsLayout = {};

Nurfed_UnitsLayout.Name = "|cffff0000Twin Dragons HUD|r";
Nurfed_UnitsLayout.Author = "Unknown - Updated: ElderBrE";

--Frame Design
Nurfed_UnitsLayout.Layout = {

hudplayer = {
type = "Button",
uitemp = "SecureUnitButtonTemplate",
vars = { unit = "player" },
size = { 200, 400 },
Mouse = false,
FrameStrata = "LOW",
Anchor = { "TOP", "$parent", "TOP", -200, -320 },
children = {
hp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 234 },
Texture = NRF_IMG.."dragon_player_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
--VertexColor = { 0.274, 0.274, 0.388, 0.90 },
vars = {
bar = 234,
height = 400,
width = 200,
fill = "top",
},
},
bg1 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_player_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
VertexColor = { 0, 0, 0, 0.75 },
},

mp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 222 },
Texture = NRF_IMG.."dragon_player_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", -2, -30 },
VertexColor = { 0.619, 0.619, 0.866, 1 },
vars = {
bar = 222,
height = 400,
width = 200,
fill = "top",
},
},
bg2 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_player_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", -2, -30 },
VertexColor = { 0, 0, 0, 0.75 },
},
},
},


hudtarget = {
type = "Button",
uitemp = "SecureUnitButtonTemplate",
vars = { unit = "target" },
size = { 200, 400 },
Mouse = false,
FrameStrata = "LOW",
Anchor = { "TOP", "$parent", "TOP", 200, -320 },
children = {
hp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 234 },
Texture = NRF_IMG.."dragon_target_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
--VertexColor = { 0.274, 0.274, 0.388, 0.90 },
vars = {
bar = 234,
height = 400,
width = 200,
fill = "top",
},
},
bg3 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_target_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
VertexColor = { 0, 0, 0, 0.75 },
},
mp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 222 },
Texture = NRF_IMG.."dragon_target_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, -30 },
--VertexColor = { 0.619, 0.619, 0.866, 0.60 },
vars = {
bar = 222,
height = 400,
width = 200,
fill = "top",
},
},
bg4 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_target_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, -30 },
VertexColor = { 0, 0, 0, 0.75 },
},
},
},
},
};
end


i'm getting an error in line 180 which is the second last line
[2007/06/29 15:06:51-845-x1]: Nurfed-1.1\Layout.lua:180: unexpected symbol near '}'


i also have a problem with the hud not disappearing when i have full hp full mana and no target

if any1 has a solution please let me know

Tenten
07-01-2007, 05:53 AM
----------------------------------------------------------------------------------------
-- Text Format Vars
-- (HP/MP text and status bars)
-- $miss = Missing hp/mp
-- $cur = current hp/mp
-- $max = Max hp/mp
-- $perc = Percent hp/mp
--
-- (Name/Level text)
-- $name = Name
-- $level = Level
-- $class = Class
-- $guild = Guild
-- $race = Race
-- $rname = PvP Rank Name
-- $rnum = PvP Rank Number
-- $key = Key Binding
--
-- Element Names
-- hp, mp, xp, combo, target
-- name, level, class, race
-- pvp, leader, master, feedback
-- group, status, buff, debuff
-- raidtarget, highlight, pet, portrait
--
-- StatusBar Animations-- glide
----------------------------------------------------------------------------------------

local function hudalpha()
if (event == "UNIT_HEALTH") and arg1 ~= "player" then return end
for _,v in pairs( { Nurfed_hudplayer, Nurfed_hudtarget, Nurfed_pet_hudframe } ) do
if not UnitAffectingCombat("player") then
if not UnitName("target") then
if (UnitHealth("player") == UnitHealthMax("player")) then
v:SetAlpha(0.0) --full, ooc, no target
else
v:SetAlpha(0.6) -- ooc, no target, NOT FULL
end
else
v:SetAlpha(0.8) -- OCC, Target
end
else
v:SetAlpha(1.0) -- IC
end
end
end

local f=CreateFrame("FRAME")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("UNIT_HEALTH")
f:RegisterEvent("UNIT_MANA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", hudalpha )

ManaBarColor[0] = { r = 0, g = 1, b = 1, prefix = TEXT(MANA) }; -- mana

if (not Nurfed_UnitsLayout) then

Nurfed_UnitsLayout = {};

Nurfed_UnitsLayout.Name = "|cffff0000Twin Dragons HUD|r";
Nurfed_UnitsLayout.Author = "Unknown - Updated: ElderBrE";

--Frame Design
Nurfed_UnitsLayout.Layout = {

hudplayer = {
type = "Button",
uitemp = "SecureUnitButtonTemplate",
vars = { unit = "player" },
size = { 200, 400 },
Mouse = false,
FrameStrata = "LOW",
Anchor = { "TOP", "$parent", "TOP", -200, -320 },
children = {
hp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 234 },
Texture = NRF_IMG.."dragon_player_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
--VertexColor = { 0.274, 0.274, 0.388, 0.90 },
vars = {
bar = 234,
height = 400,
width = 200,
fill = "top",
},
},
bg1 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_player_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
VertexColor = { 0, 0, 0, 0.75 },
},

mp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 222 },
Texture = NRF_IMG.."dragon_player_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", -2, -30 },
VertexColor = { 0.619, 0.619, 0.866, 1 },
vars = {
bar = 222,
height = 400,
width = 200,
fill = "top",
},
},
bg2 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_player_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", -2, -30 },
VertexColor = { 0, 0, 0, 0.75 },
},
},
},


hudtarget = {
type = "Button",
uitemp = "SecureUnitButtonTemplate",
vars = { unit = "target" },
size = { 200, 400 },
Mouse = false,
FrameStrata = "LOW",
Anchor = { "TOP", "$parent", "TOP", 200, -320 },
children = {
hp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 234 },
Texture = NRF_IMG.."dragon_target_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
--VertexColor = { 0.274, 0.274, 0.388, 0.90 },
vars = {
bar = 234,
height = 400,
width = 200,
fill = "top",
},
},
bg3 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_target_HP",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, 0 },
VertexColor = { 0, 0, 0, 0.75 },
},
mp = {
type = "Texture",
layer = "OVERLAY",
size = { 200, 222 },
Texture = NRF_IMG.."dragon_target_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, -30 },
--VertexColor = { 0.619, 0.619, 0.866, 0.60 },
vars = {
bar = 222,
height = 400,
width = 200,
fill = "top",
},
},
bg4 = {
type = "Texture",
size = { 200, 400 },
Texture = NRF_IMG.."dragon_target_mana",
Anchor = { "BOTTOMLEFT", "$parent", "BOTTOMLEFT", 0, -30 },
VertexColor = { 0, 0, 0, 0.75 },
},
},
},
},
};
end


i'm getting an error in line 180 which is the second last line
[2007/06/29 15:06:51-845-x1]: Nurfed-1.1\Layout.lua:180: unexpected symbol near '}'


i also have a problem with the hud not disappearing when i have full hp full mana and no target

if any1 has a solution please let me know
as the bars not disappearing as they should, there's a simple adjustment :> you can use any number from 0 -> 1. although not 1.0 or 0.0. so simply take away the ".0" parts of those numbers you've written.

as for the error, try this:



},

};
end

Narghul
07-01-2007, 07:07 AM
Making them 1 instead of 1.0 and 0 instead of 0.0 didn't help. About the error it is still there.. should i just put my info into the sample layout instead?

The error is: [2007/07/01 11:57:57-858-x1]: Nurfed-1.1\Layout.lua:181: unexpected symbol near '}'
now..

N00bZXI
07-01-2007, 09:02 AM
You're missing a comma somewhere.

Narghul
07-01-2007, 05:51 PM
Could you tell me where? i can't localize the spot where i miss a comma.. and i still have that problem with my HUD not disappering when i have full hp, mana and no target and ooc..

Please help :D

if any1 is up for it could you make a layout for me with my info, and without the errors? :D

Tenten
07-05-2007, 06:40 PM
i might know why ur hud isnt dissapearing. your playing warrior? if so, take away the unit_mana text in the layout file. causing me the same 'bug' it think that rage is the same as mana -> when not 100% rage ur still regening :P

Narghul
07-06-2007, 12:42 PM
nope i'm playing a druid :D

a67rhf7823jn8747==