[BMS] r_screenoverlay not working

Please post any questions about developing your plugin here. Please use the search function before posting!
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

[BMS] r_screenoverlay not working

Postby stonedegg » Fri May 22, 2015 6:16 pm

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?
necavi
Developer
Posts: 129
Joined: Wed Jan 30, 2013 9:51 pm

Postby necavi » Fri May 22, 2015 6:18 pm

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.
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Fri May 22, 2015 6:23 pm

I already did, r_screenoverlay exists, and having sv_cheats 1 works.
User avatar
Ayuto
Project Leader
Posts: 2209
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri May 22, 2015 6:29 pm

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.
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Fri May 22, 2015 6:33 pm

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)
User avatar
Ayuto
Project Leader
Posts: 2209
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri May 22, 2015 6:50 pm

Yep, that's correct!
necavi
Developer
Posts: 129
Joined: Wed Jan 30, 2013 9:51 pm

Postby necavi » Fri May 22, 2015 8:58 pm

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.
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Fri May 22, 2015 9:46 pm

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)...

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 105 guests