File: PlaceObjects.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (107 lines) | stat: -rw-r--r-- 4,244 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?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>PlaceObjects</title>
    <category>Objects</category>
    <subcat>Creation</subcat>
    <version>5.1 OC</version>
    <syntax>
      <rtype>int</rtype>
      <params>
        <param>
          <type>id</type>
          <name>definition</name>
          <desc>ID of the object to be created</desc>
        </param>
        <param>
          <type>int</type>
          <name>amount</name>
          <desc>Count of objects to be created</desc>
        </param>
        <param>
          <type>string</type>
          <name>material_name</name>
          <desc>
            Material in which object are to be created. This can be a material name or a string as follows: 
            <table>
              <rowh>
                <col>material_index</col>
                <col>Create in</col>
              </rowh>
              <row>
                <col>"GBackSolid"</col>
                <col>Objects are created in solid material. Also see <funclink>GBackSolid</funclink>().</col>
              </row>
              <row>
                <col>"GBackSemiSolid"</col>
                <col>Objects are created in solid or liquid material. Also see <funclink>GBackSemiSolid</funclink>().</col>
              </row>
              <row>
                <col>"GBackLiquid"</col>
                <col>Objects are created in liquid material. Also see <funclink>GBackLiquid</funclink>().</col>
              </row>
              <row>
                <col>"GBackSky"</col>
                <col>Objects are created in mid-air. Also see <funclink>GBackSky</funclink>().</col>
              </row>
            </table>

          </desc>
        </param>
        <param>
          <type>int</type>
          <name>x</name>
          <desc>Left boundary coordinate of the target rectangle (x coordinate).</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>y</name>
          <desc>Top boundary coordinate of the target rectangle (y coordinate).</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>width</name>
          <desc>Width of the target rectangle. If not specified, the right landscape boundary.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>height</name>
          <desc>Height of the target rectangle. If not specified, the bottom landscape boundary.</desc>
          <optional />
        </param>
        <param>
          <type>bool</type>
          <name>on_surface</name>
          <desc>If <code>true</code>, all objects will be created above the upper surface of the specified material (this might be outside the target rectangle).</desc>
          <optional />
        </param>
        <param>
          <type>bool</type>
          <name>no_stuck</name>
          <desc>If <code>true</code>, placement will not ensure that objects are in solid material. This is needed e.g. when placing objects in liquids.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Creates the specified number of objects in the specified target rectangle and target material (optional). Returns the number of iterations or -1 if creation has failed.</desc>
    <remark>If there is only very little of the target material present in the landscape, placement calculation will take longer.<br/>However, endless retry loops are avoided.</remark>
    <examples>
      <example>
        <code>PlaceObjects(Loam,20,&quot;Earth&quot;,100,0,200)</code>
        <text>Create 20 chunks of loam in earth within the coordinates 100,0 and 200,LandscapeHeight().</text>
      </example>
      <example>
        <code>PlaceObjects(Fish,10,&quot;GBackLiquid&quot;,0,0,0,<funclink>LandscapeHeight</funclink>()/2,0,1);</code>
        <text>Creates a total of 10 fishes in all liquids found in the upper half of the landscape.</text>
      </example>
    </examples>
    <related><funclink>CreateObject</funclink></related>
  </func>
  <author>Tyron</author><date>2004-08</date>
</funcs>