4th parameter of the "mapmodel" command is now a scale factor between
0.25 and 4.0. Values outside that range (like the dummy zero from old
map config files) are interpreted as 1.0
Scaling does not affect the clipping, which has to be adjusted manually.
DOCREF mapmodel editmapmodelslot
deletetextureslot <texture slot number> <"purge"> <replacement slot>
Deletes an unused texture slot. If "purge" is specified as second
argument, it also deletes an used slot. All mapmodels that use that
texture as skin are changed to default skin. All world geometry, which
uses the texture, is instead set to use slot #255 or a specified
replacement slot. Slots below #5 always require "purge", no matter if
they are in use (default slots). Also enables automapconfig.
DOCREF deletetextureslot
chmenutexture <menu name> <texture path>
Displays a texture on the right side of a menu.
menutexturesize <size factor>
Changes the size of textures displayed in menus. Mostly for testing
purposes.
DOCREF chmenutexture menutexturesize
textureslotusagelist <what>
Return a list of 256 numbers representing the number of uses for every
texture slot. If <what> is "onlygeometry", uses as map model skin do
not count. If <what> is "onlymodels", the uses in map geometry do not
count.
gettextureorigin <path>
Returns the location where the texture actually can be found. The
possibilities are:
"official": texture was found in the working directory, which
indicates an official texture.
"custom": texture was found in the profile directory, which means,
the texture is either manually installed or downloaded.
"package dir #x": texture was found in a mod directory.
"<file not found>": that.
textureslotbyname <texture path>
Returns the list of numbers of all texture slots which use that texture
file.
edittexturestack <floor|wall|ceiling> <texture slot number>
Puts a texture slot in a "last used" list up front. The first
parameter picks the list, the second parameter is the texture
slot number to be used for the next edit
getautomapconfig
Returns "1" if automapconfig is already enabled, "0" otherwise.
getmapsoundorigin <path>
Returns the location where the map sound file actually can be found. The
possibilities are:
"official": the sound file was found in the working directory, which
indicates an official mapsound.
"custom": the file was found in the profile directory, which means,
the mapsound is either manually installed or downloaded.
"package dir #x": mapsound was found in a mod directory.
"<file not found>": that.
mapsoundslotbyname <mapsound path>
Returns the list of numbers of all mapsound slots which use that texture
file.
getmapsoundlist
Returns a list of all *.wav and *.ogg files below packages/audio/ambient.
DOCREF textureslotusagelist gettextureorigin textureslotbyname
DOCREF edittexturestack getautomapconfig
DOCREF getmapsoundorigin mapsoundslotbyname getmapsoundlist
"findfilelocation" contains the location, where the file was found.
Not a nice solution, but nice enough :)
Note: if the location is FFL_WORKDIR, the existence of the file has not
actually been checked yet.
The command mapmodelattributes is now more appropriately named
"getmapmodelattributes", and the former "getmapmodelattributes" is now
named "listallmapmodelattributes".
DOCREF listallmapmodelattributes getmapmodelattributes
Moves a menu away from the middle of the screen. Values of "100" represent
half the screen width and height.
menurenderoffset x-offset y-offset
DOCREF menurenderoffset
Pressing the middle mouse button toggles a pin on the "closest entity"
selector. The HUD will indicate the lock by showing "pinned" instead of
"closest" entity. All actions, that would otherwise affect the closest
entity, will affect the pinned entity instead. Deleting the locked entity
will unlock it.
toggleclosestentpin
Toggles the pin on the "closest ent" selector. Bound to MOUSE3
by default.
DOCREF togglelockclosestent
The performance drop is quite small and can completely be disabled by
"hirestextures 0", if needed.
May be revoked, if mappers have no use for it. Just assume this feature to
stay, if textures emerge, which benefit from factor 4 over factor 2.
DOCREF texture
When blocks of map geometry are copy-pasted between maps (or xmaps), this
commit translates the texture slot numbers between different texture
config sets. Missing textures are assigned a slot in the target map.
When texture slots are added, automapconfig gets enabled.
If the paste gets removed by the undo function, the newly assigned texture
slots will NOT be removed. This is by design.
Until now, every texture file was only loaded once after game start. When
a subsequent use of an already in use texture required a different
scaling factor, the texture was not reloaded. Simultaneous use of one
texture file with different scaling factors was completely impossible.
Now, the scaling factor is treated as part of the file name. Therefore, a
texture will be loaded again, if it is needed in a different scaling
factor.
Also: using out of range scaling factors with the "texture" command now
results in an error message. Some map config authors don't use the command
properly...
Also: removed the unneeded createtexturefromsurface()
The commit increases very much speed of demo rewind and also prevents
AC freeze for gamespeed = 1000.
It may degrade physics for gamespeed = 1000 on very low end machines.
BACKSPACE in combination with editmeta (LCTRL) now undeletes the last
deleted entity. BACKSPACE in combination with editmeta2 (LSHIFT) brings
up the menu "deleted entities".
The edit menu now has a submenu "deleted entities" which lists all
deleted entities and undeletes the selected one.
undelent [<index>]
If no index is specified, the last deleted entity is restored. If an
index is given, the specified entity from the list of deleted entities
is restored.
getdeletedentities
Returns a list of deleted entities. Each line contains the entity type,
the position and all seven attributes.
unlistdeletedentity [<which>]
If <which> is a number, the specified entry from the list of deleted
entities gets removed. If <which> is "all", the whole list of deleted
entities gets deleted. If <which> is "last" the last deleted entity is
removed from the list of deleted entities.
Returns the number of entities on the list of deleted entities (even if
the parameter <which> was unknown or not specified).
DOCREF undelent getdeletedentities unlistdeletedentity
Attribute 7 of clip- and plclip-entities now allows four different shapes
for the clips:
0: basic rectangular (like in older AC versions)
1: tilted in direction of x-axis
2: tilted in direction of y-axis
3: rotated by 45 degrees
The shapes 1 and 2 use the value of attr6 as slope angle.
The player only can walk upwards a tilted clip, if the height (attr4) is
at least 0.6 cubes. Slopes steeper than 5.0 can not be walked up (same
maximum step size as for sloped map geometry).
Mappers, please keep in mind: especially tilted clips are more expensive
than regular clips, but they are much cheaper than stairs built from a
bunch of regular clips. Large and small clips cost exactly the same, so
try to combine clips to keep the total number down.
* some cleanups in editing.cpp (putting COMMAND to the function, removing
unnecessary COMMANDF)
* upgrade transformclipentities for floating point clip entities
* changed some entity commands to float attributes
entproperty <attribute index> <attribute increment> [<unscaled flag>]
index and increment work like before, but increment is now a float for
some attributes. If unscaled is "1", increment is applied as unscaled
integer, which means, it will change float attributes at their highest
resolution.
getentattr <attribute index> [<unscaled flag>]
Works like before, but returns float values for some attributes. If
unscaled is "1", raw integer values (representing the highest resolution)
are returned.
entset <type> <attr1> <attr2> <attr3> <attr4>
Works like before, but some attributes may be specified as floats.
editentity <...>
Now uses float values for some attributes. Return values also may be
float.
DOCREF newent entproperty getentattr entset editentity
For example, direction angle values can be reduced to +- 360 degree.
(0..360 would be sufficient, but some people like their angles negative)
This is not a reduction of functionality or a security measure - it's for
convenience only: values now wrap around at the borders of their useful
ranges.
Enable path() to collapse multiple levels of "../" (sauer backport). Clean
up multiple consecutive path delimiters. Remove feature to concat several
paths with '&' delimiters (unused in AC).
Filter paths in findfile() to disallow access to files below the AC root
directory.
This commit fixes the problem which prevented downloaded map models from
using stock textures.
Interpret the values for entity yaw angles and clip entity sizes as
fifths or tenths of cubes or degree.
This makes some entity attributes appear as float values to the user.
The map file still only keeps integer values - but now they are
interpreted differently - for example, a health pack elevation value of 6
now means 0.6 cubes instead of 6.
Note: the scaling factors are hardcoded - use ENTSCALE5 or ENTSCALE10
whereever possible. For generic entity editing, the scaling values are
also stored in entscale[] - but that table can not be changed without
breaking the map format! This scaling is similar to the treatment of the
vdelta values of map cubes.
Interpret the waterlevel value as tenths of a cube.
This makes the waterlevel variable a float value to the user, while the
map file still stores an integer value - but now it is interpreted
differently - for example, a waterlevel value of 123 now means 12.3 cubes
instead of 123. Old map files are converted during loading.
Note: the values of waterlevel and hdr.waterlevel need to be in sync.
DOCREF waterlevel
enumentities <entity type name>
Returns a list of the numbers of all entities of that type. If no such
entities exist or the entity type could not be recognised, the list is
empty.
DOCREF enumentities
Keys 5, 6 and 7 (in combination with the scrollwheel) can be used to alter
the new entity attributes.
Pressing editmeta (LCTRL by default) speeds up the scrolling.
(Parts of the roll code are borrowed from Alejandro V. Garcia's commit
"Model rotations, experimental" from January 2013)
Note: coop edit is now broken between "next" and older clients, but I
don't want to bump the protocol just yet.
Not clearing the menu selection in a followup "newmenu" command does not
seem to have negative effects - and keeps the selection.
Initaction ("menuinit") is now executed before the selction focus is set
during menu->open. This avoids old hover commands to be executed before
the menu gets deleted during rebuild.
Now the command specified by menuinit is executed first, and then the
various menu item init commands (for example getting the value for
menuitemtextinput lines).
This may affect some menu init scripts - but I couldn't find any problems.
It only affects menus which use "menuinit" _and_ menu items with
initialisation.
Only in edit mode: get and set camera position. Returns x, y, z, yaw and
pitch. Sets x, y, z, yaw and pitch, if the parameter is not an empty
string.
example:
echo (gotoposition)
"67.7 78.6 5.5 8 0"
gotoposition "" "" "" 180 0
change yaw and pitch to look straight in +y direction
DOCREF gotoposition
Casting a string constant to "char *" causes segfaults if a command tries
to write to it. Now, empty strings are rarely written to, but it is
inconsistent, if command arguments change memory segments depending on the
argument value.
automapconfig
Enables the "automatic embedded map config data" feature, which means
with the next map save the map config file gets renamed and the map
config data stored inside the map file.
mapsoundslotusage <map sound slot number>
Returns a list of map entity indices which use a certain map sound slot.
If the sound is unused, it returns an empty string.
deletemapsoundslot <map sound slot number> <"purge">
Deletes an unused map sound slot. If "purge" is specified as second
argument, it also deletes an used slot (including all map entities
which use that sound). Also enables automapconfig.
editmapsoundslot <map sound slot number> <map sound path> <maxuses>
Edits path/name and maxuses parameters of a mapsound slot. Only
non-empty parameters actually change something. The command returns
the resulting data of the map sound slot. If only the map sound slot
number is specified, no changes are made, but the current data is
returned. Therefore the command can be used to get and set parameters.
If anything is changed, automapconfig is enabled.
mapmodelslotusage <mapmodel slot number>
Returns a list of map entity indices which use a certain mapmodel slot.
If the mapmodel is unused, it returns an empty string.
deletemapmodelslot <mapmodel slot number> <"purge">
Deletes an unused mapmodel slot. If "purge" is specified as second
argument, it also deletes an used slot (including all map entities
which use that mapmodel). Also enables automapconfig.
editmapmodelslot <mapmodel slot #> <radius> <height> <z-offset> 0 <path>
Edits the parameters of a mapmodel slot. Only non-empty parameters
actually change something. The command returns the resulting data of
the mapmodel slot. If only the mapmodel slot number is specified, no
changes are made, but the current data is returned. Therefore the
command can be used to get and set parameters.
examples:
editmapmodelslot 33 "" "" -5
sets the z-offset of slot #33 to -5 without affecting other params
echo (editmapmodelslot 33)
print the current parameters of mapmodel slot #33
for example: 0 0 0 0 "makke/lightbulb"
If anything is changed, automapconfig is enabled.
gettexturelist <includes> <excludes> <extensions>
Returns a table of all texture files fitting a certain description.
includes
Optional list of path prefixes to include in the table.
excludes
Optional list of path prefixes to exclude from the table.
extensions
Optional list of filename extensions to include in the table.
All files found under packages/textures are examined. By default, the
command returns a list with two columns: path and filename. If "excludes"
is exactly one path prefix to exclude, the table gets a third column
with path names without that prefix. If "extensions" is exactly one
extension which does not start with the character '.', the table gets
an additional (third or fourth) column containing file names without
that extension.
examples:
echo (gettexturelist)
outputs two columns like "noctua/wall" "wall02.jpg"
echo (gettexturelist "" "map_editor skymaps")
same, but omits skymaps and special textures for the editor
echo (gettexturelist makke)
outputs only textures by makke and adds a third column
like "makke/rattrap" "rb_box_03.jpg" "/rattrap"
echo (gettexturelist "skymaps/" "" "_ft.jpg")
outputs four columns like
"skymaps/egypt" "egypt_ft.jpg" "egypt" "egypt"
"skymaps/humus" "meadow_ft.jpg" "humus" "meadow"
textureslotusage <texture slot number>
Returns a list of mapmodels who use that texture as skin. If no mapmodel
uses the texture, but world geometry does, a string of whitespace is
returned. If the mapmodel is unused, an empty string is returned.
deletetextureslot <texture slot number> <"purge">
Deletes an unused texture slot. If "purge" is specified as second
argument, it also deletes an used slot. All mapmodels that use that
texture as skin are changed to default skin. All world geometry, which
uses the texture, is instead set to use slot #255. Slots below #5 always
require "purge", no matter if they are in use (default slots).
Also enables automapconfig.
edittextureslot <texture slot #> <scale> <path>
Edits the parameters of a texture slot. Only non-empty parameters
actually change something. The command returns the resulting data of
the texture slot. If only the texture slot number is specified, no
changes are made, but the current data is returned. Therefore the
command can be used to get and set parameters.
examples:
edittextureslot 33 "" "arcitool/rohbaubims.jpg"
sets texture name of slot #33
echo (edittextureslot 33)
print the current parameters of texture slot #33
for example: 0 "zastrow/3wood_crate_10.jpg"
If anything is changed, automapconfig is enabled.
deleteentity <entity index/number>
Deletes a map entity. (Note: deleting an entity only marks it as unused.
It will be completely removed after saving and loading the map.)
editentity <entity index/number> <x> <y> <z> <attr1> <attr2> <attr3> <attr4>
Edits a map entity. Edits only parameters given a non-empty value.
Returns the values of all attributes (type, x, y, z, attr1-attr4).
examples:
echo (editentity 33)
prints all attributes of map entity number 33
for example "light 174 172 12 20 255 200 200"
editentity 33 "" 173
changes the y-position of entity 33 to 173
rereadtexturelists
Variable, which is set to "1" when a texture is downloaded. Used to
trigger menu rebuilds.
rereadsoundlists
Variable, which is set to "1" when a sound is downloaded. Used to
trigger menu rebuilds.
DOCREF mapsoundslotusage deletemapsoundslot editmapsoundslot
DOCREF mapmodelslotusage deletemapmodelslot editmapmodelslot
DOCREF textureslotusage deletetextureslot edittextureslot
DOCREF gettexturelist deleteentity editentity
DOCREF automapconfig rereadtexturelists rereadsoundlists