Well, that is my problem too. I dont know how to start the machine.
this exec "launch_skeet.sqf" does not work.
Oh, ok. I havent started the campaign yet.
I will try to look into the mission.
Edit:
When try to open FirstToFight (is that the mission you are referring to?) in the editor it crashes.
Edit2:
Ok, I think that skeet_program.sqf is the main script that controls the launch_skeet.sqf. I corrected the path in the skeet_program.sqf.
original
_handle = [_machine] execVM "ca\missions\armory\data\scripts\tryout\pricha ls\s keetShooting\launch_skeet.sqf";
now
_handle = [_machine] execVM "launch_skeet.sqf";
But it still shoots no skeets.
Edit3:
I have found another script that has something to do with the skeet shooting.
I tried it, but with no luck again. With this script Arma2 crashes during the loading of the mission or after a few seconds into the mission.
skeeShooting.sqf
/*
File: skeetShooting.sqf
Author: Joris-Jan van 't Land
Description:
Clear the skeet shooting range.
Parameter(s):
_this select 0: side ID.
_this select 1: type ID.
_this select 2: config entry.
*/
scopeName "root";
disableSerialization;
private ["_sid", "_tid", "_entry"];
_sid = _this select 0;
_tid = _this select 1;
_entry = _this select 2;
LIB_chalChoice = -1;
LIB_pChalInit = true;
//Incoming challenge texts.
private ["_handle"];
_handle = - execVM (LIB_path + "incomingChallenge.sqf");
waitUntil {scriptDone _handle};
if (!LIB_tryout || LIB_goingBack) then {breakOut "root"};
//Show primary challenge acceptance dialog.
_dlg = createDialog "RscLibrary_Challenge";
waitUntil {dialog};
private ["_dialog", "_title", "_description", "_image", "_cTitle"];
_dialog = findDisplay 10002;
_title = _dialog displayCtrl 20001;
_description = _dialog displayCtrl 20002;
_image = _dialog displayCtrl 20005;
_cTitle = localize "STR_LIB_CHAL_SKEET_SHOOT";
_title ctrlSetText _cTitle;
_description ctrlSetStructuredText (parseText ((localize "STR_LIB_CHAL_SKEET_SHOOT_BRIEFING") + "<br /><br />" + (localize "STR_LIB_CHAL_ACCEPT")));
_image ctrlSetText "challenge_skeet_shooting_co.paa";
//Wait for choice or end of LIB_Tryout or close dialog.
waitUntil
{
!dialog
||
!LIB_Tryout
||
LIB_chalChoice != -1
};
if (!dialog || !LIB_Tryout) then
{
//Decline - end challenge.
closeDialog 100002;
LIB_pChalInit = false;
LIB_pChal = -1;
}
else
{
closeDialog 100002;
if (LIB_chalChoice == 1) then
{
//Decline - end challenge.
LIB_pChalInit = false;
LIB_pChal = -1;
}
else
{
LIB_chalObjs = [];
LIB_chalMrk = [];
LIB_chalGrp = [];
//Accept - fade out and in, build challenge.
titleCut ["", "BLACK OUT", 1];
[1, 0, true] call LIB_safeDelayFunction;
startLoadingScreen [localize "STR_LIB_LOADING_ENTRY", "RscLibrary_Load"];
private ["_waterMode"];
_waterMode = [_tid] call LIB_waterModeFunction;
private ["_pos"];
_pos = [[], 0, -1, 30, _waterMode, 20 * (pi / 180), 0, LIB_blackList] call BIS_fnc_findSafePos;
[_sid, _tid, _entry, _pos, "fixed"] call LIB_respawnFunction;
(vehicle player) setDir 0;
//Create firing zone.
private ["_handle"];
if (_tid in [6, 7, 8, 11]) then
{
_handle = [_pos, _entry, _sid, _tid, 0] execVM (LIB_path + "tryout\prichals\skeetShooting\spawnSmallArms.sqf");
}
else
{
_handle = [_pos, _entry, _sid, _tid, 0] execVM (LIB_path + "tryout\prichals\skeetShooting\spawnHeavyArms.sqf");
};
//Create skeet machines (3 positions).
private ["_pos1", "_pos2", "_pos3"];
_pos1 = [(_pos select 0) - 20, (_pos select 1) + 10, 0];
_pos2 = [_pos select 0, (_pos select 1) + 10, 0];
_pos3 = [(_pos select 0) + 20, (_pos select 1) + 10, 0];
//Add concrete blocks under the machines when in water.
if (_tid == 5) then
{
_pos1 = [_pos1 select 0, (_pos1 select 1) + 5, -1.5];
_pos2 = [_pos2 select 0, (_pos2 select 1) + 5, -1.5];
_pos3 = [_pos3 select 0, (_pos3 select 1) + 5, -1.5];
private ["_block1", "_block2", "_block3"];
_block1 = "Land_ConcreteBlock" createVehicle _pos1;
_block2 = "Land_ConcreteBlock" createVehicle _pos2;
_block3 = "Land_ConcreteBlock" createVehicle _pos3;
LIB_dynObjs = LIB_dynObjs + [_block1, _block2, _block3];
LIB_chalObjs = LIB_chalObjs + [_block1, _block2, _block3];
_block1 setPos _pos1;
_block2 setPos _pos2;
_block3 setPos _pos3;
_pos1 = [_pos1 select 0, _pos1 select 1, 0.6];
_pos2 = [_pos2 select 0, _pos2 select 1, 0.6];
_pos3 = [_pos3 select 0, _pos3 select 1, 0.6];
};
private ["_machine1", "_machine2", "_machine3"];
_machine1 = "SkeetMachine" createVehicle _pos1;
_machine2 = "SkeetMachine" createVehicle _pos2;
_machine3 = "SkeetMachine" createVehicle _pos3;
LIB_dynObjs = LIB_dynObjs + [_machine1, _machine2, _machine3];
LIB_chalObjs = LIB_chalObjs + [_machine1, _machine2, _machine3];
_machine1 setPos _pos1;
_machine2 setPos _pos2;
_machine3 setPos _pos3;
_machine1 setDir (180 + 45);
_machine2 setDir 180;
_machine3 setDir (180 - 45);
//Detect player death.
private ["_player"];
_player = player;
//Player waypoint.
private ["_wp1"];
_wp1 = (group player) addWaypoint [_pos, 0];
_wp1 setWaypointType "HOLD";
_wp1 setWaypointDescription (localize "STR_LIB_CHAL_SKEET_SHOOT_TASK_SHORT");
//Player task.
private ["_task", "_descShort"];
_descShort = localize "STR_LIB_CHAL_SKEET_SHOOT_TASK_SHORT";
_task = player createSimpleTask [_cTitle];
_task setSimpleTaskDescription [localize "STR_LIB_CHAL_SKEET_SHOOT_TASK_DESC", _descShort, _descShort];
player setCurrentTask _task;
player createDiaryRecord ["diary", [_cTitle, localize "STR_LIB_CHAL_SKEET_SHOOT_BRIEFING"]];
["random", "daynight", "any"] call LIB_weatherTodFunction;
//Eventhandler for accuracy.
LIB_shotsFired = 0;
(vehicle player) addEventHandler ["Fired", {LIB_shotsFired = LIB_shotsFired + (_this call LIB_shotsFiredFunction)}];
//Main marker.
private ["_marker"];
_marker = createMarker ["LIB_marker_skeetShooting1", _pos];
_marker setMarkerType "hd_flag";
_marker setMarkerColor "ColorBlack";
_marker setMarkerText _cTitle;
LIB_dynMrk = LIB_dynMrk + [_marker];
LIB_chalMrk = LIB_chalMrk + [_marker];
endLoadingScreen;
titleCut ["", "BLACK IN", 1];
[1, 0, true] call LIB_safeDelayFunction;
LIB_pChalInit = false;
LIB_skeetHit = 0;
LIB_skeetFired = 0;
LIB_skeetLanded = 0;
LIB_skeetScore = 0;
LIB_skeetProgram = true;
private ["_endCause", "_timer", "_leftZoneTooLong", "_timeLeftZone", "_timesLeftZone"];
_endCause = -1;
_timer = 0;
_leftZoneTooLong = false;
_timeLeftZone = 0;
_timesLeftZone = 0;
//How many skeets may be missed?
private ["_maxMiss"];
if (cadetMode) then {_maxMiss = 12} else {_maxMiss = 8};
private ["_hintHeader"];
_hintHeader = parseText ("<t size='1.2' color='#ffff7700'>" + _cTitle + "</t><br /><br />");
while {true} do
{
if (!LIB_tryout) exitWith
{
_endCause = 0;
};
if (LIB_abortChallenges) exitWith
{
_endCause = 5;
};
if (_player != player) exitWith
{
_endCause = 1;
};
if (_timer == 4) then
{
//Start launching skeets.
_handle = [[_machine1, _machine2, _machine3]] execVM "skeet_program.sqf";
};
if (({(damage _x) > 0} count [_machine1, _machine2, _machine3]) > 0) exitWith {_endCause = 6};
private ["_hintBody"];
_hintBody = format [(localize "STR_LIB_CHAL_FIRING_RANGE_SHOTS_FIRED") + " " + "%1" + "<br />", LIB_shotsFired];
_hintBody = _hintBody + (format [(localize "STR_LIB_CHAL_SKEET_SHOOT_HIT") + "<br />", LIB_skeetHit, LIB_skeetFired]);
private ["_acc"];
_acc = 0;
if (LIB_skeetHit > 0) then
{
_acc = round ((LIB_skeetHit / LIB_shotsFired) * 100);
};
_hintBody = _hintBody + (format [(localize "STR_LIB_CHAL_FIRING_RANGE_ACCURACY") + " " + "%1%2", _acc, "%"]);
//Detect exit firing zone.
//Give warning first.
if (!((vehicle _player) in (list LIB_firingZoneTrigger))) then
{
if (_timeLeftZone < 10) then
{
if (_timeLeftZone == 0) then {_timesLeftZone = _timesLeftZone + 1};
_timeLeftZone = _timeLeftZone + 1;
_hintBody = _hintBody + "<br /><br />" + (localize "STR_LIB_CHAL_FIRING_RANGE_LEFT_AREA") + "<br />" + (localize "STR_LIB_CHAL_FIRING_RANGE_GET_BACK");
_hintBody = _hintBody + "<br />";
}
else
{
_leftZoneTooLong = true;
};
}
else
{
_timeLeftZone = 0;
};
if (_timesLeftZone > 1) then {_leftZoneTooLong = true};
//Abort because of exiting too often or too long.
if (_leftZoneTooLong) exitWith
{
_endCause = 3;
};
LIB_pChalHint = composeText [_hintHeader, parseText _hintBody];
call LIB_challengeHintFunction;
//All skeets launched.
if (!LIB_skeetProgram) exitWith
{
_endCause = 2;
};
//Missed too many skeets.
if ((LIB_skeetLanded - LIB_skeetHit) > _maxMiss) exitWith
{
_endCause = 4;
};
_timer = _timer + 1;
sleep 1;
};
switch (_endCause) do
{
//Died.
case 1:
{
_task setTaskState "FAILED";
_hintBody = parseText ((localize "STR_LIB_CHAL_DIED") + "<br /><br /><t color='#ffff0000'>" + (localize "STR_LIB_CHAL_FAILED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, _hintBody];
call LIB_challengeHintFunction;
- call LIB_challengeMusicFunction;
LIB_pChalInit = true;
};
//Finished.
case 2:
{
_task setTaskState "SUCCEEDED";
_hintBody = (format [(localize "STR_LIB_CHAL_FIRING_RANGE_SHOTS_FIRED") + " " + "%1" + "<br />", LIB_shotsFired]);
private ["_ptMsg"];
_ptMsg = "";
if (LIB_skeetHit > 0) then
{
_ptMsg = " (<t color='#ff0000ff'>+%3</t>)";
};
_hintBody = _hintBody + (format [(localize "STR_LIB_CHAL_SKEET_SHOOT_HIT") + _ptMsg + "<br />", LIB_skeetHit, LIB_skeetFired, LIB_skeetScore]);
private ["_accScore"];
_accScore = 0;
private ["_acc", "_accMsg"];
_acc = 0;
if (LIB_skeetHit > 0) then
{
_acc = round ((LIB_skeetHit / LIB_shotsFired) * 100);
};
_accMsg = "";
if (_acc >= 85) then
{
_accScore = 15;
_accMsg = " (<t color='#ff0000ff'>+10</t>)";
};
_hintBody = _hintBody + (format [(localize "STR_LIB_CHAL_FIRING_RANGE_ACCURACY") + " " + "%1%2" + _accMsg + "<br />", _acc, "%"]);
private ["_nightScore"];
_nightScore = 0;
if (call LIB_isNightFunction) then
{
_hintBody = _hintBody + ("<br />" + (localize "STR_LIB_CHAL_NIGHT_BONUS") + "<br />");
_nightScore = 10;
};
_hintBody = _hintBody + "<br />";
_hintBody = _hintBody + ("<t color='#ff00ff00'>" + (localize "STR_LIB_CHAL_COMPLETED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, parseText _hintBody];
call LIB_challengeHintFunction;
[1] call LIB_challengeMusicFunction;
LIB_pChalInit = true;
[5, 0, false] call LIB_safeDelayFunction;
private ["_points"];
_points = LIB_skeetScore + _nightScore + _accScore + 10;
[_points] call LIB_addPointsFunction;
};
//Left area.
case 3:
{
_task setTaskState "FAILED";
_hintBody = parseText ((localize "STR_LIB_CHAL_FIRING_RANGE_LEFT_AREA") + "<br /><br /><t color='#ffff0000'>" + (localize "STR_LIB_CHAL_FAILED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, _hintBody];
call LIB_challengeHintFunction;
- call LIB_challengeMusicFunction;
LIB_pChalInit = true;
};
//Too many missed.
case 4:
{
_task setTaskState "FAILED";
_hintBody = parseText ((localize "STR_LIB_CHAL_SKEET_SHOOT_MANY_MISSED") + "<br /><br /><t color='#ffff0000'>" + (localize "STR_LIB_CHAL_FAILED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, _hintBody];
call LIB_challengeHintFunction;
- call LIB_challengeMusicFunction;
LIB_pChalInit = true;
};
//Aborted.
case 5:
{
_task setTaskState "FAILED";
_hintBody = parseText ((localize "STR_LIB_CHAL_ABORTED") + "<br /><br /><t color='#ffff0000'>" + (localize "STR_LIB_CHAL_FAILED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, _hintBody];
call LIB_challengeHintFunction;
- call LIB_challengeMusicFunction;
LIB_pChalInit = true;
};
//Damaged skeet machines.
case 6:
{
_task setTaskState "FAILED";
_hintBody = parseText ((localize "STR_LIB_CHAL_SKEET_SHOOT_MACHINES") + "<br /><br /><t color='#ffff0000'>" + (localize "STR_LIB_CHAL_FAILED") + "</t>");
LIB_pChalHint = composeText [_hintHeader, _hintBody];
call LIB_challengeHintFunction;
- call LIB_challengeMusicFunction;
LIB_pChalInit = true;
};
default {};
};
//Try to make sure the player isn't killed after the challenge ended.
if (alive _player) then {_player setCaptive true};
LIB_skeetProgram = false;
[3, 0, true] call LIB_safeDelayFunction;
if (LIB_tryout) then
{
LIB_pChalHint = "";
call LIB_challengeHintFunction;
if ((_endCause != 1) && !LIB_respawning) then
{
titleCut ["", "BLACK OUT", 1];
[1, 0, true] call LIB_safeDelayFunction;
(vehicle player) removeAllEventHandlers "Fired";
};
call LIB_cleanChallengeFunction;
LIB_pChalInit = false;
LIB_chalFinish = time;
LIB_pChal = -1;
//Respawn unless the player died during the challenge.
if ((_endCause != 1) && !LIB_respawning) then
{
[_sid, _tid, _entry, [], "random"] call LIB_respawnFunction;
titleCut ["", "BLACK IN", 1];
};
};
};
};
true