kingofnuthin1980   53 Posted December 6, 2021 Hi,  how can I exit a mission with a script, like when hitting the "save and exit" button? I don't want the mission to end.  Thank you in advance for your help 🙂  -Chris   SOLUTION: (findDisplay 46) closeDisplay 4;  Share this post Link to post Share on other sites
Harzach   2517 Posted December 6, 2021 You could use saveGame followed by a server kick, I guess, but there are security issues with scripting server commands. Assuming this is for MP since you want the mission to continue.   2 Share this post Link to post Share on other sites
kingofnuthin1980   53 Posted December 6, 2021 16 minutes ago, Harzach said: You could use saveGame followed by a server kick, I guess, but there are security issues with scripting server commands. Assuming this is for MP since you want the mission to continue.   No, it's for singleplayer. I need the same function as the "save and exit" button in the escape-menu in singleplayer scenarios. When you want to resume the mission at a later time. I can't find the function for that button. Share this post Link to post Share on other sites
Harzach   2517 Posted December 6, 2021 Gotcha. Since endMission deletes mission saves, it's useless in this case. Not sure I can see a solution. There is no function for "save and exit" or even just "exit."  Maybe share your reasoning behind the need for this so we have the full picture. There may be solutions that aren't currently apparent. 1 Share this post Link to post Share on other sites
kingofnuthin1980 Â Â 53 Posted December 7, 2021 That one does seem to do the trick: (findDisplay 46) closeDisplay 4; Â 2 1 Share this post Link to post Share on other sites
ZaellixA Â Â 383 Posted December 8, 2021 On 12/7/2021 at 10:30 AM, kingofnuthin1980 said: That one does seem to do the trick: (findDisplay 46) closeDisplay 4; Â In the documentation it seems like two numbers are used to "emulate" the OK and Cancel buttons. Do you care to elaborate on the use of 4 as an exit code in this case? Share this post Link to post Share on other sites
kingofnuthin1980   53 Posted December 8, 2021 36 minutes ago, ZaellixA said: In the documentation it seems like two numbers are used to "emulate" the OK and Cancel buttons. Do you care to elaborate on the use of 4 as an exit code in this case? Sure. I need it for closing the current mission (without a mission end screen) and loading another from script, and being able to load saves from first mission. I've found the solution in the scripts for the pause menu dialog. Share this post Link to post Share on other sites
ZaellixA Â Â 383 Posted December 8, 2021 Yeah but I mean, what exactly is '4' used for? Does it have a specific meaning, or it is just a number that "people have agreed" to mean something specific? Share this post Link to post Share on other sites
pierremgi   4850 Posted December 9, 2021 Probably from a defineResincl.inc or equivalent: #define IDC_ABORT        4 as predefined control. 5 Share this post Link to post Share on other sites
kingofnuthin1980 Â Â 53 Posted December 9, 2021 34 minutes ago, pierremgi said: Probably from a defineResincl.inc or equivalent: #define IDC_ABORTÂ Â Â Â Â Â Â Â 4 as predefined control. thank you @pierremgi. I've found it somewhere in a script with the closeDialog command, but your information is another piece to the puzzle, making it sure what 4 does. Are you going to update that on the wiki page for closeDialog? Share this post Link to post Share on other sites
soldierXXXX   107 Posted December 9, 2021 For anyone interested, here are the defines of exitcodes (or emulated buttons) extracted from defineResincl.inc . Thank you @pierremgi for pointing it out 🙂 . #define IDC_OK       1 #define IDC_CANCEL     2 #define IDC_AUTOCANCEL   3 #define IDC_ABORT     4 #define IDC_RESTART    5 #define IDC_USER_BUTTON  6 #define IDC_EXIT_TO_MAIN  7 3 2 Share this post Link to post Share on other sites
kingofnuthin1980   53 Posted December 9, 2021 1 hour ago, soldierXXXX said: For anyone interested, here are the defines of exitcodes (or emulated buttons) extracted from defineResincl.inc . Thank you @pierremgi for pointing it out 🙂 . #define IDC_OK       1 #define IDC_CANCEL     2 #define IDC_AUTOCANCEL   3 #define IDC_ABORT     4 #define IDC_RESTART    5 #define IDC_USER_BUTTON  6 #define IDC_EXIT_TO_MAIN  7 this is awesome, because I've also searched for a way to restart. thank you! Share this post Link to post Share on other sites
7erra   629 Posted December 10, 2021 That is a very interesting find and I would never have known that... Added this information to https://community.bistudio.com/wiki/Arma:_GUI_Configuration#Exit_Codes 2 1 Share this post Link to post Share on other sites
Harzach   2517 Posted December 11, 2021 2 hours ago, 7erra said: Added this information  Look who has Biki perms! Thanks @7erra! 2 Share this post Link to post Share on other sites