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
- provide a function to easily assemble and execute the command
- context-selective execution of hooks
- restrict potentially exploitable or harmful hooks to singleplayer-modes
Until now, the angles of mapmodels (and ctf-flags) were rounded to the
nearest 15-degree-step during rendering. This patch moves the rounding
to the time of placement of the model. Now the angle can be changed freely
after the model has been placed.
This commit also changes the angle resolution to 0.25 degree.
When changing the angle (press "1" + scrollwheel), additionally pressing
editmeta (a.k.a. LCTRL) changes the increments of the wheel from 1 to 10.
During a savemap with format 9, the angle resolution is reduced again, to
keep compatibility. Therefore, this features is only for testing right now.
It won't be preserved during a save (at least, as long as format 9 is used)
The vantage point is supposed to be a distinctive view on a map - like the
angle from which the preview picture was taken.
This commit adds three commands: clearvantagepoint, setvantagepoint and
gotovantagepoint. None has any parameters, all are only allowed in edit
mode. A map can only have one vantage point.
* make sure, unsaved edits only count in editmode (otherwise "watercolour"
in map configs would already be "edits")
* nicer filenames for backup-xmaps
* catch failed xmap file write access
* unsavededits is now flag (!= 0) and counter - to enable scripts to
detect "new edits".
new commands:
xmap_delete_backup deletes the backup xmap
xmap_keep_backup moves the backup xmap to a regular named spot
xmap_rename changes the nickname of an xmap
An xmap holds everything related to map editing at a certain moment: it is
a map editing snapshot. It contains the name, the header, the geometry,
the entities, the extra headers, the undo/redo data and the cameraposition
from the moment, the snapshot was taken.
Xmaps are held in memory and, if persistentxmaps is set to "1", are saved
at game end and restored at game start.
xmap_list
lists all xmaps currently in memory
xmap_store <nickname>
create a snapshot and store it under the given nickname
(nicknames have to qualify as valid filenames)
xmap_restore <nickname>
restores the named snapshot. Also creates a backup snapshot of the
current editing data.
xmap_restore
restores the last automatic backup snapshot. Automatic snapshots are
taken, a) before a snapshot is restored, b) before a new map is loaded
(if there were unsaved edits on the map) and c) when the game ends (if
there were unsaved edits).
xmap_delete <nickname>
deletes the named snapshot.
Unsaved edits are flagged in the HUD with an "U" in the lower right
corner of the screen.
The files with the persistent xmaps are stored in mapediting/xmaps. After
they were restored at game start, the files are moved to
mapediting/xmaps/backups. Xmap files are cubescript files.
This commit establishes an extensible way of storing additional data in
map file headers. Those header extras can be permanent, like the embedded
config file or be used only once after map load like the undo/redo data.
Additional extra data can be easily added and will not break backward
compatibility, so this map format should hold up for quite some time.
To make things easier for mappers, maps can now be saved without invoking
the various optimisations. That, in combination with the stored undo data,
means, that editing a map can be picked up at exactly the same state, as
the map was saved in.
Maps will automatically be written in the appropriate fashion, depending
on the situation:
1) for sendmap: no optimisation, no undo data
2) savemap during editing: no optimisation, with undo data
3) savemap when not editing: optimised, no undo data
4) savemapoptimised: optimised, no undo data
(For savemap to save different maps during editing, the variable
preserveundosonsave has to be "1". It is "0" by default.)
All of the above map files can be played without problems - they only
differ in file size. (However, maps with undo data may be too big to send)
The new command "embedconfigfile" will load the config file, include it in
the map header and rename the original text file.
"extractconfigfile" will write an embedded config file to a separate file
and remove it from the map header.
Embedded config files take precedence over regular config files and
therefore make it harder for cheaters to play with modified config files.
further changes: cleaned up some debugging code; more ASSERTs
This fix is no longer needed, because the new corner handling in the
physics engine does no longer care about those cubes. Also, they can
now be cleaned up by mapmrproper.
* separated "loading the map" from "collecting map statistics"
* replaced the buggy toptimize with mapmrproper as default
pre-save optimiser
* add timestamps to loadmap-stats
"mapmrproper" tries to optimize hidden attributes of maps in a way, that
the map can be handled in bigger chunks by the renderer.
The mipmapping routine does not take into account, if certain textures
of a cube are visible at all, when it collects otherwise identical cubes
to be handled en-bloc. "mapmrproper" changes invisible textures in a way,
that the cubes are in fact identical - so, that the mipmapper is satisfied.
This optimization is a bit too huge for now, to be used by savemap by
default (instead of toptimize()) - even though mapmrproper is far superior
to toptimize(). Since mapmrproper potentially changes a lot of textures,
it may be too annoying during the creation of a map anyway. It is a tool
to optimize the map, as soon as the geometry (and texturing) is done.
The optimizer does not change any map properties that are visible in any
way. The optical effect of slightly changing lighting of the map is caused
by the (light-) recalc() function at the end of the optimization run.
Every run of recalc() seems to have that effect (check for yourself, by
typing /recalc several times).
Before any changes are made, mapmrproper creates a backup, which can be
restored by "undo" (press "U"). Enable mipstats (F6), to see, what has
been done.
The command "calcmipstats" just counts all the mips in the current map,
and prints their numbers as 1x1/2x2/4x4/8x8/16x16/32x32/64x64.
Keep in mind, that map geometry /and/ lighting affects the mipmapping.
(To get a better idea of this, try changing the "lighterror" parameter)
now /savemap after /newmap saves to "newmap.cgz" instead of ".cgz"
also, voting for a nonexistent map in singleplayer leaves the client in
some sort of a broken state. this fix blocks the vote.
and: newmap is blocked in bot modes, since that isn't working stable.
Older versions of ac did not obey the map header field "headersize".
When a map was written, only the "version" field was updated, even if
the new written header had a different size. Thanks to bigger headers
in map versions 7 & 8 (and now smaller headers again in 9), the headersize
of basically all official maps is bogus. This fix makes sure, only proper
headersizes are written. It also makes the game tolerate different (bigger)
headers - and keeps their content untouched. Future map format extensions
can use this to add header information without breaking existing map parsers.
This patch establishes a new map format 10, which is identical to format 9,
with the exception that the headersize field is guaranteed to be correct.
Format 10 also allows any amount of additional header data.
This patch also cleans up the transformation routines for old map entities.