Commit Graph
4002 Commits
Author SHA1 Message Date
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 e3fc073742 add "gotoentity" command
jump to the location of a map entity

DOCREF gotoentity
2015-05-18 14:46:02 +02:00
ac-stef 3b8f642a38 add description entries for scripted menu items
This looks ugly, if the descriptions are long. There should be some kind
of linewrap for descriptions.

DOCREF menuitem
2015-05-17 00:24:39 +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 bdf3f0f5cb option to crop leading and trailing whitespace for filtertext 2015-05-17 00:24:38 +02:00
ac-stef f86e2c1f4a fix loadcrosshair script in saved.cfg
"c" is already used as "const" and therefore is not allowed as temporary
alias...
2015-05-17 00:24:38 +02:00
ac-stef d55dbb47f4 output error message when temporary alias can not be created 2015-05-17 00:24:38 +02:00
ac-stef 890e13076c print error message if md3skin tries to skin non-existing meshes
the error message includes a list of available mesh names
2015-05-17 00:24:38 +02:00
ac-stef 3e84f11630 cleanup 2015-05-17 00:24:38 +02:00
ac-stef ad263ea375 avoid triggering ASSERT due to insufficient floating point precision
For bigger lastmillis and zero basetime in combination with odd values for
as.speed, t can become negative due to rounding errors.

(time: 3404565, as.speed: 43,47826 -> t: -0,00575)
2015-05-17 00:21:28 +02:00
aurhat 65c2e0f83a Update locally position of dropped flag
After dropping the flag player1 will see for a very short moment,
before flag position will be updated by server, flag dropped at player1
position. Earlier he could see for this moment flag dropped in a place,
when it was picked up.
2015-05-13 20:43:56 +02:00
aurhat a9bf87b1e7 Indexing fix 2015-05-07 21:27:53 +02:00
aurhat b2da592d6e Save skin choice on quit 2015-05-07 18:58:34 +02:00
aurhat a1107a4318 Fix sound bug and remove wrong asserts for sound
The bug caused SIGTRAP during fastforwading demo in debug mode, when other
players disconnected.
These asserts were removed, because they can be triggered because of a bug.
2015-05-05 21:55:13 +02:00
aurhatandac-stef 8b2b7e0ac7 Change switching between spectate and edit mode
1. In multiplayer this switching isn't allowed, because it was broken
   and messed up, for example other players didn't see concurrently
   spectating and editing player.
2. In demo mode switching from spectate to edit mode is improved.
3. Several years broken code for edit mode is reverted.
2015-05-03 22:42:06 +02:00
aurhat 419c8717ba Hide team icon when player is in TEAM_SPECT and doesn't follow
Till now when player was in TEAM_SPECT and didn't follow (SM_FLY),
then wrongly CLA icon was displayed near the radar.
2015-05-03 22:12:02 +02:00
aurhat 1d497ac4d8 Add dedicated crosshair in edit mode
DOCREF loadcrosshair
2015-04-28 20:47:54 +02:00
aurhat 8916ad4fa4 Fix playing weapon sounds
No more sounds audible on the whole map in bot modes, when bots change
weapon or have no ammo.
Gun change sound in bot code was a duplicate, so removed.
2015-04-25 20:11:26 +02:00
aurhat 0969310be2 Fix local akimbo expiration 2015-04-25 19:12:40 +02:00
ac-stef 6431260cf2 fix issue #98
Not every filename contains a '.'
2015-04-23 21:44:03 +02:00
ac-stef a951cad8ab fix mingw compile
uint64_t requires stdint.h for mingw

thx Mr.Floppy
2015-04-21 01:58:53 +02:00
ac-stef 1d1e995454 fix some warnings 2015-04-18 15:24:31 +02:00
ac-stef 1f6cd99408 fix CR-handling for looplist 2015-04-18 14:07:45 +02:00
aurhat 6e7246d6cd Disable debug messages in bot modes
Uncomment added line to enable these messages.
2015-04-17 21:08:25 +02:00
aurhat 4e0e128b16 Fix and improve displaying map message in menu 2015-04-17 17:11:34 +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 f511889731 customisable sort order for file lists in menus 2015-04-12 18:09:36 +02:00
aurhat beeba9ad76 Add Code::Blocks project for Linux 2015-04-06 12:24:50 +02:00
ac-stef 453c79ee6d minor fixes to get master to compile again 2015-04-06 10:37:13 +02:00
aurhat c3ae2066d0 Don't check a duplicate of player1 name in demo mode 2015-04-05 21:58:29 +02:00
ac-stef fe97817dac use proper delete macro 2015-04-03 21:10:17 +02:00
aurhat 5de86f9838 Cleanup
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
2015-03-29 14:57:29 +02:00
ac-stef 631685afb6 new commands curmenu and closecurmenu
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
2015-03-29 13:21:47 +02:00
ac-stef 36b0f3edc0 hide speed when menu is shown 2015-03-28 16:48:05 +01:00
ac-stef 793aca3cf1 fix memory leak 2015-03-28 14:05:04 +01:00
ac-stef 1e188aadbd fix loadcrosshair 2015-03-26 15:07:50 +01:00
RandumKiwi 138eacd621 Updated comments only
Moved the comment on the CXX flag to a seperate line, so that compiling logs don't show extra whitespace. Additionally, I've added a comment about why we use clang++ (instead of g++) to help future 3rd parties.
2015-03-26 11:22:07 +13:00
ac-stef b7a551361f fix falling through mapmodels and clips when pushed 2015-03-25 21:42:29 +01:00
ac-stef 85f7a22e64 flush logfile in case of crash 2015-03-25 02:56:49 +01:00
ac-stef 982bc037a7 moved "scripts" folder to "config/autostart"
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
2015-03-24 02:06:19 +01:00
ac-stef 5bf27f802c fix memory leak in execdir 2015-03-24 02:06:19 +01:00
ac-stef b4b1c0bf91 add debug warning for unknown argument keywords
"weapon asault" will now print a warning to console.
2015-03-24 02:06:19 +01:00
ac-stef 7b607a6c43 allow comments inside cubescript lists
like this:
  alias listwiththreeelements [
    first   // first element
    second  // second element
    third   // third element
  ]

"echo $listwiththreeelements" will print everything, including comments,
but "echo (listlen $listwiththreeelements)" will print "3", and
"echo (at $listwiththreeelements 1)" will print "second".
2015-03-24 02:06:18 +01:00
aurhat 82f0f4e128 Remove leftover blend parameter from drawequipicons function 2015-03-22 21:55:05 +01:00
aurhat 13ed2bd977 Fix akimbo expiring
Before, if player switched to akimbo just as it expired, he ended up with
akimbo and 0 ammo. Now his weapon will change to default weapon (the most
often primary), as if he would take akimbo in the hands.
2015-03-16 21:16:42 +01:00
aurhat 63bbd353fc Align equipment icons and stats on HUD
Among other things it fixes https://github.com/assaultcube/AC/issues/65 .
It betters also display for oldfashionedgunstats=1.
2015-03-07 12:17:44 +01:00
ac-stef 5619fb2e7e allow multiple arguments for "pop"
instead of "pop var_a ; pop var_b" you can write "pop var_a var_b"

Also, "pop" will now give back the removed value of the first alias from
the argument list. This allows using the pop'd value one last time.

DOCREF pop
2015-03-06 19:36:29 +01:00
ac-stef 1c402a7d93 omit empty aliases from command completion
Some operations, like pop or looplist, leave empty aliases behind. Mostly,
this is without consequence - but before this commit, they showed up
during command completion.
2015-03-06 14:37:42 +01:00
ac-stef 045343a26d fix crosshairnames
damn akimbo special treatment...
2015-03-06 14:31:51 +01:00