Cougar Posted November 23, 2013 Share Posted November 23, 2013 (edited) I'm getting an error trying to index a nil value...grrrr Seem likes the makeunittable isn't working..... Reedit: makeunittable works.... unitsInPoly = {} for index, unitName in pairs(mist.makeUnitTable({'[blue][plane]'})) do unitsInPoly[unitName] = unitName trigger.action.outText(mist.utils.tableShow(unitsInPoly),10) end Returns { ['test] = 'test' ['true'] = ['true'] ['Pilot #003'] = 'Pilot #003' } Wonder if because there's a" true" entry it somewhat make the mist.pointInPolygon call return an error as there's no pilot named 'true'.... Edit: True is a unit that I had set to Player...doh here's the error i get: 00072.290 ERROR DCS: Mission script error: : [string "local unitsInPoly = {}..."]:5: attempt to index a nil value stack traceback: [C]: ? [string "local unitsInPoly = {}..."]:5: in main chunk Edited November 23, 2013 by Cougar Link to comment Share on other sites More sharing options...
ENO Posted December 18, 2013 Share Posted December 18, 2013 WC, you inadvertently found a bug with the scripting engine, which is part of the problem. It seems that to the scripting engine, any AI which start in the air AND is activated late is constantly moving in whatever direction of their first WP. Thus if you do a position check, it is possible that the object will enter a zone. Once it spawns it "teleports" back to its original position and everything works like it should. See the attached screenshot, the Scripting Engine sees the A-10C flying the path illustrated by the tape measure. I've reported this bug to the relevant devs and I'll add an extra "unit.isActive() == true" check to applicable Mist functions. . This makes me wonder if it may be causing some of the crashes on the server involving the inability to "teleport" to clients in game. Certainly fits with the symptoms of invisible groups moving until they are spawned in. Is this still a pertinent issue? "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Grimes Posted December 18, 2013 Share Posted December 18, 2013 This makes me wonder if it may be causing some of the crashes on the server involving the inability to "teleport" to clients in game. Certainly fits with the symptoms of invisible groups moving until they are spawned in. Is this still a pertinent issue? Are you talking about mist functions not syncing with clients or you are normally spawning AI using late activation in a mission and they aren't synced up? Last I checked the specific issue that was discovered from this thread was fixed two fold. 1 the bug in the sim was fixed, 2. I added a simple check to filter out non-active units within the relevant mist functions. 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 Link to comment Share on other sites More sharing options...
ENO Posted December 18, 2013 Share Posted December 18, 2013 Awesome grimes- thanks. And yes, that was what I was referring to. Specifically the AI not syncing up. Many of my crashes were happening when units were late activated, and then they would appear back in their original location... and the crashes seemed to be happening the same way when I was teleporting to random zones etc. Anyway- thanks again. Really looking forward to 1.2.7! "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Recommended Posts