Jump to content

Recommended Posts

Posted

I am very interested into missions randomization, not to spoil the scenario to the mission maker.

 

I also use random location feature, iterating on every zone which name starts with some specific token (input parameter), to pick up a random location into a random zone. No one will know where to find the guys to rescue or the targets to attack, and your missions are not one-shot anymore. And the mission maker take care of locating zones in suitable areas.

 

Good stuff Grimes :thumbup:

Posted
I also use random location feature, iterating on every zone which name starts with some specific token (input parameter), to pick up a random location into a random zone.

 

Can you please post the script :) ?

 

thanks :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

No problem, I can't see that before this evening (it's also working time in Italy :) )

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

:D

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted (edited)

-- Get a random location in prefixed zones
function getRandomLocationInPrefixedZones(prefix)

   -- Build list of prefixed zones
   local prefixedZones={}
   for zoneName, zone in pairs(mist.DBs.zonesByName) do
       if (string.find(zoneName, "^"..prefix..".*")) then
           table.insert(prefixedZones,zone)
       end
   end
   
   -- Choose one randomly
   local chosenZone = prefixedZones[math.random(#prefixedZones)];
   
   -- Pick-up random location inside
   local result = {}
   result.x = chosenZone.point.x + math.random(chosenZone.radius * -1, chosenZone.radius)
   result.z = chosenZone.point.z + math.random(chosenZone.radius * -1, chosenZone.radius)
   return result
end

E.G.:getLocationInPrefixedZones("rescue") will provide you a random location into one of trigger zones among these which name starts with "rescue"

 

I use this function to locate randomly units with coalition.addGroup() into trigger zones that I define with the mission editor: rescue01, rescue02, rescue03 etc...

 

You can play again and again your mission, units won't be located at the same location !

 

Useful for CSAR mission :thumbup:

Edited by galevsky06
Posted

thanks :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

The short answer is no it doesn't keep the waypoints because it is spawning an entirely new group. Teleportation, group joining, splitting, etc are not naturally part of the sim. The way I am accomplishing it via this script is simply clever use of coalition.addGroup.

 

Once a group spawns you can give it a new task which could be accomplished with mist.getGroupRoute and then modifying the location of the waypoints to work with the new location.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 1 month later...
Posted

While creating a script to respawn tankers, I encountered some strange issues. But I am not sure whether it's a problem with SCT or the SSE:

 

  1. Case: Tanker Airstarting
    sct.cloneGroup('Tanker_Arco', true)
     
    Result: The second tanker appears with the engines off, diving into the ground
     
     
  2. Case: Tanker Rampstart
    sct.cloneGroup('Tanker_Arco', true)
     
    Result: Exactly the same, the second tanker appears (in air!), engines off, nosediving
     
     
  3. Case: As a workaround, I tried to build the group data and create the group with sct.dynAdd:
    local group = sct.getGroupData('Tanker_Arco')
    group.route = { points = mist.getGroupRoute('Tanker_Arco', true) }
    sct.dynAdd('USA', 'AIRPLANE', group)
     
    Result: Good so far. The original group despawns of course, the new tanker starts up and takes off
     
     
  4. Case: Since I don't want a respawn but a clone, my next step was to remove the unit/goup names/ids from the collected data:
    local group = sct.getGroupData('Tanker_Arco')
    group.route = { points = mist.getGroupRoute('Tanker_Arco', true) }
    group.groupName = nil
    group.groupId = nil
    group.units[1].unitId = nil
    group.units[1].unitName = nil
    sct.dynAdd('USA', 'AIRPLANE', group)
     
    Result: The original tanker does it's thing. Starts up and takes off all well. The new group however spawns in, turns the engines off and will sit around idle
     
     
  5. Case: The same code as 4 with the tanker air starting
     
    Result: This is where the circle closes. The new tanker spawns in, engines off, nosediving into the ground.

 

I then created the group data by taking the complete group informations out of the mission file, changed the group/unit names/ids and called coalition.addGroup and everything worked as it should, the second group spawned and took off.

So it's my impression that something within SCT doesn't work out

Tanker Respawn.zip

aka: Baron

[sIGPIC][/sIGPIC]

  • Recently Browsing   0 members

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