Problems with SE_DeleteMission (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


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




michaelm75au -> RE: Problems with SE_DeleteMission (6/6/2017 10:38:33 AM)

Yes, there is something off with DeleteMission(). It is failing if any unit being checked does not have a mission assigned. Only place where this is happening so may have just missed it when testing.
Probably worked when the other units of the side had a mission of some type.
For now I think you need to just remove the mission from the unit. You could deactivate it, and use again when RTB is needed on same unit??




Dan109 -> RE: Problems with SE_DeleteMission (6/6/2017 11:27:21 AM)

Yeah, I can add the logic to deal with it. It's a single unit mission though, I didn't want mission editor getting spammed with missions.

Thanks as always for the quick response.

Dan




michaelm75au -> RE: Problems with SE_DeleteMission (6/6/2017 11:36:16 AM)

If you are going to have the event fire so often, you probably want to eventually tick the 'isShown' off. That way it wont spam the screen log with firing messages.

The BOOL return for the DeleteMission() was just so it had something to return. If it return false or nil, then it would have failed. In the case it never got to finish the function, but crashed out of the script.




Dan109 -> RE: Problems with SE_DeleteMission (6/6/2017 12:03:10 PM)

Yeah, I turned it on for your benefit :) the goal is to keep it as silent and transparent as possible. I wouldn't need it if CMANO would speed ships to flank when they rtb. It's been a good learning experience nevertheless.




CCIP-subsim -> RE: Problems with SE_DeleteMission (6/6/2017 1:18:13 PM)

Not entirely the same issue, but to avoid creating too many new threads - just thought I would flag up for Michael as well that at the moment, I'm not having any luck with the new event handling functions either. Even when I duplicate the exact set-ups from the github page, I always get:
"ERROR: [string "Console"]:1: attempt to call global 'ScenEdit_SetTrigger' (a nil value)"




michaelm75au -> RE: Problems with SE_DeleteMission (6/6/2017 2:56:14 PM)

That is new functionality that is not currently in the game. The 'beta' Lua pages have stuff that may not be currently in-game. The normal Lua command pages are more current to what is in the game currently.




michaelm75au -> RE: Problems with SE_DeleteMission (6/6/2017 2:57:48 PM)

Check the drop-down list on the Lua console for commands; it is not there, then it is not yet available.




CCIP-subsim -> RE: Problems with SE_DeleteMission (6/6/2017 4:41:50 PM)


quote:

ORIGINAL: michaelm

Check the drop-down list on the Lua console for commands; it is not there, then it is not yet available.


Good tip, thank you for that [:)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.21875