Page 1 of 1

[BMS] r_screenoverlay not working

Posted: Fri May 22, 2015 6:16 pm
by stonedegg
Hey, I've tried to display an overlay using client command r_screenoverlay. This works in all other games, but not in BMS because sv_cheats 1 must be enabled even to enforce this on a player from the server.


Syntax: Select all

from filters.players import PlayerIter
from engines.server import engine_server
from entities.helpers import edict_from_index

def clientcommand(index, command, server_side=False):
edict = edict_from_index(index)
engine_server.client_command(edict, command, server_side)

for index in PlayerIter():
clientcommand(index, "r_screenoverlay test.vmt")


Using the cvars module, I wanted to remove the cheats flag from r_screenoverlay, but cvar.find_var('r_screenoverlay') returns None.

My last resort would be enabling sv_cheats before sending an overlay, and disabling it then again, but I wouldn't really like that. Any other ideas?

Posted: Fri May 22, 2015 6:18 pm
by necavi
Try turning on sv_cheats and running r_screenoverlay manually, or trying find r_screenoverlay in your client console, if cvar.find_var doesn't find it, then it may very well not exist.

Posted: Fri May 22, 2015 6:23 pm
by stonedegg
I already did, r_screenoverlay exists, and having sv_cheats 1 works.

Posted: Fri May 22, 2015 6:29 pm
by Ayuto
r_screenoverlay is a client variable/command. That's why you don't find it via cvar.find_var().

For now I would also just enable sv_cheats and then disable it.

Posted: Fri May 22, 2015 6:33 pm
by stonedegg
Okay. To remove/add the notifying from sv_cheats in chat, I need to do it this way?

Syntax: Select all

from cvars import cvar
from cvars.flags import ConVarFlags

cheats = cvar.find_var('sv_cheats')

cheats.remove_flags(ConVarFlags.NOTIFY)

cheats.add_flags(ConVarFlags.NOTIFY)

Posted: Fri May 22, 2015 6:50 pm
by Ayuto
Yep, that's correct!

Posted: Fri May 22, 2015 8:58 pm
by necavi
Odd, I went looking at a plugin I did a while back and it seems to be able to strip the cheat flag from r_screenoverlay server side. Personally I can't stand enabling cheats, even for the space of one command if I can avoid it.

Posted: Fri May 22, 2015 9:46 pm
by stonedegg
After all it's useless anyways, because it looks like BMS is sending overlays every tick to the client. I can display overlays now with enabling cheats, but they are directly overwritten by the game and you see them only sometimes for a fraction of a second (no other plugins enabled)...