Xonotic Forums
[NEED HELP] console send key or calling menus - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4)
+--- Thread: [NEED HELP] console send key or calling menus (/showthread.php?tid=7399)



console send key or calling menus - BuddyFriendGuy - 05-06-2017

I specifically remember one CTF game in which -z- used a lot of team chat functions. I'm trying to learn to do that too.
By default, the menu provides the a few team chat messages, such as Need Help, Defending, etc. All these messages come with a waypoint sprite, which contains weapon and health info.
I'd like to bind them to different keys but can't figure out how.

1. Call I call the menu function directly?

I understand I can repeat what's in the menu:
Code:
] alias say_msg_need_help "say_team need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)
] bind H "say_msg_need_help; g_waypointsprite_team_helpme; cmd voice needhelp"
But I'm wondering whether I can save the repetition by calling it directly.


2. Is there a way to emit a key sequence so I can do something like
Code:
]bind H send_key "F8 2 0 5"
// open menu; team chat; continue(next page); defending

This would also be a good way to quickly switch grenade type.



3. Is there a way to place a waypoint sprite with information?

The sprite just says "HERE". Is it possible to include information?


RE: console send key or calling menus - -z- - 05-06-2017

(05-06-2017, 04:09 PM)BuddyFriendGuy Wrote: I specifically remember one CTF game in which -z- used a lot of team chat functions. I'm trying to learn to do that too.

These are the binds I'm using for team communication: https://github.com/z/xonotic-config.pk3dir/blob/master/config/binds/communication.cfg

Quote:By default, the menu provides the a few team chat messages, such as Need Help, Defending, etc. All these messages come with a waypoint sprite, which contains weapon and health info.

I'd like to bind them to different keys but can't figure out how.

1. Call I call the menu function directly?

I understand I can repeat what's in the menu:
Code:
] alias say_msg_need_help "say_team need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)
] bind H "say_msg_need_help; g_waypointsprite_team_helpme; cmd voice needhelp"
But I'm wondering whether I can save the repetition by calling it directly.

I believe what you're looking for is the userbind cvars.  I utilize these in my bindset.

Quote:2. Is there a way to emit a key sequence so I can do something like
Code:
]bind H send_key "F8 2 0 5"
// open menu; team chat; continue(next page); defending

This would also be a good way to quickly switch grenade type.

I'm not sure about the automation of the quick menu that you're asking about.  A traversing of the menu tree would be very cool though.

That being said, there is a command to switch nade, but I forgot what it is.  You'll have to bug Mario, he told me once, but I forgot to add it into my config.

Quote:3. Is there a way to place a waypoint sprite with information?

The sprite just says "HERE". Is it possible to include information?

I believe you're looking for these: https://xonotic.org/tools/cacs/#0a/0/g_waypointsprite_team_


RE: console send key or calling menus - BuddyFriendGuy - 05-07-2017

(05-06-2017, 05:33 PM)-z- Wrote: These are the binds I'm using for team communication: https://github.com/z/xonotic-config.pk3dir/blob/master/config/binds/communication.cfg
Thanks, -z-. This is very helpful and inspiring.

What does %p mean in this line? For me it's displayed verbatim. Is there a list of these variables somewhere?

(05-06-2017, 05:33 PM)-z- Wrote:
Quote:1. Call I call the menu function directly?
I believe what you're looking for is the userbind cvars.  I utilize these in my bindset.

This helps, although differently. It looks like in our quickmenu code, we didn't directly call these userbinds -- instead we just repeat the config.

(05-06-2017, 05:33 PM)-z- Wrote:
Quote:2. Is there a way to emit a key sequence so I can do something like
Code:
]bind H send_key "F8 2 0 5"
// open menu; team chat; continue(next page); defending
This would also be a good way to quickly switch grenade type.
I'm not sure about the automation of the quick menu that you're asking about.  A traversing of the menu tree would be very cool though.

I think you are right -- from our code, it seems we can't do that yet. Having the ability to do this would also solve the repetition problem above.

(05-06-2017, 05:33 PM)-z- Wrote: That being said, there is a command to switch nade, but I forgot what it is.  You'll have to bug Mario, he told me once, but I forgot to add it into my config.

@Mario?

(05-06-2017, 05:33 PM)-z- Wrote:
Quote:The sprite just says "HERE". Is it possible to include information?
I believe you're looking for these: https://xonotic.org/tools/cacs/#0a/0/g_waypointsprite_team_

This is better than just HERE, although I was hoping to include customizable info (e.g. OUR FLAG).

Thanks to you -- I also discovered personal sprites. I think I'm gonna start using it to remember where the mega items are. I tend to get lost in new maps.


RE: console send key or calling menus - -z- - 05-07-2017

(05-07-2017, 01:40 AM)BuddyFriendGuy Wrote: What does %p mean in this line? For me it's displayed verbatim. Is there a list of these variables somewhere?
%p is a placeholder for "playername you last looked at" -- it's a relic from Nexuiz days... Mario technically implemented it again in Xonotic because I'm stubborn, and kept using it.  I'm not sure it's in vanilla at the moment.  Here are a few more, this is not an exhaustive list http://xonotic.org/tools/cacs/#2a/0/replacement


(05-07-2017, 01:40 AM)BuddyFriendGuy Wrote: This helps, although differently. It looks like in our quickmenu code, we didn't directly call these userbinds -- instead we just repeat the config.
Ahh, I was confused, because there are "user-defined" options in the Main Menu system.  https://i.imgur.com/8BOKRGw.png

Quote:Waypoint sprites

These waypoint sprites are rasterized like I checked, the game isn't drawing the text dynamically, but that would be neat.