Commit Graph
170 Commits
Author SHA1 Message Date
aurhatanddrian b8b0eb96bd Hide spectator reflection and fix moving in 3rd person perspective
Earlier in third person perspective:
1. reflection of the spectator (player1) was visible on the water (at least
after full cycle of spectate mode switching);
2. it was possible to move position of the invisible spectator's (player1)
ghost, although he should be attached to spectated player. Bug was visible
on the water (the reflection moved) and in some cases on minimap - when
player executed "spectate" and later "spectatemode 1", then camera stayed
in the same position, but player position changed.

Thanks BrutalSystem
2021-02-15 05:29:36 +01:00
drian b615fe449e Merge remote-tracking branch 'remotes/origin/next' into release_v1.3 2021-02-10 21:00:09 +01:00
aurhat 07d8d7657a Remove attack animation of clients during grenade activation 2017-10-09 20:09:42 +02:00
ac-stef cb51e9f422 untangle entity rendering
fix unbatched model roll
2017-06-27 15:15:25 +02:00
ac-stef 3a320de948 cleanup cpistol 2017-06-27 15:15:25 +02:00
ac-stef e29bb2aa2d simplify decision to render corpse
instead of checking for actual gibs, check for "was gibbed"

fixes problems with still existing gibs when the player dies again fast
enough
2017-06-27 13:31:02 +02:00
ac-stef 03e21b097d fix stuff found by cppcheck
almost 3000 lines of "errors" contained one actual memleak, one actually
unused variable and three actual ambiguous code parts

from cppcheck website: "The goal is to detect only real errors in the
 code (i.e. have zero false positives)." :)

thx for finding five problems in our code
2017-06-17 12:40:35 +02:00
ac-stef 2448e90bf2 convmap changes
new tool: list media sources
new stage: check vantage points
new: add single map from menu
new: option to abort maps on stage errors

fixed: make sure, player is alive (to be able to enter edit mode) during
conversions
2017-06-16 16:05:03 +02:00
ac-stef d7277c1aa4 fix permissions for some edit commands
- always allow read-only edittextureslot, editmapmodelslot and
  editmapsoundslot
- allow setvantagepoint when editing offline or spectating offline
- new var editing_sp: 1 during edit mode in singleplayer (offline)
- additional menus for read-only access to map config slots
- new bonus edit scripts: selectmiddle and unclipentclippedmodels

DOCREF edittextureslot editmapmodelslot editmapsoundslot setvantagepoint
DOCREF editing_sp
2017-06-14 16:33:58 +02:00
ac-stef 661ee6eff2 distinguish between files and directories
listfiles now optionally sorts the list and removes doubles
2017-06-12 18:17:15 +02:00
ac-stef b2890a3334 allow more edit commands in multiplayer
(editentity, edittextureslot, editmapmodelslot, editmapsoundslot)

the commands are still not allowed to change anything in coop, but
information retrieval is ok
2017-06-09 21:52:55 +02:00
ac-stef ec2cdb4533 print filenames for errors in map and model config files 2017-05-17 14:13:45 +02:00
ac-stef 6bafdb0037 allow particle type names in md2emit and md3emit
md[2|3]emit <tag name> <particle type> <attrib1> <attrib2>

  particle type may now be numeric 0..19 or one of SPARK, SMOKE, ECLOSEST,
  BLOOD, DEMOTRACK, FIREBALL, SHOTLINE, BULLETHOLE, BLOODSTAIN, SCORCH,
  HUDMUZZLEFLASH, MUZZLEFLASH, ELIGHT, ESPAWN, EAMMO, EPICKUP, EMODEL,
  ECARROT, ELADDER, EFLAG

also: cleanup

DOCREF md2emit md3emit
2017-05-16 17:50:00 +02:00
ac-stef abd37fe6d4 add command to rebuild mapmodel registry
While the mapmodel registry works fully automatically for all auto-
downloaded models, it does not check for manual changes to the filesystem.
To clear models from the list that have been deleted from the profile
directory and to add models that have been downloaded outside the game,
this new menu entry can be used.

mapmodelregistryclear deletes all loaded mapmodel attributes

loadallmapmodels checks the filesystem for mapmodels and loads them
(all trees below packages/models/mapmodels, in home, zips, mods, install)

Both together rebuild the whole mapmodel database.

DOCREF mapmodelregistryclear
2017-05-12 13:27:57 +02:00
ac-stef a1687afb4c remove realtime model modding
models can still be changed by mod packages
2017-05-01 22:01:14 +02:00
ac-stef 68c7ad1fe6 cleanup pi
use only one constant for Pi, in case we ever need to change it
2017-04-28 15:18:00 +02:00
ac-stef 967fd62077 cleanup 2017-04-26 16:14:39 +02:00
aurhat 419f667c0d Fix player model attack animations
Fixed animation of other players during following activities:
1. during jumping and attack - show attack animation;
2. during weapon reloading - don't show attack animation;
3. during grenade activation - don't show attack animation.
2017-03-21 23:50:45 +01:00
ac-stef 5af661ddeb debug switch to filter out some load_world errors
do not flag some map config errors that can be fixed by search&replace
(for use in map conversion scripts only)
2016-11-01 00:40:10 +01:00
ac-stef 71a12bfe82 allow custom mapmodels to depend on other custom mapmodels
By adding a "requires"-attribute to the mapmodel config file, a mapmodel
can trigger the map editor to include another model and have it loaded
during map load. This can be used to create model modifications which
use ressources of another model. For example, a new model can provide a
different skin for an existing model - and that attribute will make sure,
that the required original model is also loaded.

This mechanism does not work, if the attribute is changed after the map
is finished, because the map editor has to copy the dependency into the
map config file. After adding the attribute, the map has to be written at
least once (the dependencies are checked during savemap).

The point of dependency-attributes is to make sure the custom original
model is also loaded from a package server. Mods of official models do not
need to use the attribute, because the official model does not need to be
downloaded. The attribute is necessary, if one model on akimbo depends on
another model on akimbo.

The mapmodels that are required by other models have an additional
parameter "1" added to their mapmodel command in the config file - which
will preload the model during map load, even if no entity actually uses it.
The additional parameter is handled automatically.

The new command updatemapmodeldependencies triggers the dependency check
manually - which will make required models appear in the model list. This
is done automatically during savemap.

Changed commands:

  mapmodelslotusage

    now returns a single space, if the model slot is not used by any
    map entity, but is required by another model (with entities)

  mapmodel

    allows one more parameter - if "1", the model is preloaded, even if
    no entities use it

  mdlattribute requires <modelname>

    if used, specifies that the current model depends on parts of another
    custom model (which therefore also has to be downloaded)

    can only be used once per model config

    example:

      mdlattribute requires makke/signs/exit

        could be used in signs/loading-dock/md2.cfg to reuse
        makke/signs/exit/tris.md2

DOCREF mdlattribute mapmodel mapmodelslotusage
2016-10-16 21:54:22 +02:00
ac-stef 985048efda fix loadallmapmodels
now also loads models with paths that include '.'
2016-10-13 23:42:04 +02:00
ac-stef bb8bfeb752 mute error messages while probing default model skins
Unless otherwise specified in a config file, every model (md2 or md3)
tries to load skin.jpg, skin.png, ../skin.jpg and ../skin.png (in that
order). This commit silences the errors if some of those attempts fail.

There is still an error message, if none of the four files can be found.

The commit also deletes five identical skin.jpg and places one in ../
2016-10-11 21:36:49 +02:00
ac-stef 397c441fed more verbose error messages for disabled commands 2016-09-16 17:35:47 +02:00
ac-stef 423df0c66f omit "./" prefix from media file paths in map config files
Ignore it, if "./" prefixes a media path given with a texture, mapmodel
or mapsound command. It's useless and prevents comparing path names.
2016-09-06 19:15:26 +02:00
ac-stef cb630bde49 add per-map overrides to disable graphics features
The mapper has now the choice to disable several graphics features on
the client (for his map only, of course). The overrides are stored in
the map header.

mapoverride_nowaterreflect

  If "1", water reflection is disabled. Useful, when odd water colours
  are used to emulate other liquids that are not supposed to be that
  reflective.

mapoverride_limitwaveheight

  If "1", waveheight is capped at 0.1 max. Useful for small water
  areas (like puddles), where higher waves would look weird.

mapoverride_nostencilshadows

  If "1", stencil shadows are disabled. On clients, where stencil shadows
  are otherwise enabled, blob shadows are used instead. If shadows are
  disabled anyway, they stay disabled. Useful for dim maps, where hard
  shadows make no sense.


The player is free to ignore any of those overrides:

ignoreoverride_nowaterreflect

  If "1", mapoverride_nowaterreflect is ignored and regular client
  settings are used.

ignoreoverride_limitwaveheight

  If "1", mapoverride_limitwaveheight is ignored, and "waveheight" is
  used unchanged.

ignoreoverride_nostencilshadows

  If "1", mapoverride_nostencilshadows is ignored.


DOCREF mapoverride_nowaterreflect ignoreoverride_nowaterreflect
DOCREF mapoverride_limitwaveheight ignoreoverride_limitwaveheight
DOCREF mapoverride_nostencilshadows ignoreoverride_nostencilshadows
2016-09-04 17:44:22 +02:00
ac-stef 300d702619 add menu to set notexture
Allows to reset notexture, to set a high-contrast color to find and
fix the areas and to set to a useful default texture.

As useful textures, in addition to rock.jpg and concrete.jpg, the menu
lists the default wall, floor and ceiling textures of the current map,
and also the last watched texture from the texture menu.

Also adds a few checks to detect unconverted map config files and misuse
of the new bright highlight textures.
2016-08-30 22:57:03 +02:00
ac-stef 1310516c14 keep track of map load errors
Collect warnings during load_world() and issue a warning at the end. Most,
but not all warnings already printed a message - which usually scrolls out
of the console quite fast.

The collected value is also given back by the loadmap command, which
allows batch editing scripts for maps stop at problematic maps.

Mapsound errors are not detected, if soundvol is zero. Missing textures are
not flagged, if notexture is set.

The error code is ored together from those elements:

0x0000001  entity attribute overflow
  One or more map entities had attribute values, that are no longer
  supported with map format 10. Rework manually.

0x0000010  map decoder error
  Indicates a damaged map file.

0x0000100  world error -1
  Map is completely solid. Very funny.

0x0000200  world error -2
  Map border is not solid. Fix manually.

0x0001000  missing skymap texture files
0x0002000  missing world texture files (only if no notexture is set)
0x0004000  missing mapmodel files
0x0008000  missing mapsound files

0x0010000  bad mapsound command in map config
0x0020000  bad mapmodel command in map config
0x0040000  bad texture command in map config
0x0080000  bad loadnotexture command in map config

0x0100000  error during loading of mapmodels (see earlier console output)

0x1000000  out of range integer value in map config (for example, "fog 0")
0x2000000  out of range float value in map config
0x4000000  generic cubescript error in map config

The command loadmap is now also available for non-debug builds.

DOCREF loadmap
2016-08-30 20:56:58 +02:00
ac-stef 867d522879 fix crash on used but unassigned slots during config slot sorting
maybe we should have a warning for such entities...
2016-08-29 13:44:58 +02:00
ac-stef 48e2ce3863 new command sortmapsoundslots
...and some options for sortmapmodelslots and sorttextureslots

All three commands now accept three modifier keywords as arguments:
  nosort     do not sort the list alphabetically
  nomerge    do not merge any slots
  mergeused  merge used and unused (identical) slots freely
By default, the list is sorted and only unused identical slots are merged.
The keywords can be combined in any order. "nomerge" takes priority over
"mergeused".

Examples:

  sortmapmodelslots
    Sort the mapmodel slot list alphabetically and merge unused identical
    slots. Merging an unused slot is pretty much the same as deleting it,
    so this command sorts the list and removes unneeded double entries.

  sortmapmodelslots nosort
    Merges (deletes) unused double entries in the mapmodel slot list.

  sorttextureslots nosort mergeused
    Merges double entries in the texture slot list. If two identical
    entries are used in the map, all uses are mapped to the new combined
    slot. This leaves no visual changes on the map. Should be avoided, if
    texture slots have been renamed manually - and the the renaming isn't
    finished yet.

  sortmapsoundslots mergeused
    Sorts the mapsound slot list and merges all double entries.

DOCREF sortmapmodelslots sorttextureslots sortmapsoundslots
2016-08-25 11:48:45 +02:00
ac-stef 612a6291f1 new command sortmapmodelslots
* sorts all mapmodel slots alphabetically
* combines (merges) slots with the same model and parameters

DOCREF sortmapmodelslots
2016-08-22 15:08:20 +02:00
ac-stef 611303b890 fix crash on failed write in writemapmodelattributes 2016-07-27 12:24:58 +02:00
ac-stef 6c97202aa3 retry mapmodel downloads
Mapmodels which were not found once are put on a list and not tried to
be loaded again. With this commit, the list is cleared during a map load
if autodownload is enabled. This causes all missing models to be
downloaded.

Fixes issues with manually aborted autodownloads.
2015-09-07 14:53:57 +02:00
ac-stef 7988443b1d partial autodownload rewrite
* own source file for autodownload
* use cleaned up zip functions
* use new http get function (no more curl)
* enforce strict file naming rules and file size limits
* ping all package servers on every game start to determine ping times
* support media file update lists (also kept on package servers)
* allow users to manually prioritise package servers
* automatically select server with newest media file revision

new or changed commands:

addpckserver hostname [priority]
  Adds a host name to the list of package servers. If a priority is given,
  it influences the sorting of servers. Servers with higher priority are
  queried first. If servers have the same priority, they are sorted by
  ping. Default priority is zero.

getpackageserver
  Returns a table with four columns of all configured package servers. The
  columns are: host name, priority, ping and resolved.
  "resolved" is a flag, indicating, if the server answered the ping during
  game start.

removed cubescript idents: sortpckservers gamestarts
DOCREF addpckserver getpckserver
2015-09-07 14:53:56 +02:00
ac-stef 06f59e0559 use safe strings
(cleanup)
2015-08-21 15:51:36 +02:00
Frank LENORMANDandac-stef 3ec0b1218d abide by the rules for reference objects 2015-07-18 00:51:00 +02:00
ac-stef 3d1f7d9b95 fix mapmodel occlusion when using pitch and roll
may need a bit more work, though
2015-06-05 16:00:03 +02:00
ac-stef 7a7a8da310 experimental: add per-slot mapmodel scale factors
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
2015-06-05 16:00:02 +02:00
ac-stef 00fab48b94 change names of map model attribute commands
The command mapmodelattributes is now more appropriately named
"getmapmodelattributes", and the former "getmapmodelattributes" is now
named "listallmapmodelattributes".

DOCREF listallmapmodelattributes getmapmodelattributes
2015-06-05 16:00:02 +02:00
ac-stef 95680b699c add undelete for entities
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
2015-05-27 15:47:05 +02:00
ac-stef 4117ff73d7 output warning for problematic map model config parameters 2015-05-27 15:47:05 +02:00
ac-stef c6ac0f55f8 fix tracking of unsaved edits for automapcfg
don't flag changes read from config files
2015-05-18 14:59:41 +02:00
ac-stef ae82b6b22e add attr5..7, add mapmodel pitch and roll
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.
2015-05-18 14:59:41 +02:00
ac-stef 8745d002f0 new commands to edit map config items
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
2015-05-18 14:46:03 +02:00
ac-stef 786a6cdce1 filename filtering for media files
No more spaces in filenames. The only allowed chars are a-z, A-Z, 0-9 and
"-_.()".

An exception are texture filenames, which may also have a prefix command
like "<decal>" included.

Also fixed some memory leaks in media download.
2015-05-18 14:46:03 +02:00
ac-stef e318ecd68e integrated automatic embedded map config files
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
2015-05-18 14:46:03 +02:00
ac-stef 03f974b2bc additional text attributes for mapmodels
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
2015-05-17 00:24:38 +02:00
ac-stef 57a0d286c1 automatic mapmodel menus
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
2015-04-12 18:09:36 +02:00
ac-stef 2a6b8fb234 track missing models without "nomodel"-crutch
* missing models now have their own list "mdlnotfound".
* also added a few comments (looks silly, though)
2014-11-26 21:23:59 +01:00
aurhat 6e0e7bb333 Optimize and fix autodownload feature
The commit:
1. fixes value of download speed in KB;
2. introduces unique names of progress_callback() functions;
3. removes one unnecessary write_callback() function;
4. removes duplicated code/info in loadmodel().
2014-11-26 21:05:07 +01:00
ac-stef eb60302e67 cleanup
- 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
2014-05-14 22:54:37 +02:00