Results 1 to 7 of 7

Thread: Hud indicator

  1. #1
    Wire Noob quotable's Avatar
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    27

    Arrow

    Hud indicator doesn't work it shows some text in console and I will copy it later today here.
    92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature.

    98% of teens smoke, or have smoked before in their life. If you are part of the 2% that hasn't/doesn't, copy this into your sig.

    Visit here www.gamersdreamforum.tk
    It's my own forum that isn't fully ready yet so I need people to help improve it.

  2. #2
    GMech Developer InfectiousFight's Avatar
    Join Date
    Jun 2007
    Location
    Houston, TX
    Posts
    537

    Default

    It's been broken since I first started using Wiremod in August, and it doesn't look like anyone will ever fix. Bad luck, man.

  3. #3
    Wirererer -Gamah's Avatar
    Join Date
    Oct 2007
    Posts
    391

    Default

    I've used it dozens of times since august.... please post console dump.

  4. #4
    Wire Amateur MagnetoHydroDynamics's Avatar
    Join Date
    Jan 2008
    Location
    Mars, Easth Hellas settlement
    Posts
    95

    Default

    It says:

    entities/gmod_wire_hudindicator/cl_init.lua:167: bad argument #1 to 'GetTextSize' (string expected, got nil)

    Apparently ther are no definitoin of the text size in the script, i think it would be easy to fix.

    If you need further info here's the script that's wrong:

    local function HUDFormatDescription( eindex )
    // This is placed here so we don't have to update
    // the description more often than is necessary
    local indinfo = hudindicators[eindex]
    if (indinfo.ShowValue == 0) then // No Value
    hudindicators[eindex].FullText = indinfo.Description
    elseif (indinfo.ShowValue == 1) then // Percent
    hudindicators[eindex].FullText = indinfo.Description.." ("..string.format("%.1f", ((indinfo.Factor or 0) * 100)).."%)"
    elseif (indinfo.ShowValue == 2) then // Value
    // Round to up to 2 places
    hudindicators[eindex].FullText = indinfo.Description.." ("..string.format("%g", math.Round((indinfo.Value or 0) * 100) / 100)..")"
    end

    // Do any extra processing for certain HUD styles
    // so we aren't calculating this every frame
    surface.SetFont("Default")
    local textwidth, _ = surface.GetTextSize(hudindicators[eindex].FullText) <---- THIS IS APPARENTLY WRONG

    if (indinfo.Style == 1) then // Gradient
    local ent = ents.GetByIndex(eindex)
    if (ent && ent:IsValid()) then
    local r, g, b, _ = ent:GetColor()
    hudindicators[eindex].DisplayColor = Color(r, g, b, 160)

    local textcolor = Color(255, 255, 255, 255)
    if (r >= 192 && g >= 192 && b >= 192) then
    // Draw dark text for very bright Indicator colors
    textcolor = Color(32, 32, 32, 255)
    end

    hudindicators[eindex].TextColor = textcolor
    end
    elseif (indinfo.Style == 2) then // Percent Bar
    local pbarwidth = math.max(textwidth + 16, 100) // The extra 16 pixels is a "buffer" to make it look better
    hudindicators[eindex].BoxWidth = pbarwidth
    hudindicators[eindex].W1 = math.floor((indinfo.Factor or 0) * pbarwidth)
    hudindicators[eindex].W2 = math.ceil(pbarwidth - hudindicators[eindex].W1)
    elseif (indinfo.Style == 3) then // Full Circle Gauge
    local ang = math.rad(math.fmod((indinfo.Factor or 0) * 360 + (indinfo.FullCircleAngle or 0), 360))
    hudindicators[eindex].LineX = math.cos(ang) * 32
    hudindicators[eindex].LineY = math.sin(ang) * 32
    hudindicators[eindex].BoxWidth = math.max(textwidth + 16, 80)
    elseif (indinfo.Style == 4) then // Semi-Circle Gauge
    local ang = math.rad((indinfo.Factor or 0) * 180 + 180)
    hudindicators[eindex].LineX = math.cos(ang) * 32
    hudindicators[eindex].LineY = math.sin(ang) * 32
    hudindicators[eindex].BoxWidth = math.max(textwidth + 16, 80)
    end
    end

    // Function to ensure that the respective table index is created before any elements are added or modified
    // The HUDIndicatorRegister umsg is *supposed* to arrive (and be processed) before all the others,
    // but for some reason (probably net lag or whatever) it isn&#39;t (TheApathetic)
    local function CheckHITableElement(eindex)
    if (!hudindicators[eindex]) then
    hudindicators[eindex] = {}
    end
    end
    Current learning status:
    Expression chip: Grand master (seriously, I can rival Syranide) Lua: Qute good CPU: I get it... I think, But why the registers? Moongate: I'll look into it when i get time...
    My IQ is 146 - Free-IQTest.net
    Quote Originally Posted by l3ulletje View Post
    How much more "Not there" do you want it to be?
    Code:
    ents.GetByIndex(0):Remove()


  5. #5
    Wire Noob quotable's Avatar
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    27

    Default

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>
    entities/gmod_wire_hudindicator/init.lua:160: bad argument #1 to &#39;String&#39; (string expected, got nil)

    Error - Starting new message without ending the old one!
    entities/gmod_wire_hudindicator/cl_init.lua:167: bad argument #1 to &#39;GetTextSize&#39; (string expected, got </div>

    Oh you made it first. I have samekind console text I c/p it directly from console
    92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature.

    98% of teens smoke, or have smoked before in their life. If you are part of the 2% that hasn't/doesn't, copy this into your sig.

    Visit here www.gamersdreamforum.tk
    It's my own forum that isn't fully ready yet so I need people to help improve it.

  6. #6
    Wire Amateur CapsAdmin's Avatar
    Join Date
    Mar 2007
    Posts
    79

    Default

    I&#39;m getting that error as well sometimes. It works if I just load the default preset and remake it.


    Code:
    entities/gmod_wire_hudindicator/cl_init.lua:167: bad argument #1 to &#39;GetTextSize&#39; (string expected, got nil)

  7. #7
    Wire Amateur zzzdude's Avatar
    Join Date
    Jul 2007
    Posts
    58

    Default

    It rarely works for me, same error, but randomly it DOES work, like on LAN servers (when a friend copies my gmod folder and uses it on the server since I am the only one who knows how to make everything work)

Similar Threads

  1. HUD Indicator help
    By Amaroq in forum Installation and Malfunctions Support
    Replies: 13
    Last Post: 08-23-2008, 02:18 PM
  2. So is anybody gonna fix the hud indicator or what?
    By ins in forum Bug Reports Archive
    Replies: 10
    Last Post: 12-15-2007, 07:28 PM
  3. HUD Indicator bug
    By andy1976uk in forum Bug Reports Archive
    Replies: 0
    Last Post: 11-21-2007, 03:54 PM
  4. HUD indicator error
    By Kyzer in forum Bug Reports Archive
    Replies: 8
    Last Post: 10-11-2007, 07:32 AM
  5. LED indicator
    By HAMMY in forum Wiremod Addons & Coding
    Replies: 12
    Last Post: 06-21-2007, 03:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots