Vorkitis Posted January 31, 2016 Posted January 31, 2016 (edited) Hi, I'm trying to make a script which will use MIST for doing the following: A "static object" a position x, y, z has to be change into a "real object" already existing into the editor. ["DictKey_ActionText_228"] = "replaceStaticByRealUnit('ZU23 Cargo #003','Zu-23 #003')", An error happens, on line 7: mist(nil) function replaceStaticByRealUnit(staticTarget, realTarget) local varsTarget = { gpName, groupName, action, route } local currentStaticUnit = StaticObject.getByName(staticTarget) local currentPosition = currentStaticUnit:getPosition() local targetCopy = mist.cloneGroup(getGroupData(realTarget),1) varsTarget.gpName = targetCopy.gpName varsTarget.groupName = targetCopy.groupName varsTarget.action = 'teleport' varsTarget.maxDisp = 1 varsTarget.radius = 1 varsTarget.innerRadius = 1 varsTarget.route = targetCopy.route varsTarget.point = currentPosition mist.teleportToPoint(varsTarget) StaticObject.getByName(staticTarget):destroy() end Do you known what I'm doing wrong? The solution is: don't load MIST on mission startup with condition! Thanks! Edited February 2, 2016 by Vorkitis Changing subject
Vorkitis Posted February 2, 2016 Author Posted February 2, 2016 (edited) My mistake, I haven't load properly the mist script ... Working a bit better, not everything good but I'm on my way! By the way, seems there is some problem with "StaticObjects" I'm not able to delete them from the map. In Mist, it's not possible to teleport them ( newGroupData = nil ) StaticObject.getByName(staticTarget):destroy() Any clue? Edited February 2, 2016 by Vorkitis
Recommended Posts