Forums » Bugs

New API Functions Not Working

Aug 21, 2018 prepioli link
The three new functions provided with the addition of a velocity vector don't seem to function. I can't get any color, size, or icon changes through a user-command style plugin. Someone in my guild tried them via console and also got no result.

The image I intended to replace the default velocity vector with is a .png file placed in the same directory as my main.lua.

Code is as follows:

-- radar.SetVelocityDirIconSize(<number>)
-- radar.SetVelocityDirIcon('filename')
-- radar.SetVelocityDirIconColor(r,g,b,a,'&')

function setvel()
radar.SetVelocityDirIcon('HUD_Custom.png')
radar.SetVelocityDirIconSize(10)
radar.SetVelocityDirIconColor(50, 50, 50, 1)
end

RegisterUserCommand("setvel", setvel)

Setting the function return values to a variable and printing them shows they simply return nil. So they are being called, but not having the intended effect.

As an added note, of the three sister functions to the above that determine display characteristics of the mouselook indicator, only the color one worked. Those may also be broken.
Aug 24, 2018 raybondo link
Thanks. The functions will be fixed in the next update.
Also, the r, g, b, a values go from 0 to 1.

The mouselook indicator can be changed with the corresponding
radar.SetAimDirIconSize(<number>)
radar.SetAimDirIcon('iconname')
radar.SetAimDirIconColor(r,g,b,a,'&')
Aug 25, 2018 prepioli link
Gotcha, assumed they were 0-255. Thanks for checking on it.