* use keyrepeat and textinput switch code from sauer (on windows, opening
a console with "t" also produced a "t" as text otherwise)
* screenw and screenh are now cubescript-variables that always reflect
the actual resolution of the screen or the window
DOCREF screenw screenh
* switch travis to trusty
* new parameter fullscreendesktop: uses desktop resolution for fullscreen
* "colorbits" removed, since it's no longer supported
* scr_w/scr_h no longer necessarily reflect the true display resolution
(with fullscreendesktop = 1 and fullscreen = 1, scr_w and scr_h are
ignored)
* desktopw and desktoph are now guaranteed to have nonzero values
* fallback to old mouse behaviour when SDL_SetRelativeMouseMode fails
* require a click into the window to grab the mouse
* scr_w/scr_h default to desktop resolution on first run
thx sauerbraten :)
DOCREF fullscreendesktop colorbits
the same mousewheel direction now always moves an entity away from or
towards the player
entproperty
if 100 is added to the attribute index parameter, the sign of the
increment value is changed
editaxis
returns a value for the main axis of player orientation (X:11, Y:12,
Z:13) and adds 100 if the player is looking in the negative
direction of the axis
DOCREF entproperty editaxis
greyed out menu items are a) grey and b) can't be operated
menuitemgreyedout 0|1
menu items added after this command are greyed out (1) or not (0)
DOCREF menuitemgreyedout
almost 3000 lines of "errors" contained one actual memleak, one actually
unused variable and three actual ambiguous code parts
from cppcheck website: "The goal is to detect only real errors in the
code (i.e. have zero false positives)." :)
thx for finding five problems in our code
new tool: list media sources
new stage: check vantage points
new: add single map from menu
new: option to abort maps on stage errors
fixed: make sure, player is alive (to be able to enter edit mode) during
conversions
- copyent and pasteent now also work with the menu list of copied ents
- pressing editmeta while using pasteent opens the menu
- new switch command (not unlike the old one)
- make expandselection and shrinkselection work with multiple selections
DOCREF switch copyent pasteent
newent7 type attr1 attr2 attr3 attr4 attr5 attr6 attr7
Works like newent, but can set all seven attributes directly.
Does not automatically put the camera yaw angle into mapmodel and flag
entities.
fixed selectionwalk so that the first parameter can be ""
DOCREF newent7
- always allow read-only edittextureslot, editmapmodelslot and
editmapsoundslot
- allow setvantagepoint when editing offline or spectating offline
- new var editing_sp: 1 during edit mode in singleplayer (offline)
- additional menus for read-only access to map config slots
- new bonus edit scripts: selectmiddle and unclipentclippedmodels
DOCREF edittextureslot editmapmodelslot editmapsoundslot setvantagepoint
DOCREF editing_sp
menuitemmapload mapname action [hoveraction [desc]]
create menu entry for a map file
menudirlistsub action dots
adds subdirectory entries to a menu with a files list
has to come after the menudirlist command
<action> is the command to be executed, when the menu entry is chosen
if <dots> is 1, an entry ".." is added
enumfiles path [extension]
lists files in a directory
if extension is specified, only files of that extension are listed
if the extension is "dir", only directories are listed
DOCREF menuitemmapload menudirlistsub enumfiles
pressing CTRL+F12 during spectating creates a clean screenshot and saves
it as map preview picture
modkeypressed
returns 1, if a CTRL key is pressed and 0, if not
screenshotpreview [lines]
creates a screenshot cropped to 4:3 with a given number of lines
(in the range of 144 to 480, default 240 or last given value)
and jpeg quality 80
gotovantagepoint
now returns 1, if the map actually has a vantage point set
DOCREF screenshotpreview modkeypressed gotovantagepoint
(editentity, edittextureslot, editmapmodelslot, editmapsoundslot)
the commands are still not allowed to change anything in coop, but
information retrieval is ok
changed commands:
strstr haystack needle
now returns position of needle in haystack (counting from 1)
or zero, if not found
substr string start len
now counts negative length from total length
"substr text 1 -2" now returns the text without first and last char
strreplace text search replace
no longer restricted to 260 char stringlengths
removed commands:
swapelements, strpos (can be scripted, if required)
DOCREF strstr substr
DOCREF swapelements strpos
replace tokens starting with @ during scanning/sizing-up of []-blocks
@word look up word as in $word
@(...) evaluate braces
@[...] evaluate braces and look up result
@"..." parse quotes
in nested []-blocks, use multiple @ to determine time of replacement
(for example, @@@word is replaced when found inside three nested braces)
in regular $-lookup, $[...] now evaluates the braces before lookup
* 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
- 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
to use existing url parser
valid examples:
assaultcube://example.org
assaultcube://example.org:28763
assaultcube://example.org:28763/?password=secret
assaultcube://example.org?password=secret
assaultcube://example.org/?password=secret
assaultcube://example.org/?port=28763
assaultcube://example.org?password=secret&port=28763
assaultcube://example.org?port=28763&password=secret
assaultcube://11.22.33.44
assaultcube://11.22.33.44/
assaultcube://11.22.33.44:28763
assaultcube://11.22.33.44:28763/?password=secret
* the slash after the host part (example.org) is optional
* the host part can also be an IP address
* password and port in the query part (after '?') have no specific order
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
inputcommand <init> <command> <prompt> <nopersist>
Opens a custom console buffer with custom prompt, initial buffer text
and execution script (which gets the input buffer content in alias
cmdbuf). If nopersist is not zero, the command will not be stored in
console history.
DOCREF inputcommand
also: added sanity checks for vantage points
getvantagepoint
returns string with coordinates of vantage point or empty string, if
none is set
DOCREF getvantagepoint
- 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
- 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
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
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
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
like format, but all parameters are treated as lists and are exploded first
format2 <formatstring> arg1 arg2 arg3...
substitutes %1..%9 with the arguments 1..9
argument lists are exploded first
/echo (format "_%1_%2_%3_%4_%5_" "A B C" D E F)
prints: _A B C_D_E_F__
/echo (format2 "_%1_%2_%3_%4_%5_" "A B C" D E F)
prints: _A_B_C_D_E_
In addition, both format and format2 now allow access to more than nine
parameters. Parameter numbers of 10 and higher have to be prefixed with
an additional zero. For example "%010" accesses parameter number ten.
DOCREF format2 format
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
- 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
also clean up and fix some stuff: lilswap(unsigned long long int) mapped
to the 32-bit swap code...
added some runtime tests for the hash functions - now they will crash at
startup, if some test vectors fail (because big endian is still untested)
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
Use a plain cubescript variable instead of a commandline switch.
mastertype
0: classic direct TCP connection
1: HTTP connection (via proxy) (default)
DOCREF mastertype "--mastertype="
- 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
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
- 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
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)
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
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
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