Page 1 of 1

menus in CSGO

Posted: Fri Jun 30, 2017 12:32 pm
by PhantomDancer
is there a wiki or any info on what menus work in csgo? are there any selection menus besides the radiomenu?

Re: menus in CSGO

Posted: Fri Jun 30, 2017 3:03 pm
by Ayuto
No, there isn't, but SP implements only two menu types: radio and esc (escape). So, you can quickly test it.

Beside those two you can also create menus using a MOTD. iPlayer created a cool library for that.

If you want to ask for user input you can also try out messages.dialog. I don't know if those classes are working in csgo.

Re: menus in CSGO

Posted: Fri Jun 30, 2017 3:11 pm
by satoon101
Ayuto wrote:If you want to ask for user input you can also try out messages.dialog. I don't know if those classes are working in csgo.

The last I checked, none of the Dialog (ESC) messages work in CS:GO. They have been adding support for other messages, like HudMsg, but I don't think any of the ESC messages have been included in that.

Re: menus in CSGO

Posted: Fri Jun 30, 2017 3:50 pm
by PhantomDancer
motd would be my last resort, although i too was wondering about a usermsg utilization. i know there is a votemenu in csgo but id have to refresh my knowledge on it.. btw did this thread go anywhere yet? https://github.com/Source-Python-Dev-Te ... issues/180

Re: menus in CSGO

Posted: Fri Jun 30, 2017 4:06 pm
by PhantomDancer
shouldnt something be possible to create a string customized vote menu as usermsg and receive a YES/NO reply back from the client?

ill just create a virtual function to test this right now and see if it'll work or not. i think there are some more interesting functions in the csgo branch for sp https://wiki.alliedmods.net/Counter-Str ... erMessages

Re: menus in CSGO

Posted: Fri Jun 30, 2017 4:32 pm
by PhantomDancer

Syntax: Select all

from messages.base import UserMessageCreator
class VoteStart(UserMessageCreator):
"""Create a VoteStart."""

message_name = 'VoteStart'
translatable_fields = ['disp_str', 'details_str', 'other_team_str']

def __init__(
self, team=0, ent_idx=0,vote_type=0, disp_str='', details_str='', other_team_str='', is_yes_no_vote=True):
"""Initialize the VoteStart instance."""
super().__init__(
team=team, ent_idx=ent_idx, vote_type=vote_type,disp_str=disp_str, details_str=details_str, other_team_str=other_team_str, is_yes_no_vote=is_yes_no_vote)

def protobuf(self, buffer, kwargs):
"""Send the VoteStart with protobuf."""
# buffer.set_string('msg_name', ' \x01' + kwargs.message)
buffer.set_int32('team', kwargs.team)
buffer.set_int32('ent_idx', kwargs.ent_idx)
buffer.set_int32('vote_type', kwargs.vote_type)
buffer.set_string('disp_str', kwargs.disp_str)
buffer.set_string('details_str', kwargs.details_str)
buffer.set_string('other_team_str', kwargs.other_team_str)
buffer.set_bool('is_yes_no_vote', kwargs.is_yes_no_vote)

def bitbuf(self, buffer, kwargs):
"""Send the VoteStart with bitbuf."""
buffer.write_byte(kwargs.team)
buffer.write_byte(kwargs.ent_idx)
buffer.write_byte(kwargs.vote_type)
buffer.write_string(kwargs.disp_str)
buffer.write_string(kwargs.details_str)
buffer.write_string(kwargs.other_team_str)
buffer.write_byte(kwargs.is_yes_no_vote)

import random
for i in range(1,1000):
VoteStart(random.randint(0,64),random.randint(0,64),random.randint(0,64))


this is my testcode, but it no work :(

Re: menus in CSGO

Posted: Fri Jun 30, 2017 4:41 pm
by PhantomDancer
ah too bad i cant edit/correct my own post

Re: menus in CSGO

Posted: Fri Jun 30, 2017 4:43 pm
by PhantomDancer
it works this way :

Syntax: Select all

from messages.base import UserMessageCreator
class VoteStart(UserMessageCreator):
"""Create a VoteStart."""

message_name = 'VoteStart'
translatable_fields = ['disp_str', 'details_str', 'other_team_str']

def __init__(
self, team=0, ent_idx=0,vote_type=0, disp_str='', details_str='', other_team_str='', is_yes_no_vote=True):
"""Initialize the VoteStart instance."""
super().__init__(
team=team, ent_idx=ent_idx, vote_type=vote_type,disp_str=disp_str, details_str=details_str, other_team_str=other_team_str, is_yes_no_vote=is_yes_no_vote)

def protobuf(self, buffer, kwargs):
# print("PROTO",buffer)
"""Send the VoteStart with protobuf."""
buffer.set_int32('team', kwargs.team)
buffer.set_int32('ent_idx', kwargs.ent_idx)
buffer.set_int32('vote_type', kwargs.vote_type)
buffer.set_string('disp_str', '\x01' +kwargs.disp_str)
buffer.set_string('details_str', '\x01' +kwargs.details_str)
buffer.set_string('other_team_str', '\x01' +kwargs.other_team_str)
buffer.set_bool('is_yes_no_vote', kwargs.is_yes_no_vote)

def bitbuf(self, buffer, kwargs):
# print("bitbuf",bitbuf)
"""Send the VoteStart with bitbuf."""
buffer.write_byte(kwargs.team)
buffer.write_byte(kwargs.ent_idx)
buffer.write_byte(kwargs.vote_type)
buffer.write_string( '\x01' +kwargs.disp_str)
buffer.write_string( '\x01' +kwargs.details_str)
buffer.write_string( '\x01' +kwargs.other_team_str)
buffer.write_byte(kwargs.is_yes_no_vote)

Re: menus in CSGO

Posted: Fri Jun 30, 2017 9:31 pm
by PhantomDancer
i somehow cant edit or delete any of my posts. so i cant really correct anything without messing up the whole thread. right now i kinda wanna create a wiki for the whole csgo usermessages.

this should be the sp file: https://github.com/Source-Python-Dev-Te ... es/base.py

i would probably go ahead and add the missing usermessages to my local base.py file then.... but is there any official files on how to build the protobuf layout or would i have to dissamble the server files in ida? or what? thanks

Re: menus in CSGO

Posted: Sat Jul 01, 2017 8:00 am
by Ayuto
The following zip file contains two *.proto files. Those contain the structure of the user messages and net messages:
http://media.steampowered.com/apps/csgo ... ssages.zip

This is only the initial version. Several new user messages have been added since then. Those need to be ripped out from the game's binary files.

If you want to create a wiki, you might want to start with the already implemented user messages.
http://wiki.sourcepython.com/contributi ... o-the-wiki

Re: menus in CSGO

Posted: Sat Jul 01, 2017 10:46 am
by PhantomDancer
which binaries do i have to look into for usermsgs? your second link only leads to the general wiki :/

Re: menus in CSGO

Posted: Sat Jul 01, 2017 11:31 am
by Ayuto
The server and engine binary would be a good place to start. I posted the second link, because you said you want to create a wiki.