Jump to content

Recommended Posts

Posted

Hi,

 

I have used Mist 3_3 to DO SCRIPT in a mission trigger with the following code:

 

local vars =

{

type = "Cargo1",

country = 'USA',

category = "Cargo",

x = -338460,

y = 705500,

name = "Cargo_Load1",

heading = 0.47123889803847,

}

mist.dynAddStatic(vars)

 

However, when I went to sling load the cargo it wouldn't allow me to access the "all cargos" option in the comms menu, presumably because the game doesn't recognise this as "can be cargo".

 

Can anyone please tell me what line I should insert into this script so the game recognises this as cargo that can be sling loaded...

 

Thanks in advance.:)

[sIGPIC][/sIGPIC]

Twitch:

 

My Specs:



 

i7 8700K, 32gig Corsair DDR4 3000Mhz, 2080ti, Obutto R3volution, VKB Gunfighter Mk.III MCG Pro EN, Warthog Throttle, Saitek Combat Pedals, Oculus Rift S

 

 

MMSOBGYTAST!

  • 2 months later...
Posted (edited)

Hi Low_Blow,

this is because MIST 3.3 does not honor the needed properties "mass" and "canCargo" (see for yourself within the code there).

 

You need to use the "standard" scripting function "coalition.addStaticObject" (see sample below). Your category name is wrong, it has to be "Cargos" not "Cargo". And you must provide a unique name to it. Mass is in kilograms btw., not pounds as it is in the editor.

 

 

       local zoneTest = trigger.misc.getZone("Dropzone");
       
       coalition.addStaticObject(country.id.USA, {
           country = "USA",
           category = "Cargos",
           x = zoneTest.point.x,
           y = zoneTest.point.z,
           type = "Cargo1",
           name = "Ladung123",
           mass = 113,
           canCargo = true
       });

If done so, the cargo appears and can be selected via menu F6.

Edited by Blindspot

Я только понимаю Вокзал.

  • 5 months later...
Posted (edited)

Cant get Mist to work ...possibly needs whoever is maintaining it to update it to handle Cargo/Cargo1 objects?

 

However after much tinkering using the normal Scripting Engine this appears to work.

It spawns a static cargo unit in the center of a zone, that is identified on the menu and is lift-able.

 

Works on v-1.2.14.35605 ( I fly the Mi8 )

 

zoneCoords = trigger.misc.getZone("ZoneA") -- Gets zone data ... coordinates
StaticData = {
 ["country"] = "USA", 
 ["category"] = "Cargo",
 ["shape_name"] = "ab-212_cargo",      -- ***IMPORTANT*** - without it .. app crashes!! 
 ["type"] = "Cargo1",                  -- 
 ["unitId"] = 1000,                    -- must be unique, other wise will overwrite an existing unit!!
 ["y"] =  zoneCoords.point.z,          -- Note z for y   
 ["x"] =  zoneCoords.point.x,                                       
 ["name"] = "BorisIsATwat",            -- my one eyed goldfish is a better programmer!       
 ["canCargo"] = true,                  -- Make liftable by choppers
 ["mass"] = 5000,                      -- In kilogramms
 ["heading"] = 0,                      -- heading 0 <> 360
}
coalition.addStaticObject(2, StaticData) -- '2' is country .. assigns coalition. 

Edited by RastaPutin
  • 1 month later...
  • Recently Browsing   0 members

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