Commit Graph
135 Commits
Author SHA1 Message Date
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
Lucas GAUTHERON a7a1e46bcc merged branch
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-22 19:49:21 +00:00
Bukz 6bca9438a8 modmdlbounceN - load custom gib/static grenade models via cubescript
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7216 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-16 05:54:05 +00:00
Bukz 01f4d0e147 modmdlpickup fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7210 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-15 19:01:05 +00:00
Alejandro V. Garcia 7a086a8e19 another revert
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7209 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-15 09:10:13 +00:00
Alejandro V. Garcia 2ec23a6e29 revert
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7208 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-15 08:43:48 +00:00
Bukz 5be04a9c06 modmdlpickupN - load custom pickup models via cubescript (plz review/test)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7201 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-14 12:54:12 +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 d9bde7f0d9 Revert experimental model rotations
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7034 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-01-06 00:18:27 +00:00
Alejandro V. Garcia c5e656fc9e Model rotations, experimental
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7029 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-01-04 09:41:15 +00:00
Lucas GAUTHERON 8c084668cb disabling some debugging commands
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7020 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-12-31 12:19:31 +00:00
Ronald Reagan c873eaccd3 cpistol warnings removed. Needs to be reverted when cpistol gets added in
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6988 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-12-19 01:02:41 +00:00
sireus cc8121066a cache missing models
(otherwise, it would try to load them over and over again)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6914 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-10-10 18:31:44 +00:00
sireus b33116712c sane(r) command signatures (warning: huge commit)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6908 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-10-06 22:49:49 +00:00
sireus b6b69e3f90 spechudgun -> specthudgun for more coherent var naming
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6786 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-04-16 09:32:42 +00:00
sireus 8f39911eb0 cleaned up spectator mess a bit
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6781 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-04-05 13:19:06 +00:00
flowtron b2ec034187 modmdl[vwep|weap][N] aliases for switching model of guns (even on-the-fly)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6691 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-11-06 13:29:44 +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
aerkefiende 06f73f4627 Replaced Tabs with 4 spaces in every source file
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6561 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-07-31 15:44:57 +00:00
sireus 401f018b76 use ANIM_REVERSE for playermodels going backward
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6273 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-04-17 16:53:48 +00:00
flowtron a23d6a8564 popdeadplayers
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6058 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-02-05 09:44:49 +00:00
Alejandro V. Garcia 2df7e45940 Unused debug code removed
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5253 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-30 01:06:46 +00:00
Alejandro V. Garcia 201ba99c79 dbghbox, was this originally intended for demo playback only?
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5227 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-25 06:30:55 +00:00
Rafael Barreto 51912a872f testing: making the shots pass over the shoulder (lets see if affect the gameplay... if so, we undo it)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4999 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-22 23:23:04 +00:00
Rafael Barreto 5468c26b6d crouching in the air
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4946 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-05-20 18:36:00 +00:00
Lee Salzman 0a352e793b removing old vector typedefs
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4788 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-03-11 23:19:42 +00:00
Lee Salzman be94c703f2 setsize -> shrink
setsizenodelete -> setsize
deletecontentsa -> deletearrays
deletecontentsp -> deletecontents
vrealloc -> growbuf



git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4787 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-03-11 23:06:26 +00:00
Lee Salzman e725e5ed8c string function cleanups
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4714 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 22:44:32 +00:00
Lee Salzman 54cc44c3db revising pch setup
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4690 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 06:42:37 +00:00
ac_stef f1e879e7fd akimbo bug fixed; some new bugs added
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4598 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-08-05 21:21:57 +00:00
flowtron 9fbe34852b fixed mirror-bug - var now called "righthanded"
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4590 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-07-27 20:20:37 +00:00
flowtron a033b15535 allow players to be left-handed in trunk too
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4589 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-07-27 19:55:53 +00:00
ac_stef 24708c9741 numeric team names; choose separate skins for both teams for your player
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4554 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-06-29 14:05:17 +00:00
ac_stef 44172c8c88 fix custom player skins
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4453 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-05-29 18:17:08 +00:00
ac_stef 42de5ba8ab option to enable custom player skins in non-team modes only
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4155 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-02-09 14:31:39 +00:00
Lee Salzman 01b999d10a VC warning fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3465 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-11-08 23:20:34 +00:00