Dan109 -> Problems with SE_DeleteMission (6/6/2017 7:23:22 AM)
|
Scenario Attached Having problems deleting a mission which was also created in LUA. Sometimes it removes the mission from the assigned craft and leaves the mission available in Mission Editor, sometimes it doesn't do either. I've tried juggling the order, and that seemed to cause the two different undesirable results: if Tool_Range({latitude=my_ref[1].latitude,longitude=my_ref[1].longitude},my_unit.guid) < 0.5 then ScenEdit_SetUnit({side=my_side,name=my_unit.name,RTB=true}) my_mission_name = my_unit.mission.name ScenEdit_DeleteReferencePoint({side=my_side,guid=my_ref[1].guid}) was_deleted = ScenEdit_DeleteMission(my_side,my_mission_name) I'm curious as to why this function has a BOOL return value - I am certainly checking to see that the mission was not properly deleted, but I don't understand the conditions it is expected to fail or how to delete it other than manually in the UI. Due to the ordering of the statements causing some differences, I'm wondering if its some real time issues? Anyways, scenario attached. The LUA Event/Action to pay attention to is "Custom RTB Featurette" - This is t solve the problem with surface vessels not going to Flank Speed, when RTBing. The CUSV assigned to the "FWD Picket" mission will 'bingo' first, and get assigned to a customized RTB mission which places it in the path of the mothership. Once 0.5nm from the ref point, it will flip the RTB Bool and try to "clean up" - deleting the ref point, deleting and unassigning the mission to the craft (later I need to design some KeyVars to retain memory of original mission, to re-assign after docked). The clean up is of course the problem. I have a few other scripts in the Events, a failed attempt to just scan for RTB_Manual and go to Flank(engine doesn't allow this it appears), and a refueling script for surface craft that dock in ships that don't have external UNREP facilities (another issue - a vessel can surely refuel/rearm a vehicle that is docked, but not necessarily be able to do external UNREP with another vessel - LCS is a good example). Anways, the refueling script is ON, but it only triggers every 15min so it can be ignored. The Custom RTB Featurette script triggers every 30s. Thanks!! Dan
|
|
|
|