* do not use std::abs() because math.h includes one, that converts ints
to double. Use own iabs(), which directly uses labs() instead.
* don't use the word "gamma" as name for variables
* don't use a homebrew round() function
getclosestent
Returns the entity index number of the closest entity (or of the
pinned entity, if one exists). Returns -1, if no entities are on the map.
Returns always exactly the entity, that edit commands like delent
will use next.
DOCREF getclosestent
addentity <type>
Adds an entity of the specified type at the current camera position
and returns the index number of the new entity, so that the other
attributes can be set by editentity.
DOCREF addentity
* fix the old check for different jump start heights as requirement
for doublejumps
* better handle multiple binds for the "jump" command
* delay relaxed floorclamping for crouching
* remove some redundant code
Instead of applying 25% bonus speed with every executed doublejump (with
potentially unlimited top speed), limit the reachable max speed to 125%
of regular full speed.
This limits regular gameplay only marginally but removes a lot of cheat
potential.
When both "forward" and "backward" keys are pressed, now the action
matches the last pressed one. Now the keys work on the ladder exactly
as with regular movement.
VS2008 doesn't have round() in math.h and the old inline function (removed
in 50d1413d, had problems in newer compilers). Now floor() or straight
casting to int is used. Let's see, which MS compiler will trip on that...
This is coded into the priority of a server:
* a priority of -1000 or lower marks a server as disabled
* a priority of -10000 or lower excludes a server from being saved to
pcksources.cfg at program end, so a game restart will delete the server
from the list
According to SDL documentation, the SDL implementation of timedwait may
suck on some platforms, so it should only be used, where high CPU usage
during the wait is no issue.
getpckserver() will now only wait for one second for access to the
package server list and return an error instead of waiting indefinitely.
Don't have the main thread wait for the ping thread, because the ping
thread may take a long time to respond - when a server connection can't
be established. Sadly, there's no timeout for "connect()".
Just placing the flag on top of the water didn't work for fully flooded
map areas, as the flag went out of reach.
This fix tries to float the flag up to the surface and stops, if something
blocks the way.
although I doubt, that anyone ever fell for that
(the fix prevents, that nickname completion can change the first char of
the console string to a slash, which would change the line from chat to
command)
Mapmodels which were not found once are put on a list and not tried to
be loaded again. With this commit, the list is cleared during a map load
if autodownload is enabled. This causes all missing models to be
downloaded.
Fixes issues with manually aborted autodownloads.
http get now uses two timeout values: one for the max time since last
server response, and one for total download time.
When AC is waiting for a server response (before a http header was
received), the progress bar will show the timeout "completion".
getmod modname
Try to download mods/modname.zip from all configured package servers.
Does not automatically activate the mod. The zip files are limited to
one megabyte total.
DOCREF getmod
Zipped mod package files should be placed in "mods/" and need to contain
directory trees starting with "packages/" (or "config/"). The files from
a zip mod replace files, that exist in the original game install or add
new files.
The zip file should contain three special files:
desc.txt
Contains one line with a descriptive title for the package and ten
more optional lines with a detailed description.
preview.jpg
Preview picture for the mod. Must not exceed 128 kbytes. Aim for
512x512 pixel.
revision_n
Empty file. The "n" in the filename should be a valid integer number
instead, specifying the zip revision. Example "revision_123".
The settings menu shows the active mods in order of their priority - which
determines, which file to use, if several mod packages try to add or
substitute the same file. Zip files higher up in the list win.
addzipmod zipname
Add the zip package file "mods/zipname.zip" to the virtual file system.
Only files below the path "packages/" are added (and also files below
"config/", if zipname starts with "###"). If the size of the zip file
is below zipcachemaxsize, the whole zip file is cached in memory.
(Un-cached zip files are kept open at all time, so caching keeps the
number of simultaneously opened files lower.)
zipmodremove zipname
Removes one zip file from the virtual file system.
zipmodclear
Removes all zip files from the virtual file system.
zipmodlist [what]
Lists zip files in "mods/". By default, or if "what" is "all", all zips
are listed. If "what" is "active", only those zips, that are already in
use, are listed. If "what" is "inactive", only the unused zip files are
listed.
zipmodgetdesc zipfile
Reads and returns the first 11 lines from the file "desc.txt" in the
named zip file. The first line is supposed to contain a descriptive
title for the zip (for use in menus) and the next 10 lines should
contain a more detailed description (also for use in menus).
The command also unpacks "preview.jpg" from the zip and mounts it as a
temporary file under the name "packages/modpreviews/zipname.jpg".
zipmodgetfiles zipfile
Returns the list of files contained in a zip file.
zipmodgetrevision zipfile
Returns the revision number of the zip file. The number is supposed to
be part of a filename: "revision_n". If no such file is found in the zip
file, the return value is zero. The content of the revision file is not
relevant and a file size of zero is recommended.
DOCREF addzipmod zipmodremove zipmodclear zipcachemaxsize
DOCREF zipmodlist zipmodgetdesc zipmodgetfiles zipmodgetrevision
By specifying a title string in the second argument to chmenutexture,
a picture is rendered instead of a texture. The title string is
displayed instead of the texture resolution. The variable menupicturesize
holds a size modifier for pictures, similar to menutexturesize.
DOCREF chmenutexture menupicturesize
* 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
* 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
* based on the enet socket layer
* supports redirects, range requests and gzip encoding
* automatically tries to re-use existing connections
* easy multithreading
* writes output to file or ram buffer
- 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)
Check printf-like functions like conoutf, if format strings and argument
lists match.
This commit also fixes a lot of code parts that actually had mismatching
argument lists - or did things, that this check does not like.
numtime() was rewritten in an ugly but very portable fashion (it's
recommended to stay away from "long long" format entries, because errors
usually only come up at runtime).
(some code was copied from sauer)
getvarrange <what> <varname>
Gets range attribute <what> for builtin variable <varname>.
what
one of "min", "max" or "default"
varname
name of any builtin variable (integer or float)
DOCREF getvarrange
menuselectionpersistent
Enables persistent selections for the currently displayed menu and also
restores a previously saved selection. Probably most efficient inside
"menuinit". The position is restored during execution of this command,
so the menu entry has to already exist and the alias with the last
position has to be read from saved.cfg. In autmatically created menus
it may be necessary to execute the command with a short delay (see
examples in this commit).
DOCREF menuselectionpersistent
When textures of the map geometry are changed, five textures around the
current pick from the "last used" stack are shown. The texture assigned
to the "sky" slot is not shown. Instead, a plain blue rectangle is used.
hudtexttl
Time to show texture preview (in milliseconds).
DOCREF hudtexttl
Also: add '\a' to the list of escaped characters and remove storage of
unneeded "filename".
mitemaltfont <altfont> <text> <action> <hoveraction> <desc>
Displays a menu line with a text which may contain chars from an
alternate font.
altfont
Name of the alternate font.
text
Content of menu line. Chars from the alternate font have to be marked
with "\a". Alternate font chars have no width and are just rendered
above the following text. Use spaces to counter that.
action, hoveraction, desc
Same function as with other menu lines.
DOCREF menuitemaltfont
Create the rotation matrix with quaternions to avoid gimbal lock. The
matrix is created in a way, which has pitch and yaw behave as before.
Some of the quaternion code is borrowed from sauer, some from Q47 of the
Quaternions FAQ at http://vamos.sourceforge.net/matrixfaq.htm.
Lists all available skymaps. List is divided into skymaps provided by
the original install ("official") and custom skymaps located in the
profile directory.
4th parameter of the "mapmodel" command is now a scale factor between
0.25 and 4.0. Values outside that range (like the dummy zero from old
map config files) are interpreted as 1.0
Scaling does not affect the clipping, which has to be adjusted manually.
DOCREF mapmodel editmapmodelslot
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
chmenutexture <menu name> <texture path>
Displays a texture on the right side of a menu.
menutexturesize <size factor>
Changes the size of textures displayed in menus. Mostly for testing
purposes.
DOCREF chmenutexture menutexturesize
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
"findfilelocation" contains the location, where the file was found.
Not a nice solution, but nice enough :)
Note: if the location is FFL_WORKDIR, the existence of the file has not
actually been checked yet.
The command mapmodelattributes is now more appropriately named
"getmapmodelattributes", and the former "getmapmodelattributes" is now
named "listallmapmodelattributes".
DOCREF listallmapmodelattributes getmapmodelattributes
Moves a menu away from the middle of the screen. Values of "100" represent
half the screen width and height.
menurenderoffset x-offset y-offset
DOCREF menurenderoffset
Pressing the middle mouse button toggles a pin on the "closest entity"
selector. The HUD will indicate the lock by showing "pinned" instead of
"closest" entity. All actions, that would otherwise affect the closest
entity, will affect the pinned entity instead. Deleting the locked entity
will unlock it.
toggleclosestentpin
Toggles the pin on the "closest ent" selector. Bound to MOUSE3
by default.
DOCREF togglelockclosestent
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
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.
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()