mrSkortch / MissionScriptingTools

Mission Scripting Tools for Digital Combat Simulator
GNU General Public License v3.0
190 stars 42 forks source link

Cannot spawn vehicles on runway #61

Closed davidp57 closed 3 years ago

davidp57 commented 3 years ago

in mist.teleportToPoint, I had to add 'RUNWAY' as a valid terrain type for vehicles :

        local validTerrain = {'LAND', 'ROAD', 'SHALLOW_WATER', 'WATER', 'RUNWAY'}
        if string.lower(newGroupData.category) == 'ship' then
            validTerrain = {'SHALLOW_WATER' , 'WATER'}
        elseif string.lower(newGroupData.category) == 'vehicle' then
            validTerrain = {'LAND', 'ROAD', 'RUNWAY'}
        end
mrSkortch commented 3 years ago

That is done on purpose. Same applies to spawning amphibious ground vehicles in the water via that function. Its meant to be used as a quick and basic way to get randomization. If you want more customized spawning of groups you do the randomization yourself and call mist.dynAdd. However due to a couple of other questions/issues with that function over the years I have added extra parameters to mist.teleportToPoint and the other "inZone" functions. One of the parameters is passing a custom value for validTerrain. There are some things I need to check and cleanup with the code, but be on the lookout for the next development build.

mrSkortch commented 3 years ago

Evidently I added an optional value for that back in November to the function to customize it.

https://github.com/mrSkortch/MissionScriptingTools/commit/4e7b4158f450026182d46e3825c730443cf4cc59#diff-6bf2bee6f25512a5123a016731f9ca78dad770dc7ee8e7a87687b3b60f0ea91eR3460

What I added the other day and committed recently to development branch was the anyTerrain boolean that won't restrict any terrain type.