]> git.lizzy.rs Git - worldedit.git/blob - README.md
Fix worldedit.spiral and the correspondign chat command, //spiral.
[worldedit.git] / README.md
1 WorldEdit v0.5 for MineTest 0.4
2 ===============================
3 In-game world editing for [MineTest](http://minetest.net/)! Tons of chat commands to help with building, fixing, and more.
4
5 For more information, see the [forum topic](http://minetest.net/forum/viewtopic.php?id=572) at the MineTest forums.
6
7 Usage
8 -----
9 WorldEdit works primarily through chat commands. Depending on your key bindings, you can invoke chat entry with the "t" key, and open the chat console with the "F10" key.
10
11 WorldEdit has a huge potential for abuse by untrusted players. Therefore, users will not be able to use WorldEdit unless they have the "worldedit" privelege. This is available by default in single player, but in multiplayer the permission must be explicitly given by someone with the right credentials, using the follwoing chat command: `/grant <player name> worldedit`. This privelege can later be removed using the following chat command: `/revoke <player name> worldedit`.
12
13 For in-game information about these commands, type `/help <command name>` in the chat. For example, to learn more about the `//copy` command, simply type `/help /copy` to display information relevant to copying a region.
14
15 Axes
16 ----
17 The coordinate system is the same as that used by MineTest; Y is upwards, X is perpendicular, and Z is parallel.
18
19 When an axis is specified in a WorldEdit command, it is specified as one of the following values: x, y, z, or ?.
20
21 The value ? represents the axis the player is currently facing. If the player is facing more than one axis, the axis the player face direction is closest to will be used.
22
23 Regions
24 -------
25 Most WorldEdit commands operate on regions. Regions are a set of two positions that define a 3D cube. They are local to each player and chat commands affect only the region for the player giving the commands.
26
27 Each positions together define two opposing corners of the cube. With two opposing corners it is possible to determine both the location and dimensions of the region.
28
29 Regions are not saved between server restarts. They start off as empty regions, and cannot be used with most WorldEdit commands until they are set to valid values.
30
31 Markers
32 -------
33 Entities are used to mark the location of the WorldEdit regions. They appear as boxes containing the number 1 or 2, and represent position 1 and 2 of the WorldEdit region, respectively.
34
35 To remove the entities, simply punch them. This does not reset the positions themselves.
36
37 Commands
38 --------
39
40 ### //reset
41
42 Reset the region so that it is empty.
43
44     //reset
45
46 ### //mark
47
48 Show markers at the region positions.
49
50     //mark
51
52 ### //pos1
53
54 Set WorldEdit region position 1 to the player's location.
55
56     //pos1
57
58 ### //pos2
59
60 Set WorldEdit region position 2 to the player's location.
61
62     //pos2
63
64 ### //p set/get
65
66 Set WorldEdit region by punching two nodes, or display the current WorldEdit region.
67
68     //p set
69     //p get
70
71 ### //volume
72
73 Display the volume of the current WorldEdit region.
74
75     //volume
76
77 ### //set <node>
78
79 Set the current WorldEdit region to <node>.
80
81     //set dirt
82     //set default:glass
83     //set mesecons:mesecon
84
85 ### //replace <search node> <replace node>
86
87 Replace all instances of <search node> with <place node> in the current WorldEdit region.
88
89     //replace cobble stone
90     //replace default:steelblock glass
91     //replace dirt flowers:flower_waterlily
92     //replace flowers:flower_rose flowers:flower_tulip
93
94 ### //hollowsphere <radius> <node>
95
96 Add hollow sphere at WorldEdit position 1 with radius <radius>, composed of <node>.
97
98     //hollowsphere 5 dirt
99     //hollowsphere 12 default:glass
100     //hollowsphere 17 mesecons:mesecon
101
102 ### //sphere <radius> <node>
103
104 Add sphere at WorldEdit position 1 with radius <radius>, composed of <node>.
105
106     //sphere 5 dirt
107     //sphere 12 default:glass
108     //sphere 17 mesecons:mesecon
109
110 ### //hollowcylinder x/y/z/? <length> <radius> <node>
111
112 Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>.
113
114     //hollowcylinder x +5 8 dirt
115     //hollowcylinder y 28 10 default:glass
116     //hollowcylinder z -12 3 mesecons:mesecon
117     //hollowcylinder ? 2 4 stone
118
119 ### //cylinder x/y/z/? <length> <radius> <node>
120
121 Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>.
122
123     //cylinder x +5 8 dirt
124     //cylinder y 28 10 default:glass
125     //cylinder z -12 3 mesecons:mesecon
126     //cylinder ? 2 4 stone
127     
128 ### //pyramid <height> <node>
129
130 Add pyramid at WorldEdit position 1 with height <height>, composed of <node>.
131
132     //pyramid 8 dirt
133     //pyramid 5 default:glass
134     //pyramid 2 stone
135
136 ### //spiral <width> <height> <spacer> <node>
137
138 Add spiral at WorldEdit position 1 with width <width>, height <height>, space between walls <spacer>, composed of <node>.
139
140     //spiral 20 5 3 dirt
141     //spiral 5 2 1 default:glass
142     //spiral 7 1 5 stone
143
144 ### //copy x/y/z/? <amount>
145
146 Copy the current WorldEdit region along the x/y/z/? axis by <amount> nodes.
147
148     //copy x 15
149     //copy y -7
150     //copy z +4
151     //copy ? 8
152
153 ### //move x/y/z/? <amount>
154
155 Move the current WorldEdit positions and region along the x/y/z/? axis by <amount> nodes.
156
157     //move x 15
158     //move y -7
159     //move z +4
160     //move ? -1
161
162 ### //stack x/y/z/? <count>
163
164 Stack the current WorldEdit region along the x/y/z/? axis <count> times.
165
166     //stack x 3
167     //stack y -1
168     //stack z +5
169     //stack ? 12
170
171 ### //transpose x/y/z/? x/y/z/?
172
173 Transpose the current WorldEdit region along the x/y/z/? and x/y/z/? axes.
174
175     //transpose x y
176     //transpose x z
177     //transpose y z
178     //transpose ? y
179
180 ### //flip x/y/z/?
181
182 Flip the current WorldEdit region along the x/y/z/? axis.
183
184    //flip x
185    //flip y
186    //flip z
187    //flip ?
188
189 ### //rotate x/y/z/? <angle>
190
191 Rotate the current WorldEdit region along the x/y/z/? axis by angle <angle> (90 degree increment).
192
193     //rotate x 90
194     //rotate y 180
195     //rotate z 270
196     //rotate ? -90
197
198 ### //dig
199
200 Dig the current WorldEdit region.
201
202     //dig
203
204 ### //save <file>
205
206 Save the current WorldEdit region to "(world folder)/schems/<file>.we".
207
208     //save some random filename
209     //save huge_base
210
211 ### //load <file>
212
213 Load nodes from "(world folder)/schems/<file>.we" with position 1 of the current WorldEdit region as the origin.
214
215     //load some random filename
216     //load huge_base
217
218 ### //metasave <file>
219
220 Save the current WorldEdit region including metadata to "(world folder)/schems/<file>.wem".
221
222     //metasave some random filename
223     //metasave huge_base
224
225 ### //metaload <file>
226
227 Load nodes and metadata from "(world folder)/schems/<file>.wem" with position 1 of the current WorldEdit region as the origin.
228
229     //metaload some random filename
230     //metaload huge_base
231
232 WorldEdit API
233 -------------
234 WorldEdit exposes all significant functionality in a simple interface. Adding WorldEdit to the file "depends.txt" in your mod gives you access to all of the `worldedit` functions. These are useful if you're looking for high-performance node manipulation without all the hassle of writing tons of code.
235
236 ### worldedit.volume(pos1, pos2)
237
238 Determines the volume of the region defined by positions `pos1` and `pos2`.
239
240 Returns the volume.
241
242 ### worldedit.set(pos1, pos2, nodename)
243
244 Sets a region defined by positions `pos1` and `pos2` to `nodename`. To clear to region, use "air" as the value of `nodename`.
245
246 Returns the number of nodes set.
247
248 ### worldedit.replace(pos1, pos2, searchnode, replacenode)
249
250 Replaces all instances of `searchnode` with `replacenode` in a region defined by positions `pos1` and `pos2`.
251
252 Returns the number of nodes replaced.
253
254 ### worldedit.hollow_sphere = function(pos, radius, nodename)
255
256 Adds a hollow sphere at `pos` with radius `radius`, composed of `nodename`.
257
258 Returns the number of nodes added.
259
260 ### worldedit.sphere = function(pos, radius, nodename)
261
262 Adds a sphere at `pos` with radius `radius`, composed of `nodename`.
263
264 Returns the number of nodes added.
265
266 ### worldedit.hollow_cylinder(pos, axis, length, radius, nodename)
267
268 Adds a hollow cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
269
270 Returns the number of nodes added.
271
272 ### worldedit.cylinder(pos, axis, length, radius, nodename)
273
274 Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
275
276 Returns the number of nodes added.
277
278 ### worldedit.pyramid(pos, height, nodename)
279
280 Adds a pyramid at `pos` with height `height`.
281
282 Returns the number of nodes added.
283
284 ### worldedit.spiral(pos, width, height, spacer, nodename)
285
286 Adds a spiral at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`.
287
288 Returns the number of nodes added.
289
290 ### worldedit.copy(pos1, pos2, axis, amount)
291
292 Copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes.
293
294 Returns the number of nodes copied.
295
296 ### worldedit.move(pos1, pos2, axis, amount)
297
298 Moves the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes.
299
300 Returns the number of nodes moved.
301
302 ### worldedit.stack(pos1, pos2, axis, count)
303
304 Duplicates the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") `count` times.
305
306 Returns the number of nodes stacked.
307
308 ### worldedit.transpose(pos1, pos2, axis1, axis2)
309
310 Transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes ("x" or "y" or "z").
311
312 Returns the number of nodes transposed.
313
314 ### worldedit.flip(pos1, pos2, axis)
315
316 Flips a region defined by the positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z").
317
318 Returns the number of nodes flipped.
319
320 ### worldedit.rotate(pos1, pos2, angle)
321
322 Rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around the y axis (supporting 90 degree increments only).
323
324 Returns the number of nodes rotated.
325
326 ### worldedit.dig(pos1, pos2)
327
328 Digs a region defined by positions `pos1` and `pos2`.
329
330 Returns the number of nodes dug.
331
332 ### worldedit.serialize(pos1, pos2)
333
334 Converts the region defined by positions `pos1` and `pos2` into a single string.
335
336 Returns the serialized data and the number of nodes serialized.
337
338 ### worldedit.deserialize(originpos, value)
339
340 Loads the nodes represented by string `value` at position `originpos`.
341
342 Returns the number of nodes deserialized.
343
344 ### worldedit.deserialize_old(originpos, value)
345
346 Loads the nodes represented by string `value` at position `originpos`, using the older table-based WorldEdit format.
347
348 This function is deprecated, and should not be used unless there is a need to support legacy WorldEdit save files.
349
350 Returns the number of nodes deserialized.
351
352 ### worldedit.metasave(pos1, pos2, file)
353
354 Saves the nodes and meta defined by positions `pos1` and `pos2` into a file
355
356 Returns the number of nodes saved
357
358 ### worldedit.metaload(pos1, file)
359
360 Loads the nodes and meta from `file` to position `pos1`
361
362 Returns the number of nodes loaded
363
364 License
365 -------
366 Copyright 2012 sfan5 and Anthony Zhang (Temperest)
367
368 This mod is licensed under the [GNU Affero General Public License](http://www.gnu.org/licenses/agpl-3.0.html).
369
370 Basically, this means everyone is free to use, modify, and distribute the files, as long as these modifications are also licensed the same way.
371
372 Most importantly, the Affero variant of the GPL requires you to publish your modifications in source form, even if the mod is run only on the server, and not distributed.