File: SetAttachBones.xml

package info (click to toggle)
openclonk 8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 169,656 kB
  • sloc: cpp: 180,484; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 148; sh: 101; javascript: 34
file content (60 lines) | stat: -rw-r--r-- 2,254 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?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-&gt;<funclink>AttachMesh</funclink>(Bow, &quot;pos_hand1&quot;, &quot;main&quot;);
	effect.inhand1 = true;
}

func FxIntCarryBowTimer(object target, effect)
{
	<funclink>if</funclink>(effect.inhand1)
		target-&gt;<funclink>SetAttachBones</funclink>(effect.mesh, &quot;pos_hand2&quot;, nil);
	else
		target-&gt;<funclink>SetAttachBones</funclink>(effect.mesh, &quot;pos_hand1&quot;, 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>