{"name":"ctrlCommit","operator":null,"title":"ctrlCommit","type":"command","url":"https://community.bistudio.com/wiki/ctrlCommit","revid":369237,"updated":"2024-09-03T10:35:01Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Commits control animation to last specified duration.\n\n> [!IMPORTANT]\n> The duration of the animation is not guaranteed to be exactly the same as the given time.","syntaxes":[{"syntax":"control ctrlCommit time","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":"control to animate","types":["Control"],"since":null,"text":"control: Control - control to animate"},{"name":"time","type":"Number","optional":false,"default":null,"description":"animation duration","types":["Number"],"since":null,"text":"time: Number - animation duration"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"time","types":["Number"]}}],"examples":[{"text":"```sqf\n_control ctrlCommit 2; // make animation last approx. 2 seconds\n```","code":["_control ctrlCommit 2; // make animation last approx. 2 seconds"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlCommitted","ctrlSetPosition","ctrlSetFade"],"notes":[{"user":"Nelis75733126","date":"2015-04-11T23:06:00Z","text":"**2024-04-16 edit:**:\n`ctrlCommit` is required to apply the effect of, for example, ctrlSetFade."},{"user":"Demellion","date":"2017-08-28T11:33:00Z","text":"The resulting speed might not to be exactly what ctrlCommit commands it to be. It seems to be dependent on your current framerate. Example:\n\n```sqf\n_ctrl ctrlSetFade 0.5;\n_ctrl ctrlCommit 1;\n```\n\nWill actually result in:\n\n| FPS | Duration |\n|---|---|\n| 60+ | ~1.0s |\n| ~30 | ~1.2s |\n| 10- | ~5-10s |\n\nThis phenomenon probably occurs because of engine time simulation disruption caused by performance damage."}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}