Jump to content

Recommended Posts

Posted

i am interested in using the spawn static object abilities of MIST but do not understand how the vec2 coordinats are secured for the x/y variables.

 

i also presume i simply use the code as a "DO SCRIPT" with mist appropriately loaded at start?

 

eg.

vars =

{

type = string type,

country = string/number country,

category = string/number category,

x = number x,

y = number y,

groupName/name = string groupName/name,

groupId = number groupId,

clone = boolean clone,

dead = boolean dead,

heading = number heading,

}

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Posted (edited)

maybe this will help, straight from one of my scripts to give you an example

 

if blue_destruct_spawn_ok ~= true then
   if blue_switch_strike == 2 then
       while spawnedgroup_blue_destruct == nil do
       
       if bluebflag_destruct == 1 then
           local zone = trigger.misc.getZone("BSM_0")        -- odd thing is for y axis you must use the z axis... bug with coord system?
           local vars = 
           {
            type = "Tech combine",
            country = 'Russia', 
            category = "Fortifications", 
            x = zone.point.x,
            y = zone.point.z,
            name = "B_Strike_Task_1A", 
            heading = 0.47123889803847
           }
           mist.dynAddStatic(vars)
           local vars2 = 
           {
            type = "Workshop A",
            country = 'Russia', 
            category = "Fortifications", 
            x = zone.point.x,
            y = zone.point.z  + math.random(100, 200),
            name = "B_Strike_Task_1B", 
            heading = 0.47123889803847
           }
           mist.dynAddStatic(vars2)
           local vars3 = 
           {
            type = "Repair workshop",
            country = 'Russia', 
            category = "Fortifications", 
            x = zone.point.x  + math.random(100, 200),
            y = zone.point.z,
            name = "B_Strike_Task_1C", 
            heading = 0.47123889803847
           }
           mist.dynAddStatic(vars3)
           blueobj_destruct = "BLUE STRIKE TASK G"
           mist.respawnGroup('BLUE STRIKE TASK A')
           mist.teleportInZone('BLUE STRIKE TASK A', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK B')
           mist.teleportInZone('BLUE STRIKE TASK B', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK C')
           mist.teleportInZone('BLUE STRIKE TASK C', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK D')
           mist.teleportInZone('BLUE STRIKE TASK D', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK E')
           mist.teleportInZone('BLUE STRIKE TASK E', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK F')
           mist.teleportInZone('BLUE STRIKE TASK F', {'BSM_0'}, true, 500)
           mist.respawnGroup('BLUE STRIKE TASK G')
           mist.teleportInZone('BLUE STRIKE TASK G', {'BSM_0'}, true, 500)

           red_targets_destruct = mist.makeUnitTable({'[g]BLUE STRIKE TASK A', '[g]BLUE STRIKE TASK B', '[g]BLUE STRIKE TASK C', '[g]BLUE STRIKE TASK D', '[g]BLUE STRIKE TASK E', '[g]BLUE STRIKE TASK F', '[g]BLUE STRIKE TASK G'})
           spawnedgroup_blue_destruct = Group.getByName(blueobj_destruct)
           mist.flagFunc.mapobjs_dead_zones{ zones = {'BSM_0'}, flag = 396, req_num = 3 }
           end

maybe a bit more then what you needed, I get a zone which gives me vec3 (i think) i can then reference the different elements of the array with zone.point.x, zone.point.y, zone.point.z and do random math on it to vary its placement a bit. hope this helps.

Edited by =LFC=Chameleon_Silk
  • Recently Browsing   0 members

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