Igneous01 Posted January 29, 2018 Posted January 29, 2018 I'm trying to access groups that are marked as client slots in MP. Using the typical Group.getByName() always returns nil for these groups. Is there any other way I can access the groups? I just want to check if the group is nil or not. Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha) http://kaukasusinsurgency.com/
Pikey Posted January 31, 2018 Posted January 31, 2018 Only know via MOOSE you would create a SET of clients with the same name and it would autoupdate and you could iterate on it very simply for client name. I don't know how to do it in the SSE normally. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Grimes Posted January 31, 2018 Posted January 31, 2018 All of the data that can be returned from the group functions, except for controller which isn't useful on clients anyways, can be derived from the mission file itself. You can access the mission table via env.mission. From there you can iterate everything and build a DB of data that you find useful from there. For instance this is the mist code for building DBs... https://github.com/mrSkortch/MissionScriptingTools/blob/master/mist.lua#L117 From there you just need to know a common way to access it. For instance this DB table is indexed by the unit name of any unit with the skill of player or client. https://github.com/mrSkortch/MissionScriptingTools/blob/master/Example%20DBs/mist_DBs_humansByName.lua Depending what you need you can use only the data in that table or use the group name to access the DBs.groupsByName table for the data in there. For instance the units and figuring out how many from the client group are alive. 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
Igneous01 Posted January 31, 2018 Author Posted January 31, 2018 Thanks Pikey and Grimes, I was looking at how the Moose CLIENT class got it's information about client slots and see it was using very similar code to iterate through the env.mission table for units with skill 'client' (those are some big nested loops ;) ) Is there a shorter way of iterating through the table so that I only need to iterate maybe [countries][groups] ? If there isn't it's fine, i was just curious if I could reduce my code to maybe 2 to 3 loop iterations instead of the 4 that are there. Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha) http://kaukasusinsurgency.com/
Grimes Posted February 1, 2018 Posted February 1, 2018 It isn't a big deal if it is something you run once just to populate the data. If you know the coalition and country then it is pretty straight forward, but that will only iterate for that specific country in a coalition. for index, groupData in pairs (env.mission.coalition.blue.USA) do end 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
sunski34 Posted February 2, 2018 Posted February 2, 2018 +1 ATME can do that too... like MIST. I'm agree with Grimes if you just need to do that, a simple loop is enough. Sunski
Recommended Posts