meowgli

REQUEST SOMETHING LUA

161 posts in this topic

What d'you have in mind for a low ammo indicator? I'm always happy to add stuff to DP2HUD that people want.

Sorry to hijack your thread, Meowgli!

​whoops. Missed this post by a month or two.

 

I'm after anything that draws my attention to when a certain weapon is low on ammo. Currently I don't really notice until I've fired my last shot and clicked two or three times, unless I go out of my way to check periodically.

 

What currently comes to mind as something good would be having the pipe (including the colored box around your ammo count) flash if your equipped weapon is low on ammo, and having the number turn red or orange if it's not equipped.

Edited by doombro

Share this post


Link to post
Share on other sites

​whoops. Missed this post by a month or two.

 

I'm after anything that draws my attention to when a certain weapon is low on ammo. Currently I don't really notice until I've fired my last shot and clicked two or three times, unless I go out of my way to check periodically.

 

What currently comes to mind as something good would be having the pipe (including the colored box around your ammo count) flash if your equipped weapon is low on ammo, and having the number turn red or orange if it's not equipped.

​I'll play with stuff and see if I can find something that looks good. Problem with using colours is that everything is colour-coded by weapons.

Share this post


Link to post
Share on other sites

Just another idea for a simple one.

Have a widget that executes a list/line of cvars based on certain gamestates like if you go spectator it turns gibs and graphics up or if you are in editor it turns on bloom and dynamic lights. Or if you are in a specific map like monolith it can turn dynamic lights off or clear the light map when you are not spectating. The cvars would be up to the user just pasting them into the lua file.

Skytoon, DraQu, Terifire and 1 other like this

Share this post


Link to post
Share on other sites

not sure if lua makes this possible, but a quickswitch key would help a lot of cs:go players transition. often times hard to switch between 1 and 7 often without using scroll wheel, sometimes quickswitch is useful.

 

incase you need more detail, quickswitch as in switches to last weapon out.

Share this post


Link to post
Share on other sites
On 30-12-2015 at 0:55 AM, nitro said:

not sure if lua makes this possible, but a quickswitch key would help a lot of cs:go players transition. often times hard to switch between 1 and 7 often without using scroll wheel, sometimes quickswitch is useful.

 

incase you need more detail, quickswitch as in switches to last weapon out.

Most people have weapons bound to other keys, I move with ESDF, and my weapon binds are as follows:

Melee - v
Burst Gun   - c
Shotgun - w
Grenade Launcher - g
Rocket Launcher - mouse1
Ion Cannon - a
Bolt Rifle - mouse4
Plasma Rifle - t

Share this post


Link to post
Share on other sites
9 hours ago, Terifire said:

http://pastebin.com/n5Ld5Gzp

Didn't test though :P

doesn't appear to work :(

    

this my not be possible but what about extra team color options?

more specifically an option that changes colors of players to what gamemode is currently being played (ie 1v1,ffa = white teammodes = blue and red)

Share this post


Link to post
Share on other sites
Just now, ZackAttackHall said:

doesn't appear to work :(

    

this my not be possible but what about extra team color options?

more specifically an option that changes colors of players to what gamemode is currently being played (ie 1v1,ffa = white teammodes = blue and red)

Any errors?

Share this post


Link to post
Share on other sites
3 minutes ago, Terifire said:

Any errors?

honestly I'm a little new to this and wouldn't even know where to look

console doesn't appear to say anything

 

Share this post


Link to post
Share on other sites

a hud element that reminds you of things you should think about.

examples

"think you dumb motherfucker"

"dodge idiot"

"MEGA MEGA MEGA"

etc

 

E: Just in case anyone is wondering, this is a serious request. I always forget to test theorycrafts in a real game.

MAD_JIHAD likes this

Share this post


Link to post
Share on other sites

A item pickup time widget, that tells you the specific time you picked up an item and lingers for 3 seconds or so.

Share this post


Link to post
Share on other sites
5 hours ago, Morgoth said:

A item pickup time widget, that tells you the specific time you picked up an item and lingers for 3 seconds or so.

http://www.reflexfps.net/forums/index.php?/topic/2901-item-timer-trainer/ was kind of like that (tells you the clock time that an item will respawn, but doesn't disappear), but I'm pretty sure it is broken per some changes to item timer code that they did a few patches back.  Shouldn't be too hard to fix up when I get a chance (or if someone else wants to take a quick look)...

Share this post


Link to post
Share on other sites
10 hours ago, KovaaK said:

http://www.reflexfps.net/forums/index.php?/topic/2901-item-timer-trainer/ was kind of like that (tells you the clock time that an item will respawn, but doesn't disappear), but I'm pretty sure it is broken per some changes to item timer code that they did a few patches back.  Shouldn't be too hard to fix up when I get a chance (or if someone else wants to take a quick look)...

Here is a quick fix I threw together, didn't test it thoroughly, something may not work 100%.

Spoiler

require "base/internal/ui/reflexcore"

KovTimerTrainer =
{
};
registerWidget("KovTimerTrainer");

function KovTimerTrainer:initialize()
    -- load data stored in engine
    self.userData = loadUserData();
    
    -- ensure it has what we need
    CheckSetDefaultValue(self, "userData", "table", {});
    CheckSetDefaultValue(self.userData, "TimerCountsDown", "boolean", true);
    CheckSetDefaultValue(self.userData, "ReplaceMinutes", "boolean", false);

    CheckSetDefaultValue(self.userData, "ShowReds", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowYellows", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowGreens", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowMegas", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowCarnage", "boolean", true);

end

local PickupVis = {};
PickupVis[PICKUP_TYPE_ARMOR50] = {};
PickupVis[PICKUP_TYPE_ARMOR50].svg = "internal/ui/icons/armor";
PickupVis[PICKUP_TYPE_ARMOR50].color = Color(0,255,0);
PickupVis[PICKUP_TYPE_ARMOR100] = {};
PickupVis[PICKUP_TYPE_ARMOR100].svg = "internal/ui/icons/armor";
PickupVis[PICKUP_TYPE_ARMOR100].color = Color(255,255,0);
PickupVis[PICKUP_TYPE_ARMOR150] = {};
PickupVis[PICKUP_TYPE_ARMOR150].svg = "internal/ui/icons/armor";
PickupVis[PICKUP_TYPE_ARMOR150].color = Color(255,0,0);
PickupVis[PICKUP_TYPE_HEALTH100] = {};
PickupVis[PICKUP_TYPE_HEALTH100].svg = "internal/ui/icons/health";
PickupVis[PICKUP_TYPE_HEALTH100].color = Color(60,80,255);
PickupVis[PICKUP_TYPE_POWERUPCARNAGE] = {};
PickupVis[PICKUP_TYPE_POWERUPCARNAGE].svg = "internal/ui/icons/carnage";
PickupVis[PICKUP_TYPE_POWERUPCARNAGE].color = Color(255,120,128);
PickupVis[PICKUP_TYPE_POWERUPRESIST] = {};
PickupVis[PICKUP_TYPE_POWERUPRESIST].svg = "internal/ui/icons/resist";
PickupVis[PICKUP_TYPE_POWERUPRESIST].color = Color(255,120,128);
PickupVis[PICKUP_TYPE_FLAGTEAMA] = {};
PickupVis[PICKUP_TYPE_FLAGTEAMA].svg = "internal/ui/icons/CTFflag";
PickupVis[PICKUP_TYPE_FLAGTEAMA].color = Color(255,0,0);
PickupVis[PICKUP_TYPE_FLAGTEAMB] = {};
PickupVis[PICKUP_TYPE_FLAGTEAMB].svg = "internal/ui/icons/CTFflag";
PickupVis[PICKUP_TYPE_FLAGTEAMB].color = Color(0,0,255);
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function KovTimerTrainer:finalize()
end


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function KovTimerTrainer:draw()
    
    -- Early out if HUD shouldn't be shown.
    if not shouldShowHUD() then return end

    local TimerCountsDown = self.userData.TimerCountsDown;
    local ReplaceMinutes = self.userData.ReplaceMinutes;
    local ShowReds = self.userData.ShowReds;
    local ShowYellows = self.userData.ShowYellows;
    local ShowGreens = self.userData.ShowGreens;
    local ShowMegas = self.userData.ShowMegas;
    local ShowCarnage = self.userData.ShowCarnage;
    
    local gameTime
    local gameTimeLimit = world.gameTimeLimit
    if TimerCountsDown then
        gameTime = gameTimeLimit - world.gameTime   
    else
        gameTime = world.gameTime
    end

    
    -- Find player
    local player = getPlayer();

    -- count pickups
    local pickupCountTotal = 0;
    local pickupCount = 0;
    for k, v in pairs(pickupTimers) do
        pickupCountTotal = pickupCountTotal + 1;

        -- only display timers we care about
        -- (we expose all pickups to SPECATORS only, but we don't want all those pickups in this side list)
        -- (this is only an issue when you're following a player)
        if PickupVis[v.type] ~= nil then
            pickupCount = pickupCount + 1;
        end
    end

    local spaceCount = pickupCount - 1;
    
    -- Options
    local translucency = 192;
    local timerWidth = 100;
    local timerHeight = 30;
    local timerSpacing = 5; -- 0 or -1 to remove spacing
    
    -- Helpers
    local rackHeight = (timerHeight * pickupCount) + (timerSpacing * spaceCount);
    local rackTop = -(rackHeight / 2);
    local timerX = 0;
    local timerY = rackTop;

    -- iterate pickups
    for i = 1, pickupCountTotal do
        local pickup = pickupTimers;
        local vis = PickupVis[pickup.type];

        if (vis ~= nil) and (pickup.type == PICKUP_TYPE_ARMOR50 and ShowGreens) or (pickup.type == PICKUP_TYPE_ARMOR100 and ShowYellows) or (pickup.type == PICKUP_TYPE_ARMOR150 and ShowReds) or (pickup.type == PICKUP_TYPE_HEALTH100 and ShowMegas) or (pickup.type == PICKUP_TYPE_POWERUPCARNAGE and ShowCarnage) then
            local backgroundColor = Color(0,0,0,65)
            
            -- Frame background
            nvgBeginPath();
            nvgRect(timerX,timerY,timerWidth,timerHeight);
            nvgFillColor(backgroundColor);
            nvgFill();

            -- Icon
            -- local iconRadius = timerHeight * 0.40;
            -- local iconX = timerX + iconRadius + 5;
            -- local iconY = timerY + (timerHeight / 2);
            -- local iconColor = Color(255,255,255);
            -- local iconSvg = "internal/ui/icons/armor";
            -- if pickup.type == PICKUP_TYPE_ARMOR50 then
            --     iconColor = Color(0,180,0);
            -- elseif pickup.type == PICKUP_TYPE_ARMOR100 then
            --     iconColor = Color(255,255,0);
            -- elseif pickup.type == PICKUP_TYPE_ARMOR150 then
            --     iconColor = Color(255,0,0);
            -- elseif pickup.type == PICKUP_TYPE_HEALTH100 then
            --     iconSvg = "internal/ui/icons/health";
            --     iconColor = Color(60,80,255);
            -- elseif pickup.type == PICKUP_TYPE_POWERUPCARNAGE then
            --     iconSvg = "internal/ui/icons/carnage";
            --     iconColor = Color(255,120,128);         
            -- end
          
            -- TODO: tint based on pickup type
            -- local svgName = "internal/ui/icons/armor";
            -- nvgFillColor(iconColor);
            -- nvgSvg(iconSvg, iconX, iconY, iconRadius);

            -- Layout
            local iconRadius = timerHeight * 0.40;
            local iconX = timerX + iconRadius + 5;
            local iconY = timerY + (timerHeight / 2);
            local iconColor = vis.color;
            local iconSvg = vis.svg;
      
            -- CTF special cases
            if (pickup.type == PICKUP_TYPE_FLAGTEAMA) or (pickup.type == PICKUP_TYPE_FLAGTEAMB) then
                nvgBeginPath();
                nvgCircle(iconX, iconY, iconRadius-2);
                nvgFillColor(Color(235, 235, 235));
                nvgFill();
            end         

            -- Plot icon
            nvgFillColor(iconColor);
            nvgSvg(iconSvg, iconX, iconY, iconRadius);
            -- Time

            --[[
            Logic for timers:
            If you're in prematch, just use the normal method
            If you have the timer set to count up, 
            --]]
            
            local t = FormatTime(pickup.timeUntilRespawn);
            local timeX = timerX + (timerWidth / 2) + iconRadius;
            local time = t.seconds + 60 * t.minutes;

            if world.gameState == GAME_STATE_ACTIVE then
                local OTFlag = 0
                if time ~= "-" and time > 0 then
                    if TimerCountsDown == true then
                        time = gameTime - pickup.timeUntilRespawn
                        if time < 0 then 
                            time = time + 120*1000
                            OTFlag = 1
                        end
                    else
                        time = gameTime + pickup.timeUntilRespawn
                        if time > gameTimeLimit then
                            OTFlag = 1
                        end
                    end     
                    local seconds = math.floor(time/1000)%60
                    if seconds < 10 then
                    seconds = "0"..seconds
                    end
                    local minutes = (math.floor(time/1000) - seconds)/60
                    if ReplaceMinutes == true then
                        minutes = ""
                    end
                    time = minutes..":"..seconds
                    if OTFlag == 1 then
                        time = "OT "..time
                    end
                end

            end

            -- if not pickup.canSpawn then
            --     time = "held";
            -- end

            if time == 0 then
                time = "-";
            end
            
            if pickup.isOwnedByPlayer then
                time = "held";
            end

            -- CTF special cases
            if (pickup.type == PICKUP_TYPE_FLAGTEAMA) or (pickup.type == PICKUP_TYPE_FLAGTEAMB) then
                if pickup.isHeldByPlayer then
                    nvgFillColor(Color(255, 255, 255));
                    nvgSvg("internal/ui/icons/info_alert", iconX+iconRadius/1.1, iconY+iconRadius/1.5, iconRadius/1.7);
                    time = "held";
                elseif pickup.isHeldByPickup then
                    nvgFillColor(Color(255, 255, 255));
                    nvgSvg("internal/ui/icons/info_questionmark", iconX+iconRadius/1.1, iconY+iconRadius/1.5, iconRadius/1.7);
                    time = "dropped";
                else
                    time = "atbase";
                end
            else
                -- generic cases
                if pickup.isHeldByPlayer then
                    time = "held";
                end
            end

            nvgFontSize(30);
            nvgFontFace("TitilliumWeb-Bold");
            nvgTextAlign(NVG_ALIGN_CENTER, NVG_ALIGN_TOP);

            nvgFontBlur(0);
            nvgFillColor(Color(255,255,255));
            nvgText(timeX, timerY, time);
            
            timerY = timerY + timerHeight + timerSpacing;
        end
    end
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function KovTimerTrainer:drawOptions(x, y)
    local user = self.userData;

    user.TimerCountsDown = uiCheckBox(user.TimerCountsDown, "Timer Counts Down", x, y);
    y = y + 30;

    user.ReplaceMinutes = uiCheckBox(user.ReplaceMinutes, "Hide Minutes", x, y);
    y = y + 50;
    
    user.ShowReds = uiCheckBox(user.ShowReds, "Show Red Armors", x, y);
    y = y + 30;

    user.ShowYellows = uiCheckBox(user.ShowYellows, "Show Yellow Armors", x, y);
    y = y + 30;

    user.ShowGreens = uiCheckBox(user.ShowGreens, "Show Green Armors", x, y);
    y = y + 30;

    user.ShowMegas = uiCheckBox(user.ShowMegas, "Show Mega Healths", x, y);
    y = y + 30;

    user.ShowCarnage = uiCheckBox(user.ShowCarnage, "Show Carnage", x, y);
    y = y + 30;
    
    --[[
    CheckSetDefaultValue(self.userData, "ShowReds", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowYellows", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowGreens", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowMegas", "boolean", true);
    CheckSetDefaultValue(self.userData, "ShowCarnage", "boolean", true);
    --]]
    saveUserData(user);
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function KovTimerTrainer:getOptionsHeight()
    return 370; -- debug with: ui_optionsmenu_show_properties_height 1
end
 

Share this post


Link to post
Share on other sites

Chatbind widget interface. Just something where I can input whatever bind and assign a key to it, hassle doing it in console.

Share this post


Link to post
Share on other sites

doesn't the game already expose X and Y coordinates of players for spec? How about a really basic map, i.e. a X/Y graph of player position? Bonus for special indicators to flag or quad carriers, and maybe some indication of stack (if the players are dots, bigger dots correspond to more ressources).

Share this post


Link to post
Share on other sites
On 2016-01-13 at 1:27 PM, Mizzu said:

doesn't the game already expose X and Y coordinates of players for spec? How about a really basic map, i.e. a X/Y graph of player position? Bonus for special indicators to flag or quad carriers, and maybe some indication of stack (if the players are dots, bigger dots correspond to more ressources).

https://github.com/ziel980/reflexfps-dnl/blob/de9384585e56861d505efe7f0d2e116fc177572e/ui/widgets/dnl_SpectatorRadar.lua

Terifire and Mizzu like this

Share this post


Link to post
Share on other sites
18 minutes ago, MAD_JIHAD said:

 

Cool stuff, I started doing this as well, but guess I don't have to finish it. One suggestion is increasing/decreasing the dot radius depending on the location on the y axis.

Share this post


Link to post
Share on other sites
On 1/12/2016 at 10:59 AM, Owl said:

Chatbind widget interface. Just something where I can input whatever bind and assign a key to it, hassle doing it in console.

I could definitely do this, but I don't like chat binds. :P

(I might actually do it, I don't know. I'm thinking about it.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now