Autonomous tilan Disablointi

Post Reply
Bummeri
Posts: 3009
Joined: 09 Nov 2013, 14:35

Autonomous tilan Disablointi

Post by Bummeri »

Tällä skriptillä voi laittaa mm. stomper UGV sellaisiksi, että niitä ei saa automaattisesti ampumaan kohteita, vaan vaatii pelaajohjauksen UAV terminaalilla.

19.03.2018

Code: Select all

/*

Disables the autonomous button on the units UAV terminal so the operator cannot change it. You need to set the autonomous status for the vehicle via script:
uav setAutonomous false;

Run this on a unit you dont want to see the autonomous button UAV terminal. After this the unit cannot change the autonomous status of vehicle on his terminal. If another picks it up, he can if he isnt runing this script.
[] Call Compile preprocessFileLineNumbers "DisableAutonomous.sqf";

*/
//TODO. Test if eventhandler varible can be assigend using :uiNamespace getVariable "RscDisplayAVTerminal". Is the namespace the eventhandler functions different from missionNamespace?
//todo. config version would be ideal, but would need to be a mod?

//Define functions

Bum_DA_fnc_DisableAutonomous = {
	((uiNamespace getVariable "RscDisplayAVTerminal") displayCtrl 116) ctrlShow false; //Disable button.
	[{isNull (findDisplay 160)}, Bum_DA_fnc_RestartProcess] call CBA_fnc_waitUntilAndExecute; //Waituntil display closes, then start the process again.
};

Bum_DA_fnc_RestartProcess = {
	[{!isNull (findDisplay 160)}, Bum_DA_fnc_DisableAutonomous] call CBA_fnc_waitUntilAndExecute;
};

//Start Script

[{!isNull (findDisplay 160)}, Bum_DA_fnc_DisableAutonomous] call CBA_fnc_waitUntilAndExecute; //waituntil display opens.
Käyttö:

1. Laita skripti tiedostoon nimeltä: DisableAutonomous.sqf
2. Pyöritä skripti sellaisilla yksiköillä joiden et halua voivan muutta UAV UGV autonomian tilaa. Esim init.sqf tiedostossa.
3. Aseta UAV UGV autonomia tila sellaiseksi, kun sen haluat pysyvän koko tehtävän ajan.

Kysy apua jos et osaa!
Last edited by Bummeri on 19 Mar 2018, 23:32, edited 3 times in total.
Reason: 1
"Dataa on saatava." -DataNummi
"Toteutus on pilalla, pelkkää paskaa tilalla." -MyösNummi
Post Reply