Undo/Tips/Notices not showing in custom gamemode

I’ve derived my gamemode from sandbox. I’ve fixed some minor other issues… BUT! I can’t get the undo/tips/notices to show! I’ve tried copying cl_notice.lua, cl_hints.lua, and cl_worldtips.lua (AddCSLuaFile’ing and Including them properly as well) to no avail.

I get no errors, and the sound plays, just no visual notification.

Thanks, this has been bugging me for a while.


Are you using a custom HUDPaint hook? If so then add this:
[lua] self.BaseClass:HUDPaint()[/lua]
to the top of the function that the hook is calling.

Yes I am, but your solution did not fix the problem. Apperently It can’t figure out what self is.
“Hook ‘CUHUD’ Failed: <gamemode>\gamemode\cl_gui.lua:79: attempt to index global ‘self’ (a nil value)”

And if I comment out my custom hook all together, I get the default HUD but still no notifications/tips/etc.

You shouldn’t really be using gamemode hooks in a gamemode Lua file, you should be using thier respective functions. This is what you should be doing:

[lua]function GM:HUDPaint()
–your code here.

Thank you! That worked.

I’m not used to coding GameModes, so I wouldn’t have known about when to use hooks.

No Problem. You know what to do now. :smile: