Commit Graph
91 Commits
Author SHA1 Message Date
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 e1ce0979d0 rewrite calculation of map geometry bounding box
and rename client-side struct "mapdims" to clmapdims (to avoid confusion
with server-side data)
2016-08-26 14:08:55 +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 a8c06d1510 new command sorttextureslots
* sorts all (but the first five) slots alphabetically
* combines slots with the same texture and scale factor

DOCREF sorttextureslots
2016-08-22 15:08:20 +02:00
ac-stef d5bd896189 properly adjust texlists when deleting texture slots
check texlists during save (and print warning, if errors were corrected)

also add (undocumented) command to patch messed up texlists
2016-08-20 14:45:41 +02:00
aurhat c1e9daee1e Cleanup 2016-07-17 13:27:10 +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 816aed4ba6 rewire zip packages inside the virtual filesystem
* change priority of zip packages from "highest" to "just below home dir"
* strict naming rules for zip packages
* require all zips to be below directory "mods/"
* only allow zips to intoduce files below "packages/" (or with a special
  zip package name also below "config/")
* make zip package config persistent (saved to init.cfg)

WARNING: intermediate commit - autodownload system defunct!

DOCREF (removed) addzip removezip
2015-09-07 14:53:56 +02:00
ac-stef 8f6b5d5802 fix skymap autodownload error handling
- suppress error messages during map config execution, just like all
  missing media errors are suppressed during the first attempt

- don't queue manual attempts to load nonexisting skymaps for download
  (this is now consistent with other manual media use)
2015-08-28 11:55:09 +02:00
ac-stef b54d9876a8 ask for replacement texture when deleting used texture slot
deletetextureslot <texture slot number> <"purge"> <replacement slot>
  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 or a specified
  replacement slot. Slots below #5 always require "purge", no matter if
  they are in use (default slots). Also enables automapconfig.

DOCREF deletetextureslot
2015-06-05 16:00:02 +02:00
ac-stef b5187531a3 fix memory leak in gettexturelist 2015-06-05 16:00:02 +02:00
ac-stef 1b2e944754 add script commands to support texture and sound config menus
textureslotusagelist <what>
  Return a list of 256 numbers representing the number of uses for every
  texture slot. If <what> is "onlygeometry", uses as map model skin do
  not count. If <what> is "onlymodels", the uses in map geometry do not
  count.

gettextureorigin <path>
  Returns the location where the texture actually can be found. The
  possibilities are:
    "official": texture was found in the working directory, which
                indicates an official texture.
    "custom":   texture was found in the profile directory, which means,
                the texture is either manually installed or downloaded.
    "package dir #x": texture was found in a mod directory.
    "<file not found>": that.

textureslotbyname <texture path>
  Returns the list of numbers of all texture slots which use that texture
  file.

edittexturestack <floor|wall|ceiling> <texture slot number>
  Puts a texture slot in a "last used" list up front. The first
  parameter picks the list, the second parameter is the texture
  slot number to be used for the next edit

getautomapconfig
  Returns "1" if automapconfig is already enabled, "0" otherwise.

getmapsoundorigin <path>
  Returns the location where the map sound file actually can be found. The
  possibilities are:
    "official": the sound file was found in the working directory, which
                indicates an official mapsound.
    "custom":   the file was found in the profile directory, which means,
                the mapsound is either manually installed or downloaded.
    "package dir #x": mapsound was found in a mod directory.
    "<file not found>": that.

mapsoundslotbyname <mapsound path>
  Returns the list of numbers of all mapsound slots which use that texture
  file.

getmapsoundlist
  Returns a list of all *.wav and *.ogg files below packages/audio/ambient.

DOCREF textureslotusagelist gettextureorigin textureslotbyname
DOCREF edittexturestack getautomapconfig
DOCREF getmapsoundorigin mapsoundslotbyname getmapsoundlist
2015-06-05 16:00:02 +02:00
ac-stef d74296a6df experimental: allow factors up to 4 for hires textures
The performance drop is quite small and can completely be disabled by
"hirestextures 0", if needed.

May be revoked, if mappers have no use for it. Just assume this feature to
stay, if textures emerge, which benefit from factor 4 over factor 2.

DOCREF texture
2015-06-05 16:00:01 +02:00
ac-stef 3bdd199ad2 include and translate texture slots during copy&paste
When blocks of map geometry are copy-pasted between maps (or xmaps), this
commit translates the texture slot numbers between different texture
config sets. Missing textures are assigned a slot in the target map.

When texture slots are added, automapconfig gets enabled.

If the paste gets removed by the undo function, the newly assigned texture
slots will NOT be removed. This is by design.
2015-06-05 16:00:01 +02:00
ac-stef 779df670fe fix scaled world textures (a.k.a hires textures)
Until now, every texture file was only loaded once after game start. When
a subsequent use of an already in use texture required a different
scaling factor, the texture was not reloaded. Simultaneous use of one
texture file with different scaling factors was completely impossible.

Now, the scaling factor is treated as part of the file name. Therefore, a
texture will be loaded again, if it is needed in a different scaling
factor.

Also: using out of range scaling factors with the "texture" command now
results in an error message. Some map config authors don't use the command
properly...

Also: removed the unneeded createtexturefromsurface()
2015-06-05 16:00:01 +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 c4e1155dcc option to write floats as ints when possible
omit the ".0" in values like "3.0"
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 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 77399cf23f texture scale fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7539 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-08-28 13:40:44 +00:00
Lucas GAUTHERON 1fd084441a textureguides fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7502 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-06-27 22:15:04 +00:00
Bukz a03986df70 menu prep for translations/guidetoggle cleanup
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7436 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-27 22:52:33 +00:00
Bukz 810d14d258 temporary double jump fix/typo fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7393 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-23 12:54:58 +00:00
Lucas GAUTHERON ebcbbbc933 autodownload update
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7389 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-23 08:05:58 +00: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 14fc9c9bc3 guidetoggle updates
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7370 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-19 16:04:29 +00:00
Bukz bbdce85866 guidetoggle command
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7369 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-19 15:33:24 +00:00
RandumKiwi 5846656953 remove that annoying extra conoutf from botgames
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7331 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-09 22:53:26 +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
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 a89b9f2dab pave the way for hi-res textures
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6416 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-05-10 20:03:06 +00:00
Lee Salzman c392b3d010 clean up messy anisotropy patch
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6017 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-01-17 19:27:32 +00:00
flowtron e349ee1303 binaries (linux64)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6016 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-01-17 18:59:22 +00:00
flowtron 2eb65ad9d6 anisotropy not ansiotropy typo fix in check_anisotropy
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6015 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-01-17 18:46:14 +00:00
flowtron a3960cb70b anisotropy support (for high-end machines) provided by RPG
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6014 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-01-17 18:44:30 +00:00
flowtron 65447c694c avoid message spam for unloaded preview images
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5362 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-13 18:46:26 +00:00
Rafael Barreto 3b4b2ba506 forget to remove this printf
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5345 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-11 20:49:17 +00:00
Rafael Barreto 862393f324 ty for the warning, WahnFred... the code was embarrassing wrong
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5344 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-11 20:33:11 +00:00
Rafael Barreto 361fd1e264 removing command
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5335 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-10 23:14:02 +00:00
flowtron 94dc526837 lots of whitespace
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5265 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 16:49:20 +00:00
Rafael Barreto 49faabc0ba removed more than should
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5263 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 00:16:32 +00:00
Rafael Barreto 3a2c5fac3d removing the conoutf/debug
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5262 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-02 00:13:47 +00:00
Rafael Barreto b61f2b69dc bright filter in blocking level (pre-testing)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5261 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-01 22:27:07 +00:00
flowtron 41c11a06f2 whitespace fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5236 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-25 21:30:11 +00:00
flowtron b940559da2 texreduce: new value -1 for 2x2 textures
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5234 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-25 20:34:02 +00:00
Rafael Barreto b18c292773 options
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5214 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-22 19:29:09 +00:00
Rafael Barreto 9ab57071ff brightskin filter
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5212 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-06-22 17:36:34 +00:00