animateDoor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|M...)
mNo edit summary
 
(33 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command
 
| arma3
 
|0.50


|game1= arma3
|version1= 0.50


|eff= global
|eff= global
Line 11: Line 9:
|gr1= Animations
|gr1= Animations


| 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>
|descr= 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: {{hl|heli [[animateDoor]] ["Door_L", 1];}}{{Feature | important | [[animateDoor]] {{hl|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}}  <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">
<syntaxhighlight lang="cpp">
class AnimationSources
class AnimationSources
Line 27: Line 24:
animPeriod = 1.6;
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]]
</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: [[Arma 3: createVehicle/vehicles]]


| object '''animateDoor''' [doorname, phase, instant]
|s1= object [[animateDoor]] [doorname, phase, instant]


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


|p2= [doorname, phase, instant]: [[Array]]
|p2= doorname: [[String]]
 
|p3= doorname: [[String]]
 
|p4= phase: [[Number]]
 
|p5= instant: [[Boolean]] (When [[true]] and phase is either 0 or 1, door will change phase instantaneously)


| [[Nothing]]
|p3= phase: [[Number]]


|p4= instant: [[Boolean]] - (Optional, default [[false]]) when [[true]] and phase is either 0 or 1, door will change phase instantaneously


|x1= <code>Taru [[animateDoor]] ["Door_1_source", 1];</code>
|r1= [[Nothing]]
|x2= Open left front door on Ifrit instantly:<code>Ifrit [[animateDoor]] ["Door_LF", 1, [[true]]];</code>


|x1= <sqf>Taru animateDoor ["Door_1_source", 1];</sqf>


| [[doorPhase]], [[setFaceAnimation]], [[animate]], [[animationPhase]], [[animateSource]], [[animationSourcePhase]], [[animationNames]]
|x2= Open left front door on Ifrit instantly:
<sqf>Ifrit animateDoor ["Door_LF", 1, true];</sqf>


|
|seealso= [[doorPhase]] [[setFaceAnimation]] [[animate]] [[animationPhase]] [[animateSource]] [[animationSourcePhase]] [[animationNames]]
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
{{GameCategory|arma3|New Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 21:03, 28 September 2023

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: Arma 3: createVehicle/vehicles
Groups:
Animations

Syntax

Syntax:
object animateDoor [doorname, phase, instant]
Parameters:
object: Object
doorname: String
phase: Number
instant: Boolean - (Optional, default false) 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:
doorPhase setFaceAnimation animate animationPhase animateSource animationSourcePhase animationNames

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