Jump to content

Recommended Posts

Posted (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 by Vorkitis
Changing subject
Posted (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 by Vorkitis
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...