sunski34 Posted June 19, 2016 Posted June 19, 2016 In the description : "Removes the item of the specified name from the F10 radio menu for the specified group. If the value is nil all items will be removed from the radio menu. " In my case, the name value isn't nil... so... just the named item has to be removed no ?
FlightControl Posted June 19, 2016 Posted June 19, 2016 In the description : "Removes the item of the specified name from the F10 radio menu for the specified group. If the value is nil all items will be removed from the radio menu. " In my case, the name value isn't nil... so... just the named item has to be removed no ? Can you give an example? - Please list the menu structure by example. - Which element of the menu you want to remove - And what is the function call you are using, including the parameters... Then it wo be clearer what is the problem. Thanks, Sven Sent from mTalk on Windows 10 mobile [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
sunski34 Posted June 23, 2016 Posted June 23, 2016 Simple example Here you are.... 3 F10 menu items. You can test, F3 to remove F1 item -> All items removedtest radio.miztestRadio.lua
sunski34 Posted June 23, 2016 Posted June 23, 2016 Only works in single player mode cause I used group ID.... There's another problem on multiplayer mode, you have to use unit ID in the last version of DCS 1.5 . Waiting for fix in next version...
Grimes Posted June 23, 2016 Author Posted June 23, 2016 Sorry misread your post. Its a problem with the documentation. String isn't a valid entry, it is only supposed to work with paths. So you have to do something like this... local rad1 rad1 = missionCommands.addCommandForGroup(grp:getID(), "Radio Test 1", nil, radioTest1 , {}) And when removing it... missionCommands.removeItemForGroup(grp:getID(), rad1) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Grimes Posted June 24, 2016 Author Posted June 24, 2016 Tested stuff out and updated the wiki a bit based on the results btw. Used your sample a bit to test it out. :) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
FlightControl Posted June 24, 2016 Posted June 24, 2016 @ All, Any lua scripting engine fixes in 1.5.4 beta, that we reported in earlier versions? Thanks, Sven Sent from mTalk on Windows 10 mobile [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Grimes Posted June 24, 2016 Author Posted June 24, 2016 I asked for the changelog to be updated to reflect some items that were missing. Fixed Object.destroy() for cargo objects Fixed Unit.getRadar() to return correct information for ground units with radars Fixed AI issues caused by toggling AI on/off Fixed dynamically added ground units now correctly follow orders The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
FlightControl Posted June 25, 2016 Posted June 25, 2016 Grimes, thank you, thsi is fantastic! I asked for the changelog to be updated to reflect some items that were missing. Fixed Object.destroy() for cargo objects This bugger has been around for a very very long time :-) I had a test mission designed to test this as part of the report, and nowwill re-test this and confirm the fix. I guess related to cargo, that more fixes were done, also the "behaviour" kind of issues when you let AI sling load cargo from one point to another? Fixed Unit.getRadar() to return correct information for ground units with radars Never used this function but will try to test this also. Fixed AI issues caused by toggling AI on/off Fixed dynamically added ground units now correctly follow orders This one i have already tested. Related to this one was another problem that dynamically spawned units did not move and follow the route when spawned... this is also fixed. http://forums.eagle.ru/showthread.php?t=168046 I'll also try to retest the other bug reports, who knows something got fixed there also, like the client group bug or destroying (clearing) burning units and groups. I'll update the reportings accordingly and will notify you. kind regards, Sven [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
EntropySG Posted June 25, 2016 Posted June 25, 2016 I asked for the changelog to be updated to reflect some items that were missing. Fixed Object.destroy() for cargo objects Fixed Unit.getRadar() to return correct information for ground units with radars Fixed AI issues caused by toggling AI on/off Fixed dynamically added ground units now correctly follow orders Thank you thank you thank you!!!! [sIGPIC][/sIGPIC]
sunski34 Posted July 9, 2016 Posted July 9, 2016 addCommandForGroup in 1.5.4 release Hi, no change, doesn't work in multiplayer mode.... in fact there's a problem with unit:getGroup I think. when I do that : grpPlayer = unit:getGroup() trigger.action.outText("Name :" .. grpPlayer:getName(), 5) That doesn't work only for client DCS. it's ok for the server...
sunski34 Posted July 9, 2016 Posted July 9, 2016 simple script and mission Here's a very simple script and mission... 2 A10C clients, a script to add a menu item... Start in single player mode.... ok Start in multiplayer mode on server ok the menu is here, on the client no menu F10...testMulti.luatest multi radio.miz
wolle Posted July 9, 2016 Posted July 9, 2016 I asked for the changelog to be updated to reflect some items that were missing. Fixed Object.destroy() for cargo objects Fixed Unit.getRadar() to return correct information for ground units with radars Fixed AI issues caused by toggling AI on/off Fixed dynamically added ground units now correctly follow orders Hi Grimes, Thanks for the info. Have there been any changes to the "client groups are not accessible in MP", "lua predicate doesn't work" and "initialization script won't run" bugs? Thanks [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro
sunski34 Posted July 9, 2016 Posted July 9, 2016 Ok when using env.mission.coalition to find mission informations and groupID for each group of the mission like in mist it's ok in multiplayer mode. I create a function to do that and it's ok.
FlightControl Posted July 9, 2016 Posted July 9, 2016 Ok when using env.mission.coalition to find mission informations and groupID for each group of the mission like in mist it's ok in multiplayer mode. I create a function to do that and it's ok. May I ask why this is (was) important? Sent from mTalk on Windows 10 mobile [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
sunski34 Posted July 9, 2016 Posted July 9, 2016 If you use in Lua unit:getGroup in multiplayer mode, it doesn't work always... For the first player it's good but for the other it isn't. So when using function as addcommandForGroup, there's a problem... The solution is to use env.mission.coalition where you find all object informations even groupId. Mist implements that and CTLD use that... I rewrite the function for my use... because I don't want to use MIST. I work on a advance ATC and I need this information to send messages to players or build radio menus.
FlightControl Posted July 10, 2016 Posted July 10, 2016 (edited) If you use in Lua unit:getGroup in multiplayer mode, it doesn't work always... For the first player it's good but for the other it isn't. So when using function as addcommandForGroup, there's a problem... The solution is to use env.mission.coalition where you find all object informations even groupId. Mist implements that and CTLD use that... I rewrite the function for my use... because I don't want to use MIST. I work on a advance ATC and I need this information to send messages to players or build radio menus. Ha, the famous client MP group bug... Yes. Absolutely, what you say is the correct workaround... It is a dirty workaround, isn't it? I find it really.amazing that this bug has not been fixed yet. And the group ids are needed to set menus and send messages to groups. Hopefully this gets fixed in 1.5.5. Maybe in 1.5.2345. And if you do a poll, people find it a waste of time.. Hilarious. Sent from mTalk on Windows 10 mobile Edited July 10, 2016 by FlightControl [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
FlightControl Posted July 12, 2016 Posted July 12, 2016 If you use in Lua unit:getGroup in multiplayer mode, it doesn't work always... For the first player it's good but for the other it isn't. So when using function as addcommandForGroup, there's a problem... The solution is to use env.mission.coalition where you find all object informations even groupId. Mist implements that and CTLD use that... I rewrite the function for my use... because I don't want to use MIST. I work on a advance ATC and I need this information to send messages to players or build radio menus. How do you destroy a group with a client in MP? So, if you have a group with a unit with skill level Client, and you get the GroupID correctly retrieving it from the env.mission.coalition. So i do: local ClientGroup = Client:getGroup() (returns ClientGroup.id_ = 0) ClientGroup.id_ = envmissiongroupid ClientGroup:destroy() -> this will not work, unfortunately... [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Pikey Posted July 12, 2016 Posted July 12, 2016 Love how the group bug in MP is brought up every page for the last 8 months. I had to unsub from this post in the end but its like looking at a car crash. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Yukari Posted September 2, 2016 Posted September 2, 2016 Any update/fix on missionCommands func? Another point... When using those function : missionCommands.addCommandForGroup missionCommands.removeItemForGroup trigger.action.outTextForGroup the first parameter is groupID. It works in single player mode but not in multiplayer mode. So I tried to replace groupID by unitID and then thoses functions works perfectly in single player ou in multiplayer modes. So if the lua declaration needs unitId and not groupID it's better to modify the help. But with : trigger.action.outSoundForGroup works perfectly with groupID in single player and multiplayer modes. Bugs?:( :helpsmilie:Can someone please confirm that using unitID instead of groupID still works for these three missionCommands functions? I've had a few tries using unitID but it doesn't work at all in either SP or MP. If groupID is used, they will work perfectly in SP mission; in MP, it works for the host only(so clients won't see F10 radio command). Unless I am missing something important. Thanks in advance. DCS version 1.5.4.55952. Nooooooooo
FlightControl Posted September 2, 2016 Posted September 2, 2016 (edited) :helpsmilie:Can someone please confirm that using unitID instead of groupID still works for these three missionCommands functions? I've had a few tries using unitID but it doesn't work at all in either SP or MP. If groupID is used, they will work perfectly in SP mission; in MP, it works for the host only(so clients won't see F10 radio command). Unless I am missing something important. Thanks in advance. DCS version 1.5.4.55952. Hi Yukari, Let me confirm, this issues that you are experiencing is a reported bug by the community to ED, that is open for about a year now, since the release of 1.5.0. Just for clarity, you can only provide a Group ID to those functions. A Unit ID won't work! The issue occurs for remote client objects that join the multi player mission. By definition, a "remote client object" is a Unit with skill level set to "Client" in the mission editor, that is joined by a remote player (so not locally on the server). When you run your mission in multi-player, unfortunately, when you execute for a remote Client object GroupClient = ClientObject:getGroup() the return value seems to be a valid Group object. But when you examine carefully, the value of GroupClient.id_ would be 0!!! Even more, when players join a client slot, the BIRTH events are not generated on the server. It seems like remote clients are not at all recognized within DCS since about a year or so ... This is the reason why these group functions are not working. So, when you execute GroupClient:GetID(), that function won't even execute as the simulator won't be able to find the Group object due to the reference .id_ being = 0 ... (Un)fortunately, there is a very crappy workaround available, that determines the "group id" through other means ... This will resolve your API calls for the menus ... Using lua mission scripting, there is an env.mission variable, which contains all the mission definitions as defined within your mission editor. The env.mission variable is a huge table, that you can traverse. All units, groups, airbases, navigation points, and other objects are defined within this env.mission variable ... What you can do is to search the env.mission table for the group template that you have defined, and retrieve the group id from the group template. To understand better what i am talking about, you should unzip the attached mission file... and have a look at the embedded mission file. It is located in the root directory of the zip file. When you open that mission file, the lua structure that you see is generated as a result of your mission editing. The env.mission table in lua scripting contains exactly this structure in internal memory! This embedded mission file contains one group with the name "Plane", with one unit with the name "Plane", for a blue coalition, within the country USA. When you examine the embedded mission file, you can retrieve the group id of the Plane Group using the following statement: env.mission.coalition.blue.country[19].plane.group[1].groupIdI really encourage you to have a look at this mission file, and understand how i come to be above statement! And this workaround is unfortunately the only way at the moment to get remote client objects working in multi player mode ..., by searching for the groupId as defined within the mission editor ... The MIST framework and the MOOSE frameworks are traversing the env.mission table behind the scenes during mission startup, using lua scripting, to do lots of fancy things. MOOSE hides the complexity to manage menus by using classes and objects. This workaround has been implemented within the MOOSE framework. So, when you use the MOOSE MENU classes together with the CLIENT classes, you'll have automaticlaly this workaround resolved. There are test missions created that use MOOSE, so you can examine how to use these MENU classes here. I leave it up to your decision how you want to progress with this. It is very unfortunate that ED is not paying much attention about this multi player bug. Lots of people complaining about it, but not too much interaction from the dev team. I got an informal information from one the moderators that we'll need to wait until DCS 2.5 until this bug gets resolved. And although most of the people are complaining about this bug, ED seems to be able to get away with it. I guess we'll need to await the very promised new release to see what is working and what is not, as history has shown. kind regards, SvenMission.miz Edited September 2, 2016 by FlightControl 1 [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
0xDEADBEEF Posted September 15, 2016 Posted September 15, 2016 (edited) Just found a bug in the PLAYER_LEAVE_UNIT event. It seems during this event.iniator:getPlayerName() would return an empty string "" instead of the players name, on a BIRTH event it is correct, if I go specators and trigger the LEAVE_UNIT event it returns "". Edit: tested it for clients, clients don't event trigger the event. Edited September 15, 2016 by 0xDEADBEEF
Grimes Posted September 19, 2016 Author Posted September 19, 2016 Just found a bug in the PLAYER_LEAVE_UNIT event. Partly reproduced on the tester version. Clients were producing the event but the player name was blank. I've reported it. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
SNAFU Posted September 20, 2016 Posted September 20, 2016 Grimes, there seems to be similar bug, which is related to the initiator of the EVENT_SHOT. if event.id == world.event.S_EVENT_SHOT and Unit.getName(event.initiator) ~= nil and Unit.getPlayerName(event.initiator) ~= nil then ... Does not work for MP clients (singleplayer works fine), but if event.id == world.event.S_EVENT_SHOT then Does now work in MP clients. I guess that is related to the Unit.getPlayerName(event.initiator) bug/returns nil, too. [sIGPIC][/sIGPIC] Unsere Facebook-Seite
Recommended Posts