Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Problems with SE_DeleteMission

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Problems with SE_DeleteMission Page: [1]
Login
Message << Older Topic   Newer Topic >>
Problems with SE_DeleteMission - 6/6/2017 7:23:22 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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

Attachment (1)
Post #: 1
RE: Problems with SE_DeleteMission - 6/6/2017 10:38:33 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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??

< Message edited by michaelm -- 6/6/2017 11:19:51 AM >


_____________________________

Michael

(in reply to Dan109)
Post #: 2
RE: Problems with SE_DeleteMission - 6/6/2017 11:27:21 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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

(in reply to michaelm75au)
Post #: 3
RE: Problems with SE_DeleteMission - 6/6/2017 11:36:16 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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.

_____________________________

Michael

(in reply to Dan109)
Post #: 4
RE: Problems with SE_DeleteMission - 6/6/2017 12:03:10 PM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
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.

(in reply to michaelm75au)
Post #: 5
RE: Problems with SE_DeleteMission - 6/6/2017 1:18:13 PM   
CCIP-subsim


Posts: 695
Joined: 11/10/2015
Status: offline
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)"

(in reply to Dan109)
Post #: 6
RE: Problems with SE_DeleteMission - 6/6/2017 2:56:14 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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.

_____________________________

Michael

(in reply to CCIP-subsim)
Post #: 7
RE: Problems with SE_DeleteMission - 6/6/2017 2:57:48 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Check the drop-down list on the Lua console for commands; it is not there, then it is not yet available.

_____________________________

Michael

(in reply to michaelm75au)
Post #: 8
RE: Problems with SE_DeleteMission - 6/6/2017 4:41:50 PM   
CCIP-subsim


Posts: 695
Joined: 11/10/2015
Status: offline

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

(in reply to michaelm75au)
Post #: 9
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Problems with SE_DeleteMission Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.188