Jump to content

toutenglisse

Members
  • Posts

    1745
  • Joined

  • Last visited

3 Followers

Personal Information

  • Location
    French Alps

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, if you want to remove previous flag values you need small script - here is another thread with close-alike problematic (but will need adaptation) :
  2. I would use dynAdd or addGroup and destroy when conditions met.
  3. Hi, I don't know if it is normal or not, but when missing a variable by mistake using mist.scheduleFunction(function f ,table vars ,number t , number rep ,number st ), it creates an "error in error handling", instead of creating a usual log error with indication of problematic function and line inside the script to help debug (UTD mist 4.5.126).
  4. I can confirm that a scripted refueling task using pushtask does work like you describe , and after refueling the AI resumes previous task (in my case a follow task).
  5. There is an option with script, that is "respawning" your aircraft with updated position and vector, but can only work in single player, and is probably a bit "dirty" in action. Little test attached (2 client slots to choose from on runway, F16 and F18, and when you kill the mig29 you have a 10sec delay and respawn in air where you are - mig29 also respawns). test-restore-player-AC-on-kill.miz
  6. I've just tried "sample test" using your description. I don't know why but both "if not Group.getByName('GROUP') then" and "if mist.groupIsDead('GROUP') == true then" return unexpected data. It does work with : local gp = Group.getByName('GROUP') if gp and gp:isExist() == true and #gp:getUnits() > 0 and gp:getUnit(1):isActive() then else mist.respawnGroup('GROUP', true) end
  7. Hi, here is a working edited version of your miz. I changed line 6. With your script, when the late activated group is destroyed, and then checked again by function, groupIsDead returns false (instead of true, probably because late activated group specificities?) and then the function tries to access to unit 1 that doesn't exist anymore and that creates the error. So the 1st 2 radio command pushes work and then error happens (activate - destroy - error). VKN_Marianas_Training_Mission_Forum-EDIT.miz
  8. Hi, you should use instead this function : MIST groupIsDead - DCS World Wiki - Hoggitworld.com Because Group.getByName() can still return Group Object for a dead group.
  9. I think your sdposV2 is wrong. It is a table of 2 values, when it should be a table of 2 indexed values (x and y) : sdposV2 = {x=sdposV3.x,y=sdposV3.z}
  10. @dimitriov there is a flaw in my script. It works if used once by each vehicle groups, but issue raise if function is used multiple times by a group (due to flags values being manually set and to the way env.mission updates points when setTask Mission is used). Here is the updated miz example (script is updated and instead of manually set flag values for wpts > 0, each wpt need to set flag value = flag value +1). test-GroundVeh-resume-route-after-setTask.miz
  11. @dimitriov I wrote the script with env.mission datas and used setTask Mission to resume route and put it in this example. (so without using mist) The vehicle enters a zone ("debut tir") that activates a triggered task (fire on point) using AI SET TASK (so this task deletes the route, and without action when the task is complete the vehicle just stands on place without resuming). 45 seconds after "debut tir" task, the function ResumeRoute is used with groupname and flagname as parameters and the vehicle resumes its route toward remaining waypoints. Only requirement, apart using the function when needed to resume, is to set flag value for waypoints > 0 (value = 1 for wpt 1 etc...) by script in advanced wpt action.
  12. You could get route from env.mission, remove points the same way with flag, and setTask Mission with updated route. I usually use Mist because of minimal workload with handy functions.
  13. @dimitriov if you want to see a working example using it (in the example - replacement of an aircraft by same aircraft but from enemy coalition to act as defection, that continues the route of previous aircraft from the point where it is spawned - I use mist.getCurrentGroupData and mist.getGroupData instead of mist.getGroupRoute, but works the same) you can download this .miz :
  14. Hi Nicolas, the only way I actually found to handle that is : - get route/WP using mist function - get trace of WP already reached using a flag (value +1 when a new WP is reached) - and resume route, updated by removing already reached WP using this little function : function GoUDRoute() GroupRoute = mist.getGroupRoute(GroupName, true) for i = 1, trigger.misc.getUserFlag(FlagName) do table.remove(GroupRoute, 1) end mist.goRoute(GroupName, GroupRoute) end Have a nice day Pierre
  15. @dFlow, your local table plane does not respect the structure of an aircraft group (or any group, even ground group), for example you have have stacked in the root ("group" datas) datas that belong to "units" ("units" must be present with numerically indexed unit(s), and units datas inside). You also gave strings to entries that need number (groupId, unitId), or other kind of not valid values (you would even better get ridd of some entries like group/unit ID, callsign, onboard num, names, and let scripting engine create unique available values when spawning). To be safe at first, you should create the plane group using mission editor in a clean mission, save mission, unzip from mission.zip the file named "mission" and open it with notepad++ to get the aircraft group table as created by mission editor. From there you could copy the group table to your script and change the datas you want to be dynamically set (spawn position/orientation, route, names, payload, options, tasks, or whatever...) and be sure you use correct values type to feed it.
×
×
  • Create New...