-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace createVehicleCrew with fn_createCrew #963
Open
PiG13BR
wants to merge
18
commits into
KillahPotatoes:v0.96.8
Choose a base branch
from
PiG13BR:v0.96.8
base: v0.96.8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−35
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f393828
Update fn_tutorial.fsm
PiG13BR 050906e
Update fn_tutorial.fsm
PiG13BR 4079f0c
Update open_arsenal.sqf
PiG13BR 3bb7aa8
Merge branch 'KillahPotatoes:v0.96.8' into v0.96.8
PiG13BR d964b00
Add files via upload
PiG13BR 061cd36
Update fn_forceBluforCrew.sqf
PiG13BR 1b0e40a
Update CfgFunctions.hpp
PiG13BR bb135e0
Update fn_spawnVehicle.sqf
PiG13BR ffd3304
Update spawn_air.sqf
PiG13BR 8f9da9d
Update send_paratroopers.sqf
PiG13BR c9c1921
Update fn_spawnVehicle.sqf
PiG13BR 5da59c7
Update custom.sqf
PiG13BR 2553429
Update custom.sqf
PiG13BR b924e4b
Placeholder types in fn_createCrew.sqf
PiG13BR 00a57de
(0.98) Hotfix arsenal init for CBA_A3 3.18
PiG13BR 7a97364
Update Missionframework/functions/fn_createCrew.sqf
PiG13BR df17748
Update Missionframework/functions/fn_createCrew.sqf
PiG13BR f94c5fe
Update Missionframework/functions/fn_createCrew.sqf
PiG13BR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
File: fn_createCrew.sqf | ||
Author: PiG13BR - https://github.com/PiG13BR/ | ||
Date: 2024-26-08 | ||
Last Update: 2024-27-08 | ||
License: MIT License - http://www.opensource.org/licenses/MIT | ||
|
||
Description: | ||
Creates vehicle crew based on preset configuration only | ||
|
||
Parameter(s): | ||
_vehicle - Vehicle to add crew | ||
_side - crew side: KPLIB_side_enemy or KPLIB_side_player (Default: KPLIB_side_enemy) | ||
|
||
Returns: | ||
Array - [Crew created, group] | ||
*/ | ||
|
||
params[ | ||
["_vehicle", objNull, [objNull]], | ||
["_side", KPLIB_side_enemy, [sideUnknown]] | ||
|
||
]; | ||
|
||
if (isNull _vehicle) exitWith {["No vehicle provided"] call BIS_fnc_error}; | ||
|
||
private _typeCrew = ""; | ||
|
||
// Placeholder types | ||
switch (_side) do { | ||
case KPLIB_side_enemy : { | ||
_typeCrew = KPLIB_o_rifleman; | ||
}; | ||
case KPLIB_side_player : { | ||
_typeCrew = KPLIB_b_crewUnit; | ||
} | ||
}; | ||
|
||
/* | ||
Save it for later changes | ||
switch (_side) do { | ||
case KPLIB_side_enemy : { | ||
if (_vehicle isKindOf "Air") then { | ||
_typeCrew = KPLIB_o_pilot; | ||
} else { | ||
if ((_vehicle isKindOf "Tank") || {_vehicle isKindOf "Wheeled_APC_F"}) then { | ||
_typeCrew = KPLIB_o_crewman; | ||
} else { | ||
_typeCrew = KPLIB_o_rifleman; | ||
} | ||
} | ||
}; | ||
case KPLIB_side_player : { | ||
if (_vehicle isKindOf "Air") then { | ||
_typeCrew = KPLIB_b_heliPilotUnit; | ||
} else { | ||
if ((_vehicle isKindOf "Tank") || {_vehicle isKindOf "Wheeled_APC_F"}) then { | ||
_typeCrew = KPLIB_b_crewUnit; | ||
} else { | ||
_typeCrew = KPLIB_b_crewStatic; | ||
} | ||
} | ||
} | ||
}; | ||
*/ | ||
|
||
private _grp = createGroup [_side, true]; | ||
private _allCrew = []; | ||
|
||
{ | ||
private _crew = [_typeCrew, getPosATL _vehicle, _grp] call KPLIB_fnc_createManagedUnit; | ||
_allCrew pushBack _crew; | ||
|
||
if (_x isEqualTo [-1]) then { | ||
_crew assignAsDriver _vehicle; | ||
_crew moveInDriver _vehicle; | ||
} else { | ||
_crew assignAsTurret [_vehicle, _x]; | ||
_crew moveInTurret [_vehicle, _x]; | ||
}; | ||
} forEach (_vehicle call BIS_fnc_vehicleCrewTurrets); | ||
|
||
|
||
// Return all the vehicle crew and its group | ||
[_allCrew, _grp] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we nix this change? It's out of scope and covered by #970