galevsky06 Posted July 9, 2013 Posted July 9, 2013 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:
chromium Posted July 10, 2013 Posted July 10, 2013 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 :) 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.
galevsky06 Posted July 10, 2013 Posted July 10, 2013 Can you please post the script :) ? thanks :) Sure, I will do it tonight (working time in France).
chromium Posted July 10, 2013 Posted July 10, 2013 No problem, I can't see that before this evening (it's also working time in Italy :) ) 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.
chromium Posted July 10, 2013 Posted July 10, 2013 :D 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.
galevsky06 Posted July 10, 2013 Posted July 10, 2013 (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 July 10, 2013 by galevsky06
chromium Posted July 10, 2013 Posted July 10, 2013 thanks :) 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.
galevsky06 Posted July 10, 2013 Posted July 10, 2013 I edited the code above, since I created by hand without test and there was an error....
spinter Posted July 15, 2013 Posted July 15, 2013 sct.teleportToPoint (vars) I would like to know if it is normal that teleport a group does not keep the waypoints? the properties of the group are deleted? How can I teleport with all its Properties to? ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
Grimes Posted July 15, 2013 Author Posted July 15, 2013 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 Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
St3v3f Posted August 28, 2013 Posted August 28, 2013 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: Case: Tanker Airstarting sct.cloneGroup('Tanker_Arco', true) Result: The second tanker appears with the engines off, diving into the ground Case: Tanker Rampstart sct.cloneGroup('Tanker_Arco', true) Result: Exactly the same, the second tanker appears (in air!), engines off, nosediving 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 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 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 outTanker Respawn.zip aka: Baron [sIGPIC][/sIGPIC]
Recommended Posts