forked from Mirrors/openclonk
61 lines
2.2 KiB
XML
61 lines
2.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<!DOCTYPE funcs
|
|
SYSTEM '../../../clonk.dtd'>
|
|
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
|
<funcs>
|
|
<func>
|
|
<title>SetAttachBones</title>
|
|
<category>Objects</category>
|
|
<subcat>Display</subcat>
|
|
<version>5.1 OC</version>
|
|
<syntax>
|
|
<rtype>bool</rtype>
|
|
<params>
|
|
<param>
|
|
<type>int</type>
|
|
<name>attach_number</name>
|
|
<desc>Number of the attached mesh. The return value of <funclink>AttachMesh</funclink> provides such a number.</desc>
|
|
</param>
|
|
<param>
|
|
<type>string</type>
|
|
<name>parent_bone</name>
|
|
<desc>Bone of the calling object at which to attach the mesh.</desc>
|
|
<optional />
|
|
</param>
|
|
<param>
|
|
<type>string</type>
|
|
<name>child_bone</name>
|
|
<desc>Bone of the object to be attached.</desc>
|
|
<optional />
|
|
</param>
|
|
</params>
|
|
</syntax>
|
|
<desc>If a mesh was previously attached to another mesh then this function can be used to change one or both of the bones at which they are attached. To only change a single bone the other parameter can be set to <code>nil</code>.</desc>
|
|
<examples>
|
|
<example>
|
|
<code>func FxIntCarryBowStart(object target, effect)
|
|
{
|
|
effect.mesh = target-><funclink>AttachMesh</funclink>(Bow, "pos_hand1", "main");
|
|
effect.inhand1 = true;
|
|
}
|
|
|
|
func FxIntCarryBowTimer(object target, effect)
|
|
{
|
|
<funclink>if</funclink>(effect.inhand1)
|
|
target-><funclink>SetAttachBones</funclink>(effect.mesh, "pos_hand2", nil);
|
|
else
|
|
target-><funclink>SetAttachBones</funclink>(effect.mesh, "pos_hand1", nil);
|
|
effect.inhand1 = !effect.inhand1;
|
|
}</code>
|
|
<text>Script for an <emlink href="script/Effects.html">effect</emlink>: Initially the clonk carries a bow and for each timer call the bow is switched from its left hand to its right hand or vice versa.</text>
|
|
</example>
|
|
</examples>
|
|
<related>
|
|
<funclink>AttachMesh</funclink>
|
|
<funclink>DetachMesh</funclink>
|
|
<funclink>SetAttachTransform</funclink>
|
|
</related>
|
|
</func>
|
|
<author>Clonk-Karl</author><date>2010-04</date>
|
|
</funcs>
|