Commit Graph
100 Commits
Author SHA1 Message Date
ac-stef 58ca08ec86 fix conc
thx BrutalSystem
2017-05-19 23:15:18 +02:00
ac-stef aa2e3876f9 fix menu footer size calculation
also: limit width of item descriptions to screen width & wrap around
2017-05-18 19:29:31 +02:00
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 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 6f03d1819b add menu for cubescript hooks
- add new hook "autoexec", executed right after autoexec.cfg
- properly report errors during hook execution
- new script to edit the contents of an alias in the console

DOCREF autoexec
2017-05-16 13:11:32 +02:00
ac-stef e256971725 allow empty strings as result of inputcommand 2017-05-16 13:08:21 +02:00
ac-stef 67a6b78353 add team frag counters for non-flag modes
hideteamscorehud 0|1

  same as hidectfhud before, but also for non-flag team modes

DOCREF hideteamscorehud hidectfhud
2017-05-14 20:57:58 +02:00
ac-stef 458b911ecd fix initialisation of entropy pool
have to know home dir before loading entropy.dat

add dummy screenshots on keypress events during first run to get entropy
2017-05-13 20:02:18 +02:00
ac-stef cf55e54faa fix damage indicator overflow after fastforward
break up shiftgametime() time jumps into 5-second jumps and five 1-second
jumps for the last five seconds

rename respawnoffset to lastdeath (because that's what it is)
rename clientside nextmillis to skipmillis (because that's what it does)
2017-05-13 03:46:00 +02:00
ac-stef e093b9f215 remove exception for color codes in conc 2017-05-12 19:53:55 +02:00
ac-stef 12925eaebc attribute damage blend effects to spectated player
...and clear it in case a different player is followed

also: cleanup
2017-05-12 19:07:38 +02:00
ac-stef 33af150e23 fix menu texture preview updates
it was kind of naive to hope, that newstrings would not reuse the exact
same freed memory that was used for the last string at least sometimes...
2017-05-12 13:49:23 +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 b33ad603d4 cleanup
c removed

DOCREF c
2017-05-12 01:33:55 +02:00
ac-stef 59389a14f9 use menuselectionbgcolor for all menu item types 2017-05-11 22:48:27 +02:00
ac-stef 4a7109b352 cleanup
that algorithm never worked
2017-05-11 22:26:49 +02:00
ac-stef 824d460262 write more data to clientlog in case of crash
write the stackdump and the cubescript history (if available)
at least try to close the clientlog file
2017-05-11 17:47:21 +02:00
ac-stef 3e1578c35f fix crash with menuselectiondescbgcolor 2017-05-07 20:30:55 +02:00
ac-stef deafcaab00 add batch map conversion stage to find stray entities
find entities in the middle of 8x8 solid cubes

removed a few ents from depot and venison
2017-05-06 19:37:36 +02:00
ac-stef 5eec79d792 add batch map conversion stage to find some unnecessary heightfields
In old versions of AC it was necessary to trick with heightfields to raise
a pickup entity. However, for quite some time now, pickups can be raised
by attribute.

This additional stage for convmap finds pickup entities where the
heightfield is most probably unnecessary. Fixing is manual work, though.

Updated those pickups on 16 maps.

Also fixed a playerstart on desert3
2017-05-06 00:52:31 +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 fc82b82b85 cleanup 2017-05-04 16:28:04 +02:00
ac-stef 5e638565f8 cleanup
- un-inline stuff that really doesn't need to be
- unify weapon id checks
- shrink guns
2017-05-02 21:38:58 +02:00
ac-stef 777638f3a9 ignore z differences when drawing radar 2017-05-02 00:39:30 +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 64c146e52d texture fixes on dev_arabian
thx BrutalSystem
2017-04-30 22:57:07 +02:00
ac-stef 8d21f39ad9 more mouse code cleanup
- remove sensitivity training (should be rewritten in cubescript, if
  actually required)
- more documentation on mouse sensitivity parameters
- some renaming

DOCREF findsens
2017-04-30 21:15:05 +02:00
ac-stef f9223149ec mousemove code cleanup
- remove esoteric option to choose between a*b/c and a/c*b
- some comments added

DOCREF scopesensfeel
2017-04-30 20:36:35 +02:00
ac-stef 1b596e059a roll update
- split into strafe roll (maxroll) and damage roll (maxrolleffect)
- locally recompute remote players roll (can be removed from pos pkt)
- fix maxrollremote

DOCREF maxroll maxrolleffect maxrollremote
2017-04-29 18:23:23 +02:00
ac-stef deb73081e8 fix missing musicpreload range check 2017-04-28 16:55:55 +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
ac-stef 8e08cddaa7 improve cutcolorstring
now takes the width of characters into account

also: fix wraparound for docrefs
2017-04-24 21:48:57 +02:00
ac-stef 9739464381 unify menu slider width calculation
* fixes bug with text input fields with less than 15 chars allowed
* recalculates slider width for resolution and font changes (on menu open)
* new tab-like function for '\n' in menuitems: sync with slider width
  (see example in menus_edit.cfg in this commit)

DOCREF menuitem
2017-04-24 19:51:40 +02:00
ac-stef 227e6651f5 add option to sync tabs in menus
menusynctabstops 0|1
    if enabled(1), tab positions in a menu are synchronised
    default is off(0)
    affects menu title, header and items but not footer or descriptions

DOCREF menusynctabstops
2017-04-24 19:51:40 +02:00
ac-stef 066c820231 add menu output for reference searches
changed command:

  docfind <pattern> <silent>

    Searches for pattern in all reference entries. If <silent> is zero or
    omitted, all found references are listed.

    A table of all found entries is returned as result. For each entry,
    the index of the doc entry string that contains the pattern is listed.

new command:

  getdoc <ref> <idx>

    Returns a string of the doc entry specified by <ref>. String index
    numbers match with the result of docfind.

      0   name
      1   description
      2-  remarks

DOCREF docfind getdoc
2017-04-24 19:51:40 +02:00
ac-stef 78380dc45d fix docref
* now restricted to command references
* some parameter checks added

  docref <reference command>
    adds a reference to another command to the current commands
    description

  docrefvisible 0|1
    if set to 0, docrefs are not rendered (default 1)

DOCREF docref docrefvisible
2017-04-24 19:51:40 +02:00
ac-stef 8fdbee225e texture fixes
thx BrutalSystem
2017-04-24 00:14:44 +02:00
ac-stef d73b0313cb fix text input field rendering of hidden text
also: show hidden content of input field as long as CTRL is pressed
2017-04-22 15:10:02 +02:00
ac-stef 6af6f650d1 fix double free in opengzfile
Now gzstream->open consistently does not keep a copy of the input stream
in case of failure - no matter the type of failure.
2017-04-22 12:41:51 +02:00
ac-stef c2d64d3a2b fix menu layout
- fix calculation of footer lines, menu pages and menu widths
- make sure, FONTH is never zero
- unify menu action execution
- clean up some code
2017-04-19 15:39:45 +02:00
ac-stef 206cbdcbd1 better AR approximation
and some fixes
2016-12-03 14:54:18 +01:00
ac-stef 06de0ddf3c re-add default resolutions
The screen resolution menu now shows two batches of resolutions: first
those recommended by the graphics driver and then some more default
resolutions. Resolutions higher than the reported maximum are not listed.
2016-11-24 01:32:54 +01:00
ac-stef 570e6aba2f only show available screen resolutions
setdesktopres was replaced by two variables reflecting the desktop
resolution (or zero, if not available): desktopw and desktoph

getdisplayresolutions returns a list of available screen resolutions

DOCREF getdisplayresolutions desktopw desktoph setdesktopres
2016-11-24 00:32:07 +01:00
ac-stef 60a7fa9e17 don't pitch weapons and playermodels 2016-11-21 22:11:41 +01:00
ac-stef 8cd6d15247 hide hudgun while menu shows a mapmodel
...to avoid overlap
2016-11-20 15:20:16 +01:00
ac-stef 76fadbae52 use camera pitch when browsing mapmodels
-10°..10° is treated as zero
2016-11-17 15:30:11 +01:00
ac-stef c5065cddaa add batch map conversion tools and more editing scripts
convmap is a toolset to convert hundreds of maps mostly automatically
to map format 10. Old media paths from akimbo and from before AC 1.2 are
automatically converted to AC 1.2 and akimbo2 paths.

The additional editing scripts mostly help with further optimisation of
existing maps (mainly to reduce the number of clipped entities).

If convmap is loaded after mapeditscripts, one additional conversion
stage is unlocked.
2016-11-07 16:57:18 +01:00
ac-stef 551a501546 fix entity todo list 2016-11-07 15:31:05 +01:00
ac-stef ecb3386f88 fix some entities 2016-11-05 20:45:09 +01:00
ac-stef e12d25dc95 add todo list for entities
Add some commands to support an entity TODO list. Entity errors during
map load are automatically added to the list. The list is saved and
restored with xmaps. A keybind (no default key assigned) to scroll
through TODO entities was added.

The list is indented as a means for automated map check scripts to
return a list of entities to fix.

cleartodoentities [index]
  Clear list of TODO entities. The list is also deleted, when a new map
  is loaded.
  If an entity number is given as an argument, only entries for this
  entity are cleared.

addtodoentity index comment
  Add the entity #index to the TODO list. Add optional comment.

enumtodoentities
  Returns a list of TODO entities. Returns entity index number and comment
  for every entry.

DOCREF enumtodoentities addtodoentity cleartodoentities
2016-11-05 17:42:30 +01:00
ac-stef 88320bd095 add script and keybind to cycle through spawn points in edit mode
If the assigned key is pressed, the mousewheel can be used to cycle
through player spawn points, sorted by groups CLA, RVSF and FFA.

No default key is assigned.

gotonextplayerstart can be used, to manually jump to the next spawn.
2016-11-03 18:02:45 +01:00
ac-stef 5177988bac show faulty playerstarts as yellow players 2016-11-03 14:20:34 +01:00
ac-stef da49dda785 slightly less bright protox skins 2016-11-03 14:18:01 +01:00
ac-stef dc3abca170 less buggy filter function
likes highres skins
2016-11-03 01:19:11 +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 64a7eef335 some fixes 2016-11-01 00:40:07 +01:00
ac-stef 111c8d4d5c mapmodel cleanup 2016-10-17 17:40:02 +02: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 701d33af55 fix "no snprintf on VS" 2016-10-16 14:37:08 +02:00
ac-stef 1b5877e3fc treat CR as LF in cubescript
this hopefully doesn't break too much stuff...
2016-10-16 13:38:34 +02:00
ac-stef a451a0fd61 show model usage info where models are used 2016-10-14 11:58:13 +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 41ff4cf583 use shoe level instead of eyeheight
for edge jump detection
2016-10-13 15:29:47 +02:00
ac-stef 0e425d2103 allow synonym for mapmodel distribution "autodownload"
"akimbo" says the same
2016-10-12 19:45:40 +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 ade460517d reuse skin 2016-10-10 22:18:26 +02:00
ac-stef f7a54907db map fixes
thx BrutalSystem
2016-10-09 00:49:06 +02:00
ac-stef bc57ac2360 map fixes
thx BrutalSystem
2016-10-08 00:28:33 +02:00
ac-stef 245c0f4c56 map fixes 2016-10-04 22:05:17 +02:00
ac-stef 2436478c64 add new protocol data type for asymmetric small integers
best suited for values ranging from -1 to 252
2016-10-02 12:59:25 +02:00
ac-stef 07d9ae608d fix menuinitselection for dynamic menus
If a menu is not (yet) big enough for the selection to be set, wait until
the menu is opened and initialised - then try again.
2016-10-01 20:08:25 +02:00
ac-stef 13e6460ff3 set lastmenu during execution of menuinit script 2016-10-01 16:51:25 +02:00
ac-stef d56d8f91b6 fix restricting watercolour
get coal down from 213 to 91 clipped entities
2016-09-28 16:22:11 +02:00
ac-stef 5ba5d1b4b3 optionally show media origin in slot lists 2016-09-26 22:45:34 +02:00
ac-stef 18375a7c18 sort shadow entities behind lights
- restrict watercolour to edit mode
- some map fixes
- add dev_coal
2016-09-25 16:07:06 +02:00
ac-stef 9afca836c9 cleanup
bring clang (and g++) back to O3
cleanup jpegenc error handling
2016-09-19 18:16:19 +02:00
ac-stef efc04fe2dc fix rendering of very long ladder entities
and print more helpful error messages on entity attribute import overflows
2016-09-18 21:11:04 +02:00
ac-stef c66f846cf0 better selection handling for arch and slope placement
enlargearchslopeselections

  If the variable is set to 1, after placing an arch or a slope, the
  selection is enlarged, so that the arch or slope can be changed by
  vdelta increments (for example, to raise an arch in 1/4 cube increments).
  This is also the classic behaviour.
  If the variable is set to 0 (which is now default), the selection remains
  unchanged. This way, for example, the arch can be raised or lowered by
  regular cube increments.
  The arch menu allows changing the setting and also contains a script to
  enlarge the selections once.

pushselections

  New script to store the positions of all current selections. Can be used
  repeatedly. To restore the selections, type "popselections".

enlargevdeltaselections

  Enlarges all selections by one cube in x- and y- direction, to change a
  selection from the "cube area" to the "vdelta area".
  If an argument is given, it is used as increment value, so, for example
  "enlargevdeltaselections -1" undoes a previous enlargement.

DOCREF enlargearchslopeselections pushselections enlargevdeltaselections
2016-09-18 17:13:24 +02:00
ac-stef a291b74504 take measurements to create arch prefabs from existing maps
The arch menu now allows

 * editing all vertices instead of only half of them, for non-symmetrical
   arches
 * deleting saved custom arches
 * using custom arches for other widths than what they were created for
 * measuring an arch on a map and creating a prefab of it

Scripts:

av_measure

  "echo (av_measure)" prints the list of vdelta values of a selected arch.
  Only works as expected, if the selection is only 1 cube wide. To use the
  measurements to create a width 8 arch, select 8x1 cubes under the arch
  to copy and type "av 8 (av_measure)". Or use the menu.

av width-1 vdelta_list

  One of the oldest scripts of the game (and because of that, the first
  argument stayed "arch width minus one", for compatibility reasons).
  Creates a prefab arch of the desired width. If the list has exactly
  as many entries as required, all of them are used to create the prefab -
  this is the way the script has always worked.
  If there are too few or too many elements in the list, the script will
  try to take half the required values from the list and mirror the other
  half to create a symmetrical arch. This way, a list can be used for
  slightly wider or narrower archs. Or use the menu.
2016-09-18 00:22:27 +02:00
ac-stef aca74e1b59 allow copy, paste, undo, redo and selectionwalk in coop edit
limited to selection areas of at max 4096 cubes, which is 64x64 cubes
2016-09-17 22:11:07 +02:00
ac-stef 27c8f43711 add zipped message packets 2016-09-17 22:11:07 +02:00
ac-stef 925645ecb3 new custom arch prefab editor
The menu lists all prefab arches and allows to edit them with sliders.
Arches can be saved and restored.

"archvertex" now returns the old value of the vertex, and if the vertex
argument is omitted, doesn't change it.

enumalias prefix

  Lists all persistent aliases that start with prefix. Returns a table
  with two entries per alias: 1) full name and 2) name without prefix

DOCREF archvertex enumalias
2016-09-17 01:01:40 +02:00
ac-stef dae7773d68 fix involuntary shooting when switching guns while throwing a nade
also: more aggressive middle mouse button
2016-09-16 21:08:48 +02:00
ac-stef 397c441fed more verbose error messages for disabled commands 2016-09-16 17:35:47 +02:00
ac-stef fc3c77868f add hardcoded stairs command for coop
stairs xs ys

  Places stairs in all selections. xs and ys determine the step width
  in x- and y-direction.

DOCREF stairs
2016-09-16 14:06:27 +02:00
ac-stef 4dc54e22b5 allow more edit commands in coop edit
The edit protocol now allows the following commands in multiplayer:

  arch, slope, edittag, edittagclip, selectionrotate, selectionflip

also:

  mapenlarge has been limited to size 10 in multiplayer

  entitiy undelete in multiplayer has been fixed

SV_EDITS, SV_EDITD and SV_EDITE are to be cleaned up with a protocol bump

DOCREF arch slope edittag edittagclip selectionrotate selectionflip
2016-09-16 14:06:27 +02:00
ac-stef 815f4aa764 add selectall command
selectall

  selects the whole map (minus the two cubes wide border)

DOCREF selectall
2016-09-16 14:06:26 +02:00
ac-stef c5904dc065 add stairs to edit menu 2016-09-16 14:06:26 +02:00
ac-stef 6b15891cfd undo changes back to a specific state
undolevel <level>

  Returns the number of undo steps that can be undone. If argument "level"
  is given, as many steps are undone, until "level" steps remain.

Example, during editing:

  echo (undolevel)
    prints number of previous editing steps, for example "55"

  ... do some editing ...

  undolevel 55
    undoes all changes to restore the previous state (if that state
    is still in memory... keep in mind, undo-space is limited, see
    "undomegs" parameter)

  Unless memory limits delete states, undolevel commands can be undone
  with "redo".

DOCREF undolevel
2016-09-16 14:06:26 +02:00
ac-stef 96a028c263 guess height for selections set by command 2016-09-15 18:15:51 +02:00
ac-stef 1b8eeac7ce font fixes 2016-09-14 20:35:13 +02:00
ac-stef 643328b5a1 properly compress chars_default.png
thx BrutalSystem
2016-09-13 21:28:47 +02:00
ac-stef 1a482e5394 final corner physics fix
if corner sliding doesn't work, try x- and y-slides as well
2016-09-13 21:17:07 +02:00
ac-stef a976e5b4ba map fix 2016-09-11 11:17:25 +02:00
ac-stef 29a3970b72 fix flyspeed
and a compiler optimisation error

(for clang >= 4, O3 may be reactivated in the makefile)
2016-09-09 22:22:55 +02:00
ac-stef 588e9f9de8 some fixes for OSX 2016-09-08 22:36:46 +02:00
ac-stef 123e2b2b12 cleanup 2016-09-08 01:20:45 +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