1541 Commits
Author SHA1 Message Date
ac-stef 4d684cfc8e improve alias lookups
now i = 3; echo $(concatword arg $i) works like echo $arg3 :)
2017-06-06 21:41:25 +02:00
ac-stef dbcb040eeb menu code cleanup
* fix some memory leaks
* rename stuff
* fix crash

Removed commands and variables:

  chmenumdl (replaced by menumdl)

  scorefont (replaced by "menufont score mono")

  menuitemvar (better handled with fully dynamic menus)

Changed commands:

  menufont menu font

    Sets the font for a specific menu. If menu is "", the currently
    initialised menu is used. Example: menufont score mono

  menumdl menu mdl anim rotspeed scale

    Assumes the function of the previous chmenumdl. If menu is "", the
    currently initialised menu is used. Specifies, which model to render
    and how. If only menu is specified, no model is rendered.

DOCREF chmenumdl scorefont menufont menumdl menuitemvar
2017-06-06 13:17:20 +02:00
ac-stef 7948212234 add radio buttons and simplify sliders
- omit step size for sliders with value descriptions
- optionally auto-determine max value by list length

  menuitemslider text min max value display action wrap
  menuitemradio text min max value display action

    text: menu item text
    min: min value
    max: max value (or optionally -1 and set by display string length)
    value: initial value
    display: list of value descriptions or value step size
    action: executed on value changes (new value in arg1)
    wrap: if 1, wrap slider around (radio buttons always wrap)

DOCREF menuitemslider menuitemradio
2017-06-06 13:17:20 +02:00
ac-stef c9ddadd525 per-slider option to wrap around
menuitemslider text min max val step display action wrap

DOCREF menuitemslider
2017-06-05 15:14:40 +02:00
ac-stef e5b99e6da4 xmap menus
getxmaplist <what>

    Returns a list of all regular xmaps in memory, or, if <what> is "bak"
    the details of a stored backup xmap. Each xmap is listed with nickname
    and description.

DOCREF getxmaplist
2017-05-31 19:59:17 +02:00
ac-stef a588761b5a add vantage point menu
also: added sanity checks for vantage points

  getvantagepoint

    returns string with coordinates of vantage point or empty string, if
    none is set

DOCREF getvantagepoint
2017-05-31 14:19:39 +02:00
ac-stef 460066f7da cleanup closestent
- make sure, nextclosestent works for pinned entities
- menu entries for nextclosestent
- highlight closest ent
- have closestenttype return the current value and not change the value if
  the argument is "-"
- recognise manually changed closestenttypes in the menu

DOCREF closestenttype
2017-05-31 12:15:32 +02:00
ac-stef 954fe7ee7f cleanup edithide
- replace by simple bitmask
- rewrite showedithide, setedithide and seteditshow in cubescript
- menu added for convenient use

setedithide and seteditshow no longer accept entity type numbers as
parameters - only entity type names

showedithide, setedithide and seteditshow are considered deprecated

  edithideentmask

    Integer variable containing a bitmask of hidden entity types.

DOCREF showedithide setedithide seteditshow edithideentmask
2017-05-31 03:00:38 +02:00
ac-stef a4cb82b25c point and click to select entities
pointatent 0|1

    enables (1) or disables (0) pointing at entities
    if an entity is poiinted at during disabling, it is pinned

  pointatentmaxangle a

    specifies the required precision for pointing at entities

DOCREF pointatent pointatentmaxangle
2017-05-31 01:56:18 +02:00
ac-stef cb2e20af98 optionally hide closest entity filename info
it gets cut off on 5:4 screens...

  hideeditslotinfo 0..2

    0: show info always
    1: only show "unassigned slot" if necessary
    2: never show info

DOCREF hideeditslotinfo
2017-05-30 10:43:55 +02:00
ac-stef 72e5b08463 add edit info panel
updateeditinfopanel is a cubescript hook to provide additional information
about the current edit situation, like, for example, the closest entity.

The returned text is rendered on the right side of the screen.

Default for updateeditinfopanel is explainclosestentity which provides
detailed info about the closest entity.

  editinfopanelmillis <n>

    update the edit info panel every n milliseconds

  hideeditinfopanel 0|1

    render (0) or hide (1) the edit info panel

DOCREF updateeditinfopanel editinfopanelmillis hideeditinfopanel
2017-05-30 10:43:55 +02:00
ac-stef c02c1277ec cleanup
declare "?" and "switch" deprecated: should not be used or documented

DOCREF ? switch
2017-05-29 15:47:12 +02:00
ac-stef 753474c401 menu updates
- separate settings menus for console and scoreboard
- some sorting
- "return" command removed

DOCREF return
2017-05-29 00:00:26 +02:00
ac-stef 5e20a2343b add animated inlined images for console text
Images are stored in packages/misc/igraph/*.png and loaded during game
start. Filenames consist of the image shorthand (mnemonic) and optional
frame times, separated by "_". Keep in mind, media file names may only
contain letters, digits and "_-.()".

All texts displayed in the game console are scanned for mnemonics prefixed
with ":". All found matches are replaced by the image.

The images are displayed as squares with width and height the same as the
regular font height. To create animations, put several square images side
by side into the file. For example, a 128x32 image is interpreted as four
frames. Frame duration is encoded in the filename, so, for example the file
"nop_1000_200_100.png" shows the first frame for 1000 milliseconds, the
second frame for 200 msec and the third (as the rest) for 100 msec.

Igraphs "1" to "9" are hardcoded and can be manually encoded in menu texts.
Use the new escape code "\i" plus the number of the image: "\i\1".."\i\9".
Other images can be used in menus as well, but the codes have to be fetched
by getigraph.

new commands:

  updateigraphs

    Checks for new files in packages/misc/igraph. Only necessary, if new
    files are added during the game - for example, by mod package download.

  getigraph <mnemonic>

    Returns an encoded string to display an image outside the console, or
    an empty string, if the mnemonic was not found.

new parameters:

  igraphsize 80..300 (default 120)

    scales the images (in percent)

  igraphsizehardcoded 80..160 (default 106)

    scales the hardcoded images "1".."9" (in percent)

  igraphanimate 0..1 (default 1)

    if 0, only the first frame of every image is displayed

  igraphdefaultframetime 5..2000 (default 200)

    used for images with multiple frames but no frame duration specified
    in the filename

  hideigraphs 0..1 (default 0)

    if 1, no new images will be shown in the console

DOCREF updateigraphs getigraph igraphsizehardcoded
DOCREF igraphsize igraphanimate igraphdefaultframetime hideigraphs
2017-05-28 23:29:06 +02:00
ac-stef c97461a0f5 docs fixes and cleanup
- cleanup scoreboard menu code
- clientlog info messages for debug binaries only
- have debug binaries check for easy docs errors
- docinvalid now also checks for broken references
2017-05-24 20:11:11 +02:00
ac-stef 8ece94d5bb allow menu checkboxes to change position
and: fix enumsounds, kill some CR, cleanup

menuitemcheckbox <text> <value> <action> <position>

  Now takes an optional fourth parameter "position" in the range from 0
  to 100, default 0, which moves the position of the checkbox over the
  width of a text input or slider, with 100 being left and 0 being right.

DOCREF menuitemcheckbox
2017-05-24 02:09:17 +02:00
aurhatandac-stef 71a75a9dce Update keyboard menus 2017-05-24 02:09:09 +02:00
ac-stef dd82065177 fix killmessage menu
and add frag/gibmessage weapon name completion
2017-05-22 22:50:51 +02:00
ac-stef 2bc8936680 cleanup killmessages
* remove server-side custom killmessages (log files need to be uniform)
* clean up client-side custom killmessages
2017-05-22 20:19:15 +02:00
ac-stef d0b309320b really cleanup sound
- collect most sound infos in one table and use it to generate the menus
- no more sound category checks with ranges
- now only PAINx and FOOTSTEP* sounds use hardcoded index numbers

enumsounds <list of categories>

  Lists sound index numbers and short descriptions for all sounds of one
  or more categories. The argument should contain one or more of PAIN,
  OWNPAIN, WEAPON, PICKUP, MOVEMENT, BULLET, OTHER, VOICECOM, TEAM,
  PUBLIC, FFA, FLAGONLY. All sounds with at least one of the flags will
  be listed. Flag names prefixed with "!" will exclude all matching
  sound from the list.

  Example: /echo (enumsounds "VOICECOM !PUBLIC") will list all voicecom
  sounds that are for teams only.

DOCREF enumsounds
2017-05-22 17:30:51 +02:00
aurhat e126faef15 Cleanup 2017-05-21 22:08:04 +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 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 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 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 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 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 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
aurhat 4d2d326136 Cleanup 2017-02-18 22:40:07 +01:00
aurhat ab43f7acd5 Add command to return CN of spectated player
Also cleanup and added key shortcut to "whois" spectated player
(bound to "I" by default).

DOCREF spectatecn
2016-12-25 22:47:50 +01:00
ac-stef 206cbdcbd1 better AR approximation
and some fixes
2016-12-03 14:54:18 +01:00
aurhat ee7f75cc10 Add menu for spectate mode key binds 2016-11-29 20:10:35 +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 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 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
aurhat 507394fde9 Improve existing and add some new mapmodel definitions 2016-10-22 00:12:48 +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
aurhat c71420897e Update docs.cfg
Compatible with tree in assaultcube.github.io for #fe8b126 commit.
2016-10-14 22:52:45 +02:00
aurhat 72dfcd73fe Cleanup
"showminremain" enabled by default, "fovcompat" removed.

DOCREF showminremain fovcompat
2016-10-14 21:49:53 +02:00
ac-stef a451a0fd61 show model usage info where models are used 2016-10-14 11:58:13 +02:00
ac-stef 0e425d2103 allow synonym for mapmodel distribution "autodownload"
"akimbo" says the same
2016-10-12 19:45:40 +02:00
aurhat 1d91e49bbe Add high-res player skins
Thanks protox aka PrimoTurbo, the author of the high-res player skins:
http://primoturbo.deviantart.com/art/AssaultCube-Protox-HQ-Reskin-202784715

High-res player skins are added in mod zip package.
They are disabled by default.
2016-10-10 15:57:15 +02:00