Search the Community
Showing results for tags 'terminate'.
Found 3 results
-
How to stop a script when running another script?
csk222 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello. How can I stop a script from completing once it has started by overriding it by running another script? I have looked into terminate and exitwith, but I can't quite work it out. Example/Scenario: I send a helicopter to an insertion point (LZ1). Half way I don't want to go to LZ1 and give it a new insertion point (LZ2). Then I decide to just go back to base (RTB). The helicopter will follow all of the commands and fly towards the insertion points and land back at base. Fine! But when it lands, all of the notifications from the previous insertion point orders will display back to back to back. How do I prevent that? Insertion: RTB: This runs the scripts Here is an example video: Helicopter Insertion Script Run Multiple Times - Notifications Stack At The End Thank you. -
Need hintSilent to disappear after time (1min)
ROTAHOE posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
This script is called by a key press to show how long till server restart. All is working but the hint is staying on screen forever. Want to have the script terminate 1min after the key is pressed but also need it so it can be called multiple times. _restart = ["RestartText","RTX"] call BASE_fnc_getCfgValue; _restartTime = parseNumber (["RestartTime","RTX"] call BASE_fnc_getCfgValue); _color1 = ["RestartTimeColor","RTX"] call BASE_fnc_getCfgValue; _serverTime = (round(_restartTime-(serverTime)/60)); _hours = (floor(_serverTime/60)); _minutes = (_serverTime - (_hours * 60)); switch(_minutes) do { case 9: {_minutes = "09"}; case 8: {_minutes = "08"}; case 7: {_minutes = "07"}; case 6: {_minutes = "06"}; case 5: {_minutes = "05"}; case 4: {_minutes = "04"}; case 3: {_minutes = "03"}; case 2: {_minutes = "02"}; case 1: {_minutes = "01"}; case 0: {_minutes = "00"}; }; hintSilent parseText format [ "<t color='#%1' align='left' size='0.9'>%4</t><t align='right' size='0.9'>%2H:%3M</t><br/>", _color1, /* %1 */ _hours, /* %2 */ _minutes, /* %3 */ _restart /* %4 */ ]; Any help would be amazing Cheers -
Function / Script cannot be re-executed after terminate
Godis_1 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I am using a function for conversations. It's defined in CfgFunctions and called via spawn command. Now I want to archive that conversation stops if the unit (conversation partner) gets killed. The units with the conversation action are civilians, spawned dynamically via Engima's Civilians script. I could do that with: // inside attached action to all civilian units: /* ...some code... */ handle = [params] spawn createConversation; // And this in unit's eventhandler: if (not isNil {handle} and {not scriptDone handle}) then { terminate handle}; The problem is, when I want to start another conversation now with a different unit, the conversation (or better saying: the createConversation function) doesn't execute anymore. How can I make sure that the function gets executed again? As I understand, the terminate command fires when the spawned script is processed the next time by the scheduler. In my case it immediately stops the conversation when the civilian gets killed, but it seems to also terminating the next started conversation, and so on. I also tried it without the "killed" eventhandler, and instead in units callback (like init field) did this: // No conversations with dead civs waitUntil { // exit when unit gets deleted if (isNull _unit) exitWith {true}; !alive _unit; }; sleep 1; _unit removeAction talk; if (not isNil {handle} and {not scriptDone handle}) then { terminate handle}; I couldn't find anything helpful... could someone help me, please? Thx in advance