BIS fnc unpackStaticWeapon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 55: Line 55:
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
<dd class="note">
The following script will create a group consisting of a Team Leader, Gunner and Asst. Gunner and give the group 2 random MOVE waypoints. After the group reached the 1st waypoint, waypoint statement will execute [[BIS_fnc_unpackStaticWeapon]] and the group will stop and unpack static weapon, while leader is given random position to go to. After 10 seconds the [[BIS_fnc_packStaticWeapon]] is executed and the group packs and heads to second waypoint.
The following script will create a group consisting of a Team Leader, Gunner and Asst. Gunner and give the group 2 random MOVE waypoints. After the group reached the 1st waypoint, waypoint statement will execute [[BIS_fnc_unpackStaticWeapon]] and the group will stop and unpack static weapon, while leader is given random position to go to. After 7 seconds the [[BIS_fnc_packStaticWeapon]] is executed and the group packs and heads to 2nd waypoint.
<code>private _group = createGroup west;
<code>[[private]] _group = [[createGroup]] [[west]];
private _pos = player getRelPos [20, 0];
[[private]] _pos = [[player]] [[getRelPos]] [20, 0];
private _randomDir = random 360;
[[private]] _randomDir = [[random]] 360;
private _wp1 = _group addWaypoint [_pos getPos [20, _randomDir], 10];
[[private]] _wp1 = _group [[addWaypoint]] [_pos [[getPos]] [20, _randomDir], 10];
_wp1 setWaypointType "MOVE";
_wp1 [[setWaypointType]] "MOVE";
_wp1 setWaypointStatements ["true", "
_wp1 [[setWaypointStatements]] ["true", "
this allowFleeing 0;
[[group]] this [[allowFleeing]] 0;
[group this, 'StaticWeaponUnpacked', {
<nowiki>[</nowiki>[[group]] this, 'StaticWeaponUnpacked', {
_this [[spawn]]
_this spawn  
{
{
sleep 10;
[[sleep]] 7;
[_this select 0] call BIS_fnc_packStaticWeapon;
[_this [[select]] 0] [[call]] [[BIS_fnc_packStaticWeapon]];
};
};
}] call BIS_fnc_addScriptedEventHandler;
}] [[call]] [[BIS_fnc_addScriptedEventHandler]];
[
[
this,  
this,  
leader this,  
this,  
leader this getPos [1000, random 360],  
this [[getPos]] [1000, [[random]] 360],  
leader this getPos [10, 0]
this getPos [10, 0]
] call BIS_fnc_unpackStaticWeapon;
] [[call]] [[BIS_fnc_unpackStaticWeapon]];
"];
"];
private _wp2 = _group addWaypoint [_pos getPos [20, _randomDir - 180], 10];
[[private]] _wp2 = _group [[addWaypoint]] [_pos [[getPos]] [20, _randomDir - 180], 10];
_wp2 setWaypointType "MOVE";
_wp2 [[setWaypointType]] "MOVE";
private _leader = _group createUnit ["B_Soldier_TL_F", _pos, [], 0, "NONE"];
[[private]] _leader = _group [[createUnit]] ["B_Soldier_TL_F", _pos, [], 0, "NONE"];
private _gunner = _group createUnit ["B_Support_GMG_F", _pos, [], 0, "NONE"];
[[private]] _gunner = _group [[createUnit]] ["B_Support_GMG_F", _pos, [], 0, "NONE"];
private _assistant = _group createUnit ["B_Support_AMG_F", _pos, [], 0, "NONE"];
[[private]] _assistant = _group [[createUnit]] ["B_Support_AMG_F", _pos, [], 0, "NONE"];
units _group doFollow _leader;
[[units]] _group [[doFollow]] _leader;
</code>
</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 00:21, 7 January 2017


Hover & click on the images for description

Description

Description:
/*
	File: fn_unpackStaticWeapon.sqf

	Description:
	Function which uses a weapon team to pack a static weapon such
	as the HMG or Mortar. Requires three personnel in the team as
	a minimum (leader, gunner, assistant).

	Parameter(s):
	_this select 0: the support team group (group)
	_this select 1: location to place gun (position)
	_this select 2: location of target (position)
*/
(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Return Value:
Return value needed

Examples

Example 1:

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Posted on January 6, 2017 - 23:10 (UTC)
Killzone Kid
The following script will create a group consisting of a Team Leader, Gunner and Asst. Gunner and give the group 2 random MOVE waypoints. After the group reached the 1st waypoint, waypoint statement will execute BIS_fnc_unpackStaticWeapon and the group will stop and unpack static weapon, while leader is given random position to go to. After 7 seconds the BIS_fnc_packStaticWeapon is executed and the group packs and heads to 2nd waypoint. private _group = createGroup west; private _pos = player getRelPos [20, 0]; private _randomDir = random 360; private _wp1 = _group addWaypoint [_pos getPos [20, _randomDir], 10]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointStatements ["true", " group this allowFleeing 0; [group this, 'StaticWeaponUnpacked', { _this spawn { sleep 7; [_this select 0] call BIS_fnc_packStaticWeapon; }; }] call BIS_fnc_addScriptedEventHandler; [ this, this, this getPos [1000, random 360], this getPos [10, 0] ] call BIS_fnc_unpackStaticWeapon; "]; private _wp2 = _group addWaypoint [_pos getPos [20, _randomDir - 180], 10]; _wp2 setWaypointType "MOVE"; private _leader = _group createUnit ["B_Soldier_TL_F", _pos, [], 0, "NONE"]; private _gunner = _group createUnit ["B_Support_GMG_F", _pos, [], 0, "NONE"]; private _assistant = _group createUnit ["B_Support_AMG_F", _pos, [], 0, "NONE"]; units _group doFollow _leader;