BIS fnc destroyer01OperateHangarDoors: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "bis_fnc_" to "BIS_fnc_")
(Page filling)
Line 6: Line 6:
|gr1= Destroyer
|gr1= Destroyer


|descr= <pre>/*
|descr= This function is designed to handle animations of ship hangar doors from vehicle user action (see {{Link|#Examples}}).
Author: Bravo Zero One development
It calls [[BIS_fnc_destroyer01AnimateHangarDoors]].
- John_Spartan


Description:
{{Feature|important|Object (ship) must have all animations correctly defined and user actions configured.}}
- This is a sub function designed to handle animations of ship hangar doors.


Execution:
|s1= [shipPart, mode] call [[BIS_fnc_destroyer01OperateHangarDoors]]
- Call from vehicle user actions.


Example:
|p1= shipPart: [[Object]]
class OpenHangarDoor_1
{
displayNameDefault ="<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
displayName = $STR_DN_OUT_O_DOOR;
position = "pos_Door_Hangar_1_Trigger";
priority = 0.4;
radius = 1.5;
onlyForPlayer = 0;
condition = "(((nearestObjects [this,[""Land_Destroyer_01_hull_04_F""],50, false]) select 0) animationPhase ""Door_Hangar_1_1_open"") < 0.1;";
statement = "[this,1] call BIS_fnc_destroyer01OperateHangarDoors;";
};
class CloseHangarDoor_1: OpenHangarDoor_1
{
displayName = $STR_DN_OUT_C_DOOR;
position = "pos_Door_Hangar_1_Trigger";
condition = "(((nearestObjects [this,[""Land_Destroyer_01_hull_04_F""],50, false]) select 0) animationPhase ""Door_Hangar_1_1_open"") >= 0.1;";
statement = "[this,0] call BIS_fnc_destroyer01OperateHangarDoors;";
};


Required:
|r1= mode: [[Number]] - doors' animation state; 1 to open, 0 to close
Object (ship) must have all animations correctly defined and user actions configured.


Parameter(s):
|x1= <sqf>
_this select 0: mode (Scalar)
[this, 1] call BIS_fnc_destroyer01OperateHangarDoors; // to open doors
0: ship-part object
[this, 0] call BIS_fnc_destroyer01OperateHangarDoors; // to close doors
and
</sqf>
1: animation state of doors
<syntaxhighlight lang="cpp">
class OpenHangarDoor_1
{
displayNameDefault ="<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
displayName = "$STR_DN_OUT_O_DOOR";
position = "pos_Door_Hangar_1_Trigger";
priority = 0.4;
radius = 1.5;
onlyForPlayer = 0;
condition = "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') < 0.1;";
statement = "[this, 1] call BIS_fnc_destroyer01OperateHangarDoors;";
};
class CloseHangarDoor_1: OpenHangarDoor_1
{
displayName = "$STR_DN_OUT_C_DOOR";
position = "pos_Door_Hangar_1_Trigger";
condition = "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') >= 0.1;";
statement = "[this, 0] call BIS_fnc_destroyer01OperateHangarDoors;";
};
</syntaxhighlight>


Returns: nothing
|seealso= [[BIS_fnc_destroyer01AnimateHangarDoors]]
Result: Ship's hangar door animation is played with sounds added.
Calls BIS_fnc_destroyer01AnimateHangarDoors to execute action.
 
*/</pre>{{Wiki|placeholder}}<!-- Remove this after fill-in -->
 
|s1= [] call [[BIS_fnc_destroyer01OperateHangarDoors]]
 
|p1=
 
|r1=
 
|x1=
 
|seealso=
}}
}}

Revision as of 21:31, 13 March 2023

Hover & click on the images for description

Description

Description:
This function is designed to handle animations of ship hangar doors from vehicle user action (see Examples). It calls BIS_fnc_destroyer01AnimateHangarDoors.
Object (ship) must have all animations correctly defined and user actions configured.
Execution:
call
Groups:
Destroyer

Syntax

Syntax:
[shipPart, mode] call BIS_fnc_destroyer01OperateHangarDoors
Parameters:
shipPart: Object
Return Value:
mode: Number - doors' animation state; 1 to open, 0 to close

Examples

Example 1:
[this, 1] call BIS_fnc_destroyer01OperateHangarDoors; // to open doors [this, 0] call BIS_fnc_destroyer01OperateHangarDoors; // to close doors
class OpenHangarDoor_1
{
	displayNameDefault		="<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
	displayName 			= "$STR_DN_OUT_O_DOOR";
	position 				= "pos_Door_Hangar_1_Trigger";
	priority 				= 0.4;
	radius 					= 1.5;
	onlyForPlayer 			= 0;
	condition 				= "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') < 0.1;";
	statement 				= "[this, 1] call BIS_fnc_destroyer01OperateHangarDoors;";
};
class CloseHangarDoor_1: OpenHangarDoor_1
{
	displayName 			= "$STR_DN_OUT_C_DOOR";
	position 				= "pos_Door_Hangar_1_Trigger";
	condition 				= "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') >= 0.1;";
	statement 				= "[this, 0] call BIS_fnc_destroyer01OperateHangarDoors;";
};

Additional Information

See also:
BIS_fnc_destroyer01AnimateHangarDoors

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