Skip to content

feat: Add helicopter capture objective#197

Open
fishgills wants to merge 3 commits intoCaptainPStar:masterfrom
fishgills:feat/helicopter-objective
Open

feat: Add helicopter capture objective#197
fishgills wants to merge 3 commits intoCaptainPStar:masterfrom
fishgills:feat/helicopter-objective

Conversation

@fishgills
Copy link

Adds a new dynamic objective to capture a helicopter.

This new objective spawns a helicopter with enough seats for the current number of players. The helicopter is guarded by a small group of enemy soldiers.

A new task is created for the players, guiding them to the helicopter's location. The task is completed when the players get close to the helicopter and unlock it.

This objective will only spawn on the Altis and Livonia maps.

Adds a new dynamic objective to capture a helicopter.

This new objective spawns a helicopter with enough seats for the current number of players. The helicopter is guarded by a small group of enemy soldiers.

A new task is created for the players, guiding them to the helicopter's location. The task is completed when the players get close to the helicopter and unlock it.

This objective will only spawn on the Altis and Livonia maps.
Adds a new dynamic objective to capture a helicopter.

This new objective spawns a helicopter with enough seats for the current number of players. The helicopter is guarded by a small group of enemy soldiers.

A new task is created for the players, guiding them to the helicopter's location. The task is completed when the players get close to the helicopter and unlock it.

This objective will only spawn on the Altis and Livonia maps.
This commit introduces difficulty scaling to the helicopter capture objective, ensuring it aligns with the mission's overall difficulty settings.

The number of guards protecting the helicopter is now determined by the `A3E_Param_EnemyFrequency` setting, and their skill level is set based on the `a3e_var_Escape_enemyMinSkill` and `a3e_var_Escape_enemyMaxSkill` variables.

This ensures a consistent and balanced experience for players, as the objective's difficulty will now scale with the rest of the mission.
Comment on lines +64 to +76
// Create task for players
private _taskID = "A3E_Task_CaptureHeli_" + str (round (random 1000));
[
"A3E_Task_CaptureHeli",
true,
[
"An abandoned helicopter has been spotted. If you can capture it, you might be able to use it for extraction. It is likely guarded, so approach with caution.",
"Capture Helicopter",
"Capture Helicopter"
],
_heli,
"CREATED"
] remoteExec ["BIS_fnc_taskCreate",-2, _taskID];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that the task was not created correctly and was not working for me. I ended up changing it on my end and I replaced the task creation with just a marker creation with a helicopter icon that would work like the other ammo depots and motor pools on the map.

Suggested change
// Create task for players
private _taskID = "A3E_Task_CaptureHeli_" + str (round (random 1000));
[
"A3E_Task_CaptureHeli",
true,
[
"An abandoned helicopter has been spotted. If you can capture it, you might be able to use it for extraction. It is likely guarded, so approach with caution.",
"Capture Helicopter",
"Capture Helicopter"
],
_heli,
"CREATED"
] remoteExec ["BIS_fnc_taskCreate",-2, _taskID];
// Set marker
private _taskID = "A3E_Task_CaptureHeli_" + str (round (random 1000));
[_taskID,_heli,"o_air"] call A3E_fnc_createLocationMarker;
_marker = createMarkerLocal [_taskID,_heli,"o_air"];
_marker setMarkerShapeLocal "ELLIPSE";
_marker setMarkerAlphaLocal 0;
_marker setMarkerSizeLocal [50, 50];

I changed your task code to the following and it worked fine for me but as I said I ended up removing it:

Suggested change
// Create task for players
private _taskID = "A3E_Task_CaptureHeli_" + str (round (random 1000));
[
"A3E_Task_CaptureHeli",
true,
[
"An abandoned helicopter has been spotted. If you can capture it, you might be able to use it for extraction. It is likely guarded, so approach with caution.",
"Capture Helicopter",
"Capture Helicopter"
],
_heli,
"CREATED"
] remoteExec ["BIS_fnc_taskCreate",-2, _taskID];
// Create task for players
private _taskID = "A3E_Task_CaptureHeli_" + str (round (random 1000));
private _taskParams = [
true, // owner: true for all playable units
_taskID, // taskID: unique task ID
[
"An abandoned helicopter has been spotted. If you can capture it, you might be able to use it for extraction. It is likely guarded, so approach with caution.", // Description
"Capture Helicopter", // Title
"Capture Helicopter" // Marker (deprecated)
],
objNull, // destination: objNull = hidden on the map
"CREATED", // state: initial state is "CREATED"
-1, // priority: Don't auto assign
false // showNotification: true to show notification
];
_taskParams remoteExec ["BIS_fnc_taskCreate", allPlayers]; // Execute BIS_fnc_taskCreate on all clients

@hunterkiller2011
Copy link

The function was not running for me, I was getting an error regarding an undefined variable in fn_initServer.sqf. I had to add class createHeliCapture {}; to class Server in functions.hpp in order for the script to execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants