41fa9e1b34a839ba0265bc95c47d932a3b311b77
selectionwalk action beginsel endsel
The command iterates over all cubes in all selections and executes
"action" for each cube. The cubes of every selection are framed by
executions of "beginsel" and "endsel". The action script is allowed
to make changes to cube attributes, and if it does, an undo point is
automatically added. "beginsel" and "endsel" are optional.
While the scripts are executed, several aliases provide further info:
sw_cursel
Position and size of the current selection. Valid in all three
scripts. Holds four integer values for x, y, xs, ys. See command
"selection" for details.
(all following aliases are only valid during the execution of the action
script and provide the attributes of one cube of the map)
sw_abs_x
sw_abs_y
sw_rel_x
sw_rel_y
Absolute and relative (within the current selection) coordinates of
the current cube. Read-only values.
sw_type
Type of the current cube. Can be 0..4 for SOLID, CORNER, FHF, CHF and
SPACE. May be changed to other numerical value or keyword.
sw_floor
sw_ceil
Floor and ceiling heights of the current cube. Range -128..127
sw_wtex
sw_ftex
sw_ctex
sw_utex
Texture slot indices for wall, floor, ceiling and upper wall of the
current cube.
sw_vdelta
sw_tag
Vdelta and tag values of current cube.
sw_r
sw_g
sw_b
Current light values of current cube. Can be edited, but only with
temporary effect. Will be reset with the next light recalc.
The command is mostly useful for statistics scripts (like counting cubes
with certain attributes), but is can also be used for scripted editing,
as the following (useless) example shows:
selectionwalk [ += sw_floor (rnd 2) ]
Further changes:
The command listoptions now also can return the names of cube types:
echo (listoptions cubetypes)
The command countwalls is now implemented as a script instead of a
builtin command. The script works better, because it doesn't create
unnecessary undo points.
DOCREF selectionwalk listoptions countwalls
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="refresh" content="0; url=docs/index.html">
<meta name="description" content="Documentation index of the game AssaultCube @ http://assault.cubers.net/">
<meta name="author" content="Rabid Viper Productions">
<meta name="copyright" content="You may be able to redistribute this content under specific conditions.
Please read the licensing information, available @ http://assault.cubers.net/docs/license.html for the
conditions that would apply to what you may be redistributing.">
<title>AssaultCube Documentation</title>
<style type="text/css">
body
{
background-color: #222222;
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
Languages
C
57.9%
C++
27.6%
Shell
11.1%
Python
1.2%
Makefile
1%
Other
1.1%