Commit Graph
19 Commits
Author SHA1 Message Date
ac-stef 2f99b368f0 allow mnemonics for execution context levels
scriptcontext and isolatecontext now allow plain text mnemonics for
context level arguments (one of CORE, CFG, PROMPT, MAPCFG, MDLCFG)

also:

- cleanup (some dead code and dead prototypes removed)
- some stuff renamed
- script errors now show context levels
- conc is no longer thread-safe (but slightly faster)

DOCREF scriptcontext isolatecontext
2017-05-18 16:19:01 +02:00
ac-stef b650fca2ca persistidents cleanup
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
2017-05-05 15:50:59 +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
Bukz 1bfb17dab3 cleanup/updates
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7224 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-17 05:50:04 +00:00
Bukz 7480f036d3 persistidents fixes (plz review/test)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7213 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-16 01:43:47 +00:00
Alejandro V. Garcia a0640ddeed transparency test (old stuff from 2008)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7192 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-13 13:26:12 +00:00
Alejandro V. Garcia 3317df681a Revert experimental model rotations
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7033 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-01-06 00:18:12 +00:00
Alejandro V. Garcia d78ac41e3a mdlroll mdlyaw mdlpitch commands
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7028 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-01-04 09:04:16 +00:00
sireus 7509904255 lil' oops
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6632 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-09-01 22:43:20 +00:00
Lucas GAUTHERON eb426f8cd3 secured exec context for mdl's cfgs (and pre package auto-downloader work ?)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6631 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-09-01 21:49:57 +00:00
Bukz 798c79a3c6 config updates
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6187 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-04-01 02:24:37 +00:00
flowtron 7cd5f12854 disable "alias" in map-cfg, script-execution-check removed from compilation
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5707 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-10-04 20:38:36 +00:00
Lee Salzman f997d0a6bb mapsoundreset command
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2919 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-10-11 06:22:01 +00:00
Lee Salzman b43bcecc92 allow shadowyaw in map cfgs
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2611 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-09-15 03:44:29 +00:00
flowtron 183af60a49 allow 'loadnotexture [P]' inside map-cfg
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2275 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-08-03 20:45:29 +00:00
RandumKiwi 57031d6f97 cleanup/typo.
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1917 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-05-10 19:57:17 +00:00
driAn 87c7755754 demo stuff, script contexts
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1909 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-05-10 10:17:31 +00:00
driAn 921e2ef792 allow watercolour in map cfg
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1884 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-05-05 18:37:13 +00:00
driAn 7fa0a75765 sendmap with map config files, script contexts (~sandbox)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1471 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2007-12-22 23:39:30 +00:00