This adds a means to store additional attributes for mapmodels, including
a caching mechanism, so the mapmodels don't have to be loaded to access
the information. The goal is, to provide fully automatic mapmodel menus
for map editing who also add information about downloaded mapmodels.
Model attributes are extracted everytime, when a model is loaded. At game
end, all available data is written to config/mapmodelattributes.cfg and
restored at next startup. On release, a file with all (but only) official
models should be included. Since autodownloaded models are usually "loaded"
after download, those are automatically added to the database. If someone
adds models manually to the directories (media pack, w/e), the command
"loadallmapmodels" can be used to try to find all available models. The
only way to delete something from the database, is to delete the file
config/mapmodelattributes.cfg when the game is closed.
The current list of attributes is:
keywords
List of one or more menu topics to list the model under. Check
config/menus_edit.cfg for available keywords. Unknown keywords will
be listed separately.
desc
Short name or description of the model. Will be used as menu entry.
usage
Important information for how to use that specific model.
author
Who created the mapmodel. If it's a derivative of another model, state
the author of the mod (refer to the original author under "license", if
you like). Always use the exact same spelling for the same author, to
allow menus to automatically group models by author.
license
Free-text attribute for license info or info about additional
contributors (or original authors for derivated works).
distribution
One of "official", "autodownload" or "manual". Other values default to
"manual". This is used to determine, if a map contains only original
media or media that can be download automatically.
version
Single numerical value to separate older from newer versions. Defaults
to zero. Higher numbers mean "newer". Maybe someone manages to implement
a versioning system for custom media in the future...
New commands:
mdlattribute <attr> <value>
To be used in model config files. Adds a value for a specified
attribute to the model.
mapmodelregister <modelpath> <attr1> <attr2> ...
Adds values for all attributes to a specific mapmodel. This is used to
restore the cached values from config/mapmodelattributes.cfg during
game start. Does not actually verify of load the model.
mapmodelattributes <modelpath> <attr>
Returns the value of a specific attribute of a mapmodel. If modelpath
is a number, it is interpreted as index for the list of models in the
current map config. If no attribute name is specified, all attributes
are printed to the console instead.
getmapmodelattributes <list of attribute names>
Returns a table of all known mapmodels. Each model is listed with the
modelpath and the values for the requested attributes. To be used
instead of a fixed table in menu_edit.cfg. In addition to attribute
names, the function also allows the keywords "explodekeywords" and
"sortby:" as arguments. If "explodekeywords" is given, all mapmodels
with more than one keyword are listed multiple times, once for each
keyword. If an attribute name is preceeded by "sortby:" the list will
be sorted by this table column. If "sortby:" is used several times,
this first sort will have highest priority. The list is always sorted
by path by default.
example:
getmapmodelattributes sortby: author sortby: desc explodekeywords
loadallmapmodels
Tries to load mapmodels from /all/ paths below packages/models/mapmodels.
Will throw a lot of error messages, because not all directories contain
models to load. This command can be used to build or rebuild the
complete list of all available mapmodels. It is only necessary, if models
are added manually to the directories, since every mapmodel gets added
to the list when it is loaded - which takes care of all automatically
downloaded models.
DOCREF mdlattribute mapmodelregister mapmodelattributes
DOCREF getmapmodelattributes loadallmapmodels
* Fixed completely broken hitsound mute toggle
* Moved bullet sound toggles into appropriate menu
* Changed heartbeat toggle to use muteitem (for consistency)
* Fixed footsteps toggle (Previous behavior was to turn off all
footstep sounds, a toggle already existing elsewhere, rather
than muting the specific sound as it's intended to)
* Sorted sound menu (At grenadier's request)
"editbind E edittoggle" is needed for such cases, when edittoggle will be
bounded to key, for which editbind exists. Then that will allow to
exit from edit mode still with use a key.
auto-generate mapmodel menus depending on the actually available models
in the current map config.
Also fixes memory leak in "newmenu".
DOCREF mapmodelname mapmodelbyname mapmodelchanged
Changes:
1. added single aliases bounded to the keys, in order to maintain easier
the binds;
2. cleaned up binds;
3. updated Keyboard menu and fixed searching binds.
Remark: aliases bounded to the keys shouldn't have leading and trailing
white spaces, if they are present in Keyboard menu, otherwise they won't
be found. So construction like, for example: bind SLASH [ key_commandline ]
is inadmissible.
4. Alternate edit binds (default disabled) moved to
config/opt/alternateeditbinds.cfg and removed old_editbinds variable.
DOCREF old_editbinds
Fixed nested list in Cubescript, fixed conopen (now read-only), removed changeteam(),
fixed name of shortcuts for team survivor modes (so it fixes
https://github.com/assaultcube/AC/issues/73 ).
DOCREF ts tsurv btsurv
curmenu gives back the name of the currently open menu, which can be used
to close just that.
The new script "closecurmenu" uses curmenu to close the current menu.
DOCREF curmenu closecurmenu
All cfg-files in config/autostart get executed during startup.
- more appropriate directory name and place
- files are now sorted alphabetically, as promised
- doubles are removed (resulting from identical file names in home and
install tree) since they would only result in files run twice
- scripts with file names prefixed with "_veryfirst_", "_beforesaved_"
or "_aftersaved_" will be run as very first config file, right before
saved.cfg or right after saved.cfg
- all remaining files will be run right before autoexec.cfg
- the directory "config/autostart" will be created, if it doesn't already
exist in the home tree
* no more need to delete aliases "onQuit"
* removed on_quit.cfg
* moved faq.cfg, parsestrings.cfg and survival.cfg to config/opt
* run faq.cfg and survival.cfg when needed
DOCREF addListOnQuit
Defaults to omitting variables from saved.cfg, that are still at default
value. By setting omitunchangeddefaults to zero, those variables get
written, but commented out. The variable "groupvariables" sets the number
of variables with similar names, that can be grouped on one line. Setting
it to zero will additionally write min, max and default values and a
short description of the variable to file.
In general, variables, that are still at default value, will not be
restored from saved.cfg, so when the default in the game is changed, all
clients will use that new default. This way, testers don't have to erase
their saved.cfg as often.
DOCREF omitunchangeddefaults groupvariables
* use the same list of gun names for all occasions
* switched syntax, so that argument completion will work
* support old syntax, so old config files will work
* fix path handling by disallowing paths altogether ;)
DOCREF loadcrosshair
allows a SVAR to be assembled when needed
also:
* mapmsg is now a SVAR
* getmapmsg was removed (now: $mapmsg)
* new editsvar script to edit any SVAR in the console buffer
* nonfunctional menu removed
DOCREF mapmsg getmapmsg editsvar
* 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
Alternative views in the serverbrowser are implemented with use favourites.
Categories (names) of favourite servers, which will be displayed on the
views, have to be included in "serverbrowseraltviews" alias (accessible
in menu).
Switching between views is possible with use Alt + Mouse wheel and
Alt + Up/Down (or eventually "[" and "]", if they are dedicated keys
on your keyboard).
The commit also:
1. adds MATCH category to favourites;
2. shows category name in settings of favourites;
3. shows weights in serverbrowser instead of favourites image,
when showweights = 1;
4. cleans up some tabs.
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 commit:
1. does serverdescription keyword case insensitive for
showonlyfavourites > 0;
2. fixes typo in argument of alias in keyword;
3. fixes disabling background color for servers of the category, when
alpha is changed to 0;
4. shows 0 instead of 10 in info about digit, which toggles 10th category;
5. adds info about "image" attribute in favourites.cfg;
6. adds new feature: "Search for servers".
* shows all geometry data of the cube in editing focus in the hud
* can be toggled by F8 in editmode
* shows cuby type, floor and ceiling heights, vdelta and all textures
(if mipstats *and* edit focus details are requested: show focus detail)
* fixing edit paste
* fix power of 2 check for corner selection
* fix pasting multiple selections changed target selections
* fixing editdrag: plugging memory leak
* fixing editdrag: proper binding of keys
* fixing editdrag: allow deselecting (by selecting a second time)
* make a little more room for undos (RAM is cheap and maps are big)
* some cleanups
- fix possible crash in conc (but it's still an ugly hack)
- fix noob usage of strcmp
- flag some memory leaks (it would be nice, if the author(s) would clean
up the mess himself)
- fix crash in substr
- whitespace cleanup
there are plenty more memory leaks in command.cpp - for example, every
goto in cubescript does not clean up anything
It shouldn't work in multiplayer and when gamespeed is less than 10 and grather than 1000.
To test bug type in multiplayer, for example: "/changespeed 1100 30" .
To see this bug just start AC, run bot team mode and watch:
- "enemies" menu instead of "team enemies" menu,
- number of players less by 2 than should be.
- press B to get the former filled volume view
- raise the value of tagnumfull to get both views simultaneously
- cubescript parameters should be cleaned up before release