animateDoor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |0.50|= Game version ____________________...")
 
m (Text replacement - "|= Game name" to "|Game name=")
(26 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma3 |Game name=


|0.50|= Game version
|0.50|Game version=
 
 
|eff= global|Multiplayer Effects=
|arg= global|Multiplayer Arguments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Process animation of door on vehicle. Animation is defined in config file. Wanted animation phase is set to phase.  |= Description
| Animates a door on a vehicle. Animation is defined in config file in [[CfgVehicles]] -> [[Model_Config#AnimationSources| AnimationSources]]. Wanted animation phase is set with phase param. This command works only on animation sources with "door" controller. Door_L in the example below can be animated with [[animateDoor]] but not CargoRamp_Open: <tt>heli [[animateDoor]] ["Door_L", 1];</tt><br><br>
{{Important | [[animateDoor]] <tt>phase</tt> param will be rounded: anything >0.5 will be rounded to 1 and <{{=}}0.5 will be rounded to 0. Therefore it is not possible to open a door half way with this command}} <br>
<syntaxhighlight lang="cpp">
class AnimationSources
{
class CargoRamp_Open
{
source = "user";
animPeriod = 5;
initPhase = 0;
};
class Door_L
{
source = "door";
animPeriod = 1.6;
};
};</syntaxhighlight>
To animate doors or other sources that have "user" controller, use [[animate]] command, or even better, [[animateSource]] (recommended). Sources with "hit" controller can be animated with [[setHitPointDamage]] command applied to the name contained in hitpoint property. For availability of animation sources and their controller types see: [[createVehicle/vehicles]]|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| object '''animateDoor''' [doorname, phase, now] |= Syntax
| object '''animateDoor''' [doorname, phase, instant] |SYNTAX=


|p1= object: [[Object]]  |= PARAMETER1
|p1= object: [[Object]]  |PARAMETER1=  


|p2= [doorname, phase, now]: [[Array]]  |= PARAMETER2
|p2= [doorname, phase, instant]: [[Array]]  |PARAMETER2=  


|p3= doorname: [[String]]  |= PARAMETER3
|p3= doorname: [[String]]  |PARAMETER3=  


|p4= phase: [[Number]]  |= PARAMETER4
|p4= phase: [[Number]]  |PARAMETER4=  


|p5= now: [[Boolean]] |= PARAMETER5
|p5= instant: [[Boolean]] (When [[true]] and phase is either 0 or 1, door will change phase instantaneously) |PARAMETER5=


| [[Nothing]] |= RETURNVALUE
| [[Nothing]] |RETURNVALUE=  




|x1= <code>heli animateDoor ["doors1", 1, false]</code>|= EXAMPLE1
|x1= <code>Taru [[animateDoor]] ["Door_1_source", 1];</code>|EXAMPLE1=
|x2= Open left front door on Ifrit instantly:<code>Ifrit [[animateDoor]] ["Door_LF", 1, [[true]]];</code>|EXAMPLE2=


____________________________________________________________________________________________
____________________________________________________________________________________________


| |= SEEALSO
| [[doorPhase]], [[setFaceAnimation]], [[animate]], [[animationPhase]], [[animateSource]], [[animationSourcePhase]], [[animationNames]] |SEEALSO=  


|  |= MPBEHAVIOUR
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
____________________________________________________________________________________________
}}
}}
Line 44: Line 66:
<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 01:42, 31 August 2019

Hover & click on the images for description

Description

Description:
Animates a door on a vehicle. Animation is defined in config file in CfgVehicles -> AnimationSources. Wanted animation phase is set with phase param. This command works only on animation sources with "door" controller. Door_L in the example below can be animated with animateDoor but not CargoRamp_Open: heli animateDoor ["Door_L", 1];

animateDoor phase param will be rounded: anything >0.5 will be rounded to 1 and <=0.5 will be rounded to 0. Therefore it is not possible to open a door half way with this command

class AnimationSources
{
	class CargoRamp_Open
	{
		source = "user";
		animPeriod = 5;
		initPhase = 0;
	};
	class Door_L
	{
		source = "door";
		animPeriod = 1.6;
	};
};
To animate doors or other sources that have "user" controller, use animate command, or even better, animateSource (recommended). Sources with "hit" controller can be animated with setHitPointDamage command applied to the name contained in hitpoint property. For availability of animation sources and their controller types see: createVehicle/vehicles
Groups:
Uncategorised

Syntax

Syntax:
object animateDoor [doorname, phase, instant]
Parameters:
object: Object
[doorname, phase, instant]: Array
doorname: String
phase: Number
instant: Boolean (When true and phase is either 0 or 1, door will change phase instantaneously)
Return Value:
Nothing

Examples

Example 1:
Taru animateDoor ["Door_1_source", 1];
Example 2:
Open left front door on Ifrit instantly:Ifrit animateDoor ["Door_LF", 1, true];

Additional Information

See also:
doorPhasesetFaceAnimationanimateanimationPhaseanimateSourceanimationSourcePhaseanimationNames

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