Jump to content
Ibragim A

Is it possible to find out (get variables or returned value) which choice the user made in the command menu?

Recommended Posts

My question is, is there any universal way to know which choice the user made in each of the vanilla command menus?


For example, we have an RscGroupRootMenu menu in which the user can select Move There, Regroup, Hold Fire, etc.
I want to understand, is it possible to get data about this choice right after the choice?

At the moment there is a way to track this with the command inputAction "CommandingMenuSelect1" > 0. But it only works if the user makes a choice with the key [1] and only if the options in the menu are listed by numbers, and after all, the user often makes a choice in the command menu with the Space or the central mouse button, besides there are menus in which the options are not numbered (for example, RscGroupRootMenu). Therefore, this method is not universal.

 

There is also another way - to track the message using the MissionEH "HandleChatMessage". But this method requires tracking messages in all languages and in all variants. Also, the message appears with a slight delay. In addition, there are options in different menus that do not provide messages to the user's chat.

 

So, I'm looking for a way that, ideally, will give me access to the title or sequence number of the option that the user has selected in the command menu. For example, if the user has selected Move There in the RscGroupRootMenu menu, then the script provides me at this moment either its ordinal number in the menu, or the name in the form of a string: "Move There", or any other variable from which I can push off and find out the user's choice myself.

  • Like 1

Share this post


Link to post
Share on other sites

Ive been trying to get this very same information as well. BTW I've been trying your Platoon Commander Mod - lovely stuff.

Share this post


Link to post
Share on other sites

Maybe you can track selected units followed by currentCommand.  currentCommand is per unit in player group, not current command just issued by player, so would require monitoring all units for change in currentCommand value.

 

Share this post


Link to post
Share on other sites

Thanks for the advice, I've already tried it. This can help, but in very limited cases. My scripts contain other commands that change the status of the currentCommand, such as doMove, for example. Therefore, in my case, I cannot use this method.

There are also options in various menus that do not change the status of currentCommand.

Share this post


Link to post
Share on other sites

There is an event handler in the in-game interface, but it handles only the action menu.

inGameUISetEventHandler ["Action", "_index = _this select 2; _title = _this select 4;"];

I need to find a way to get something like this, but for command menus.

Share this post


Link to post
Share on other sites

I've wanted this feature forever myself.  With my SOG AI mod, I use wheel/radial menu to command AI  for a limited set of commands, and with those you can control and know exactly which commands given.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×