UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: mobofthedead123 on January 28, 2020, 08:01:16 am

Title: My HUD element is not appearing in game
Post by: mobofthedead123 on January 28, 2020, 08:01:16 am
Code Snippet
cpp
function location_display_text()
{
    hint_hud = NewClientHudElem(self);
    hint_hud.fontScale = 2;
    hint_hud.alignX = "left";
    hint_hud.alignY = "top";
    hint_hud.horzAlign = "left";
    hint_hud.vertAlign = "top";
    hint_hud.x = 2;
    hint_hud.y = 2;
    text = undefined;
    while(1)
    {
        text = self get_location_text();
        hint_hud SetText( text );
        wait .1;
    }
}

function get_location_text()
{
    text = undefined;
    zone_name = undefined;
    location_text_zones = getentarray("location_text_zones","targetname");
    for( z=0; z<location_text_zones.size; z++ )
    {
        if (self IsTouching(location_text_zones[z]) )
            zone_name = location_text_zones[z].script_noteworthy;
    }

    switch( zone_name )
    {
        case "start_zone":
            text = "Communications Office";
            break;

        //case "power":
            //text = "Power Room";
            //break;

        default:
            text = "Zone Not Recognized";
            break;
    }

    return text;
}
I have added a custom script into my BO3 mod but my HUD element is not working and the text is not displaying in game. I am trying to add the location name into the top left corner like in Black Ops 4. Someone wrote this script for me and it worked perfectly in WAW but it doesn't work here in BO3. How would I change this script to make it show the text?