Forums » Community Projects

Easy way to change velocity direction indicator?

Aug 13, 2022 We all float link
Is there an easy way to change the color or size of the indicator? Currently it uses the aim direction bitmap. Which is fine when using mouse look off. With mouse look on, things get confusing.

The News post for 1.8.470 says there are api functions :

For modders, the size, color, and icon can be changed with the new lua functions radar.SetVelocityDirIconSize(<number>) radar.SetVelocityDirIcon('iconfilename') and radar.SetVelocityDirIconColor(r,g,b,a,'&') (r,g,b,a are between 0 and 1 and the '&' sets the blend mode to pre-multiplied alpha blend)

Is there an easy way to invert the color of the bitmap? Or just change the size? Do i do this in a plugin lua file, or something i drop into the skin folder?

Thanks.
Aug 14, 2022 Sid123 link
Just adding that I haven't seen a skin so far that uses any image for the Velocity Direction Indicator. Apparently it defaults to the Aim direction indicator. If there is any file name you have to use to give to your Velocity Direction Indicator an image separate from the Aim Direction Indicator, please tell.

Thanks.
Aug 21, 2022 Snib link
> Is there an easy way to change the color or size of the indicator? Currently it uses the aim direction bitmap. Which is fine when using mouse look off. With mouse look on, things get confusing.

Open the console:

/consoletoggle

Then you can use the commands you found by prefixing them with /lua. For example, to change the color to yellow:

/lua radar.SetVelocityDirIconColor(1,1,0,1,"&")

If you also change the icon, you will likely want to set the blend mode to "*" instead of "&".

> Do i do this in a plugin lua file, or something i drop into the skin folder?

To do this automatically, it would have to be a plugin. Create a folder, and in it a file main.lua like this:

local function setVelocityDirIcon()
radar.SetVelocityDirIconColor(1,1,0,1,"&")
end
RegisterEvent(setVelocityDirIcon, "HUD_RELOADED")
setVelocityDirIcon()
Aug 21, 2022 Luxen link
Whoops - I actually created a plugin for these guys, I just didn't push it to public because they noticed a bit of a bug with it I haven't looked at yet.
Aug 21, 2022 Snib link
No worries, can't hurt to have the info here and it was no great effort to type that up.
Aug 22, 2022 Luxen link