Jump to content

Who said that??? - Tracking back missionCommands.addCommand() in MP


Recommended Posts

Posted (edited)

I'm developing an MP mission, and in the process ran into the problem of identifying individual clients. I've installed a command so a player can request a service from my simulated Tarmac Controller. Now, in single-player this works well, but in multiplayer, my mission can't tell which of the clients issued the command, and consequently can't handle the correct unit (the one controlled by the player that issued the command).

 

Therefore my question: how can a mission designer find out which unit issued the command? I would think that during addCommand(), a client would pass a unique identifier to itself with the Command's free parameters, but then again - how does the mission script identify the unit that it is controlling on a client? I'm not fully informed how DCS's client-server architecture works but would assume that a mission run on each client, with the server having authority over all other units except the client's unit. So in theory, a mission script running on a client would know which of the units it is controlling, and which are controlled by the server. How does it do that?

 

Thanks for any pointers,

-ch

 

Edited by cfrag
Posted

I can't answer your question regarding what happens in the background, but what I can tell you is that the lowest level on which radio menus can be created in DCS is the group level. It is currently not possible to create menus for individual units. By using addCommand() you create menu options for all players in the mission, this means even a player that is currently airborne would be able to access the ground services.

To make make your idea work, it would be better to use missionCommands.addCommandForGroup() to create the radio menu options for each group individually and only create menus for groups that are currently parked on an airfield (achievable through a combination of event handlers and if loops).

You can then pass the group name as an argument to the function that is called by the radio menu option.

 

  • Thanks 1
Posted

Yeah its an annoyance. Gotta use addCommandForGroup that is added for each group and then embed into the passed arguments an identifier so you know which group sent it. Problem therein being that it only goes to the group level so if you have multiple clients per group you don't know who sent it. That is unless you add a sub-menu for each aircraft and within that pass another identifier for that aspect of it and hope they select the correct sub-menu. 

  • Thanks 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Thank you so much, @CakeSorbus and @Grimes -- that is somewhat disappointing. I thought what I wanted to do was (at least) theoretically possible because 

  1. You can do it when requesting refuel / re-arm (but that is of course handled internally)
  2. I've seen some servers do it when requesting missions from the server, which leads me to believe that they are also using single-unit groups, just as you recommended. 

If you come across a better solution, I'd of course love to hear it. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...