the same mousewheel direction now always moves an entity away from or
towards the player
entproperty
if 100 is added to the attribute index parameter, the sign of the
increment value is changed
editaxis
returns a value for the main axis of player orientation (X:11, Y:12,
Z:13) and adds 100 if the player is looking in the negative
direction of the axis
DOCREF entproperty editaxis
(editentity, edittextureslot, editmapmodelslot, editmapsoundslot)
the commands are still not allowed to change anything in coop, but
information retrieval is ok
- make sure, nextclosestent works for pinned entities
- menu entries for nextclosestent
- highlight closest ent
- have closestenttype return the current value and not change the value if
the argument is "-"
- recognise manually changed closestenttypes in the menu
DOCREF closestenttype
- replace by simple bitmask
- rewrite showedithide, setedithide and seteditshow in cubescript
- menu added for convenient use
setedithide and seteditshow no longer accept entity type numbers as
parameters - only entity type names
showedithide, setedithide and seteditshow are considered deprecated
edithideentmask
Integer variable containing a bitmask of hidden entity types.
DOCREF showedithide setedithide seteditshow edithideentmask
pointatent 0|1
enables (1) or disables (0) pointing at entities
if an entity is poiinted at during disabling, it is pinned
pointatentmaxangle a
specifies the required precision for pointing at entities
DOCREF pointatent pointatentmaxangle
In old versions of AC it was necessary to trick with heightfields to raise
a pickup entity. However, for quite some time now, pickups can be raised
by attribute.
This additional stage for convmap finds pickup entities where the
heightfield is most probably unnecessary. Fixing is manual work, though.
Updated those pickups on 16 maps.
Also fixed a playerstart on desert3
Restore the old persistidents system from AC 1.0, since it's working as
intended - if used properly.
As a reminder:
* aliases created by "const" and "tempalias" are never persistent
* aliases created or altered by "alias" or "=" become persistent, if
the persistidents flag is set during that operation
* persistidents if false during the execution of almost all config files
during game start - those files can create aliases with default values
which will not be persistent (until changed later while the flag is
set)
* before saved.cfg is executed, the flag is set and stays set all
throughout the game - which means, that all changes (from menus, for
example) will change the altered alias to "persistent"
* exceptions for map or model config files are unnecessary, since those
run restricted and can't create aliases anyway
* exceptions are necessary for "late run" config files like those in
config/opt/
The new command "persistidents" may be used to manually set or clear the
flag. It also returns the current state of the flag. If used in a config
file, the flag is restored to its original value when the file ends
execution.
In short: only late-run config files (meaning: run after saved.cfg was
restored) may need to manually set/reset the flag. Use const and tempalias
where appropriate and clear persistidents before creating an alias with a
not-to-save default value that may be changed and made persistent later.
DOCREF persistidents
Add some commands to support an entity TODO list. Entity errors during
map load are automatically added to the list. The list is saved and
restored with xmaps. A keybind (no default key assigned) to scroll
through TODO entities was added.
The list is indented as a means for automated map check scripts to
return a list of entities to fix.
cleartodoentities [index]
Clear list of TODO entities. The list is also deleted, when a new map
is loaded.
If an entity number is given as an argument, only entries for this
entity are cleared.
addtodoentity index comment
Add the entity #index to the TODO list. Add optional comment.
enumtodoentities
Returns a list of TODO entities. Returns entity index number and comment
for every entry.
DOCREF enumtodoentities addtodoentity cleartodoentities
The edit protocol now allows the following commands in multiplayer:
arch, slope, edittag, edittagclip, selectionrotate, selectionflip
also:
mapenlarge has been limited to size 10 in multiplayer
entitiy undelete in multiplayer has been fixed
SV_EDITS, SV_EDITD and SV_EDITE are to be cleaned up with a protocol bump
DOCREF arch slope edittag edittagclip selectionrotate selectionflip
* removed convertcase
use toupper (concat A B C D ....) instead
* moved several COMMAND macros to their function bodies
* cleaned up screenshot extension handling
* prefix screenshot argument with "screenshot/" and add correct extension
Calculate some key values to determine map geometry viability.
mapareacheck <what>
Returns different sets of statistics, depending on the keyword "what":
vdelta
Returns table of numbers of cubes within a certain range of vdelta
differences (steepness)". First entry is "0..2 cubes steep", next is
"2..4" and so on.
steepest
Returns the coordinates of the steepest heightfield cube.
total
Returns the number of non-solid cubes on the map.
pprest
Returns the number of cubes _not_ visible from one of the probe
positions.
pp (default)
Returns a table of all (currently 64) probe points of the map. Each
probe point is listed with:
- x-coordinate
- y-coordinate
- floor height
- area visible
- volume of visible area
- average height in visible area
DOCREF mapareacheck
* do not use std::abs() because math.h includes one, that converts ints
to double. Use own iabs(), which directly uses labs() instead.
* don't use the word "gamma" as name for variables
* don't use a homebrew round() function
getclosestent
Returns the entity index number of the closest entity (or of the
pinned entity, if one exists). Returns -1, if no entities are on the map.
Returns always exactly the entity, that edit commands like delent
will use next.
DOCREF getclosestent
addentity <type>
Adds an entity of the specified type at the current camera position
and returns the index number of the new entity, so that the other
attributes can be set by editentity.
DOCREF addentity
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
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
* 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.
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.
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
This patch enables an option to keep the map config embedded in the map
file - with autogenerated content. Any changes to map config data will be
written with the map. This includes data by loadnotexture, loadsky,
mapmodel, texture, fog, fogcolour, mapsound and shadowyaw. Once enabled,
all changes with those commands become persistent to the map.
New variables:
mapsoundchanged
Set to "1" with every command that changes mapsound slots. Should be
used to trigger a rebuild of mapsound menus.
New/changed commands:
mapsound
Now returns the number of the created slot.
mapmodel
Now returns the number of the created slot.
texture
Now returns the number of the created slot.
loadsky
Is now a builtin string variable (instead of a command), which means,
that the current value can easily be retrieved or edited.
The skymap name in the argument is now required to start with
"textures/skymaps/" - but that part of the path can be omitted.
examples:
loadsky steini/steini2 (loads textures/skymaps/steini/steini2_*)
loadsky textures/skymaps/steini/steini2 (same)
loadsky ../foo/bar (loads textures/foo/bar_*)
echo $loadsky
getnotexture
Returns the current "notexture" path. (Set by loadnotexture)
dumpmapconfig (available for debug binaries only)
Writes the current automatically generated map config to
dumpmapconfig.txt.
DOCREF mapsoundchanged mapsound mapmodel texture loadsky getnotexture
An alias, that was at least once used with the new "tempalias" will not be
written to saved.cfg.
So, now there are four ways to create aliases:
1) alias (or "=")
General alias, who's value gets saved at game exit in saved.cfg, and
restored at the next restart - unless the alias was created at a time,
where persistidents was zero (usually during execution of the game's own
config files during startup).
2) const
Creates an alias, that can not be changed. Makes it harder for users
to destroy their config.
3) push
Reassigns an alias with a new value. After "pop", the old value is
restored. Allows the use of "local" aliases in scripts. Also avoids
name conflicts.
4) tempalias
Like "alias", but the value will not be written to saved.cfg.
The commit also changes aliases, written by the engine itself, to "temp":
gametimestart, __getmaprevisions
DOCREF tempalias
* new command "listoptions" lists the argument options for several
argument types like entities, weapons and teamnames
* "burstshots", "weapon", "magcontent", "magreserve", "fragmessage" and
"gibmessage" now allow guns to be specified by name
* "addpunct" allows plaintext arguments like "brackets" and "quotes"
* the "team" command now understands numeric teams
* entity types can now be specified by type index number
* removed some lists from the config files (now provided by listoptions)
* added argument completion for several commands
* change nextprimary from integer to string variable
DOCREF listoptions burstshots weapon addpunct
DOCREF fragmessage gibmessage magcontent magreserve
DOCREF nextprimary