Wrecking Crew Posted April 18, 2016 Posted April 18, 2016 (edited) DCS v1.5.3, Mist v4.1.61, Vulcans vs Sharks mission, Multiplayer *Client* Mission script error: [string "local grpNameHelicopter = 'UH-1H 06 FARP London Cold Start'..."]:3: Group doesn't exist This error shows up in a dialog box on the server. Is there a problem with a script getting the Group Name of a Client in Multiplayer? What's the '3' in the error string for? LN? This mission/code works in Singleplayer for both Clients and AI helicopters, and a slightly modified code version works for AI helicopters in both Singleplayer and Multiplayer in the same mission. The error shows up with a Client in Multiplayer. Client code: local grpNameHelicopter = 'UH-1H 06 FARP London Cold Start' local grpNameTeam = 'BLF VGrp90 Stinger' local unitNameHelicopter = Group.getByName(grpNameHelicopter):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameHelicopter) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameHelicopter)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupTeam = mist.getGroupData(grpNameTeam) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupTeam.units do newGroupTeam.units[i].x = newCoords[i].x newGroupTeam.units[i].y = newCoords[i].y newGroupTeam.units[i].heading = newCoords[i].heading end newGroupTeam.clone = true mist.dynAdd(newGroupTeam) local unitNameHelicopterPlayer = Group.getByName(grpNameHelicopter):getUnit(1):getPlayerName() trigger.action.outText(unitNameHelicopterPlayer .. ' just dropped off a Stinger team!', 20) AI Helicopter code: local grpName = 'BLF HGrp11 UH-1H Stinger' local unitNameManpads = 'BLF VGrp90 Stinger' local unitName = Group.getByName(grpName):getUnit(1):getName() local basePos = mist.getLeadPos(grpName) local baseHeadingRad = mist.getHeading(Unit.getByName(unitName)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', unit = ' .. unitName .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg, 6) local newGroup = mist.getGroupData(unitNameManpads) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroup.units do newGroup.units[i].x = newCoords[i].x newGroup.units[i].y = newCoords[i].y newGroup.units[i].heading = newCoords[i].heading end newGroup.clone = true -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', group = ' .. grpName .. ', unit = ' .. unitName .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg .. ', Manpads = ' .. unitNameManpads, 6) mist.dynAdd(newGroup) WC Edited April 18, 2016 by Wrecking Crew Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
nomdeplume Posted April 19, 2016 Posted April 19, 2016 Is "UH-1H 06 FARP London Cold Start" always occupied by a player when this script runs? If not, then the group would be empty and thus probably not returned by Group.getByName(), or if it is returned then getUnit() wouldn't return any units. From the error message it looks like the group doesn't exist at all, as far as the game is concerned. I do seem to recall some problem with getting multiplayer group names recently. Not sure if it's exactly this, or if it was ever fixed.
Steggles Posted April 19, 2016 Posted April 19, 2016 (edited) As far as I know it's not fixed yet. I'll link the post in an edit. There is a scripting bug where client group data is not accessable in multiplayer. Source: http://forums.eagle.ru/showpost.php?p=2494017&postcount=1 Workaround: http://forums.eagle.ru/showpost.php?p=2499638&postcount=5 Seeing that you are already using mist, modify ciribob's script to pull the information you need. And the 3 in the error is the line number that the error occurred. Edited April 19, 2016 by Steggles -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Wrecking Crew Posted April 21, 2016 Author Posted April 21, 2016 I knew I'd seen that before - Thanks, Steggles for pointing me to it. WC Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
FlightControl Posted April 21, 2016 Posted April 21, 2016 It try to use moose [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]
Wrecking Crew Posted April 22, 2016 Author Posted April 22, 2016 I'll wait for the engine to be fixed, the Vulcans & Sharks mission will go on the inactive list. WC Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
Recommended Posts