- I'm assuming this check was here for a reason, but when both branches of
the if do the same thing and it's been this way since before recorded
history, it's not obvious what was intended here.
- "If it ain't broke, don't fix it."
- Some of the changes were downright wrong and some were pointless, so undo
everything that doesn't look like an actual improvement.
- Take advantage of the new _Pragma operator to hide the printf warning
suppression inside of macros instead of needing to litter the code
around Printfs with a bunch of junk.
- Fixed: Script arrays didn't work in named scripts because the loader
read the script number as an unsigned word, hence it would never find
named scripts, since they are stored with negative numbers.
Conflicts:
src/CMakeLists.txt
src/b_think.cpp
src/g_doom/a_doomweaps.cpp
src/g_hexen/a_clericstaff.cpp
src/g_hexen/a_fighterplayer.cpp
src/namedef.h
src/p_enemy.cpp
src/p_local.h
src/p_mobj.cpp
src/p_teleport.cpp
src/sc_man_tokens.h
src/thingdef/thingdef_codeptr.cpp
src/thingdef/thingdef_function.cpp
src/thingdef/thingdef_parse.cpp
wadsrc/static/actors/actor.txt
wadsrc/static/actors/constants.txt
wadsrc/static/actors/shared/inventory.txt
- Added register reuse to VMFunctionBuilder for FxPick's code emitter.
- Note to self: Need to reimplement IsPointerEqual and CheckClass, which
were added to thingdef_function.cpp over the past year, as this file no
longer exists in this branch.
Decorate: IsPointerEqual(int aaptr_selector1, int aaptr_selector2)
ACS: IsPointerEqual(int aaptr_selector1, int aaptr_selector2, int tid1 = 0, int tid2 = 0)
Compare the pointers values returned by two pointer select operations. Returns true if they both resolve to the same value. Null values can be explicitly tested using IsPointerEqual(AAPTR_NULL, ...)
ACS: IsPointerEqual(int aaptr1, int aaptr2, int tid1 = 0, int tid2 = 0)
This function lets you compare pointers from other actors than the activator, using tids. Tid1 determines the actor used to resolve aaptr1, Tid2 does the same for aaptr2. If tid1 and tid2 are equal, the same actor will be used for resolving both pointers (that could always happen randomly; this way you know it will happen).
The optimizer miscompiles the function FBehavior::LoadScriptsDirectory and causes random crashes when zdoom is run with wads containing scripts.
As said in the comment, I just hope that the Clang devs fix it for the next patching release, ie 3.5.1.
- Added CF_INTERPVIEW flag for players. A_SetPitch/A_SetAngle and the
similar ACS APROPs set this when changing an angle. This forces the
renderer to interpolate the view angles instead of updating with the
latest mouse positions. The effect lasts one tick.
- Fixed: When an ACS string pool was read from a savegame, FirstFreeEntry
would not be updatedt, except by the Clear() function. This left FirstFreeEntry
at 0, which meant the next string added to the pool would always go in
slot 0, whether it was free or not.
- If a player is spying through another player, CheckPlayerCamera will
return the TID of the player you are "spying", but as coopspy isn't a
net command, this wont be reflected by all nodes. So to fix this,
CheckPlayerCamera now returns -1 if a player's camera is that of any
player at all. (thanks edward850)
int SpawnDecal(int tid, str decalname, int flags, fixed angle, int zoffset, int distance)
Traces a line from tid's actor until hitting a wall, then creates a decal there. Returns the
number of decals spawned.
* tid = Which actor(s) to start the trace at.
* decalname = Which decal to spawn.
* flags =
* SDF_ABSANGLE = Angle parameter is an absolute angle. Otherwise, it's relative to the origin actor's angle.
* SDF_PERMANENT = Decal ignores cl_maxdecals. Otherwise, it will eventually disappear.
* angle = Direction in which to search for a wall. Defaults to 0.0.
* zoffset = Offset from the middle of the origin actor for the Z height of the decal. Defaults to 0.
* distance = Maximum distance to search for a wall. Defaults to 64.
SVN r4330 (trunk)
- Fixed: ACSStringPool::InsertString()'s overflow check was far too low.
- Fixed: When ACSStringPool::InsertString() triggered a garbage collection, it ignored the
newly freed space and expanded the array anyway.
SVN r4328 (trunk)
of taking an actual sound name as its second parameter, it selects the sound to play based on
the actor playing the sound and the selector passed as the second parameter.
SVN r4323 (trunk)
* The standard C functions strcmp and stricmp (aka strcasecmp), which double up as strncmp and strnicmp if you pass a third argument.
* The BASIC-like functions strleft, strright, and strmid, which extract parts of a string to
create a new string.
SVN r4313 (trunk)
counterparts except that (1) PlaySound requires you to specify a sound instead of defaulting
to "weapons/pistol", and (2) StopSound defaults to CHAN_BODY instead of CHAN_VOICE.
SVN r4306 (trunk)
major change to ACS's workings. However, I had an epiphany yesterday and just had to do this, since it seems like too big a deal to hold off until a later release:
- Dynamically generated strings returned via strparam and get(user)cvar now last as long as they
need to. They do not disappear at the end of each tic. You can now safely store them in
variables and hold on to them indefinitely. In addition, strings from libraries no longer
require you to load the exact same libraries in the exact same order. You can even store a
library's string in a world variable and retrieve it on another map that doesn't load the
library at all, and it will still be the correct string.
- ACS library IDs now only get 12 bits instead of 16 so that each string table can hold up
to about a million strings instead of just 65536. This shouldn't be a problem, although it
means that save games that had strings with the larger IDs stored in variables are no
longer compatible. Since many saves don't involve libraries at all, and even many that do
are not actually affected, I'm not bumping the min save version. The worst that can happen
is that you get no text at all where some was expected.
SVN r4295 (trunk)
counterparts, except that they return strings. Like strparam, the strings they return are
only guaranteed to be valid for the tick they are called during. (Note that these work with any
cvar, not just string ones.)
SVN r4293 (trunk)
counterparts except that their value argument is an ACS string. (Note that they work with any
type of cvar, not just string cvars.)
- Make UCVarValue::String point to a constant string.
SVN r4292 (trunk)
* int GetUserCVar(int playernum, "cvarname")
* bool SetCVar("cvarname", newvalue)
* bool SetUserCVar(int playernum, "cvarname", newvalue)
GetUserCVar is analogous to GetCVar, except it returns the value of a user cvar for a
specific player. (All user cvars can be examined using the playerinfo console command.)
SetCVar sets a cvar to a new value. If the cvar is floating point, then newvalue is treated
as a fixed point number, otherwise it's treated as an integer. SetUserCVar is the same, but
for a specific player's user cvar.
SetCVar and SetUserCVar can only change cvars created via CVARINFO. They cannot alter built-in cvars.
If you use GetCVar or SetCVar with a user cvar, they will act on the copy of the user cvar
for the player who activated the script. e.g.
GetCVar("gender")
is the same as
GetUserCVar(PlayerNumber(), "gender")
If you get the value of a floating point cvar, it will be returned as a fixed point number.
Otherwise, it will be returned as an integer.
SVN r4283 (trunk)
- Separated CVAR_MODARCHIVE into CVAR_MOD|CVAR_ARCHIVE so that mod-defined cvars can still be
identified when they aren't meant to be archived.
SVN r4281 (trunk)
of the form:
<scope> [noarchive] <type> <name> [= <defaultvalue>];
Where <scope> is one of:
* server: This cvar is shared by all players, and in network games, only select players can
change it.
* user: Each player has their own copy of this cvar, which they can change independently.
To prevent the cvar from being written to the config file, add noarchive to its definition.
<Type> is one of:
* int: An integral value. Defaults to 0.
* float: A value that can include a fraction. Defaults to 0.0.
* color: A color value. Default to black ("00 00 00").
* bool: A boolean value that can hold either true or false. Defaults to false.
* string: A string value. It's not too useful for mods but is included for completeness. Defaults to "".
<Name> is the cvar's name and must begin with a letter and may only include alphanumeric
characters and the underscore character.
If you wish a non-standard default add an = character after the cvar's name followed by the
default value you want to use. Example:
server int mymod_coolness = 10;
- Fixed: FStringCVar::SetGenericRepDefault() did not make a copy of the input string.
SVN r4280 (trunk)
* acsprofile clear - Resets all profiling statistics to 0.
* acsprofile [<sort-function>] [<limit>]:
* <sort-function> is an optional argument that specifies which column to sort on (total, min, max, avg, or runs). The default is total.
* <limit> is an optional argument that specifies how many rows to limit the output to. The default is 10. 0 or less will print every script or function that has at least one run.
SVN r4060 (trunk)
and two new functions, both of which are intended for use in conjunction with SetHUDSize:
* SetHUDClipRect(x, y, width, height[, wrapwidth]) - Set the clipping rectangle for future
HUD messages. If you do not specify <wrapwidth>, the HUD message will be layed out as
normal, but pixels outside the rectangle will not be drawn. If you specify <wrapwidth>,
then the message will be wrapped to that width. Use SetHUDClipRect(0, 0, 0, 0[, 0]) to
reset everything
back to normal.
* SetHUDWrapWidth(wrapwidth) - Sets the wrapping width for future HUD messages without
altering the clipping rectangle. If you set the wrapping width to 0, messages will wrap
to the full width of the HUD, as normal.
* HUDMSG_NOWRAP - A HUDMessage() flag that disables wrapping for one message. It is
functionally equivalent to SetHUDWrapWidth(0x7FFFFFFF), except that it only affects the
message it's attached to.
SVN r3960 (trunk)
be no conflicts with recently-added named arguments for spawnable things on UDMF maps.
- Change the SpawnableThings array into a map, so there is no longer any particular upper limit on an actor's SpawnID. Also fixes a possible exploit, since an actor's SpawnID was never checked to make sure it was within range.
SVN r3959 (trunk)
- Changed Actor's Damage property into an actual function. All access to the damage property
must now be done through GetMissileDamage. actor->GetMissileDamage(0, 1) is equivalent
to the former actor->Damage, for the case where actor->Damage was not an expression. (I
suppose I will probably need to make a thunk for DECORATE expressions that want to read it.)
- Cleaned up some decorate expression evaluation functions that are no longer used.
SVN r3919 (scripting)
parameter added to the end of the HudMessage command's existing parameter lists. So for
HUDMSG_PLAIN, it comes after the hold time. For HUDMSG_FADEOUT and HUDMSG_TYPEONE, it comes
after the fade time. And for HUDMSG_FADEINOUT, it comes after the out time.
- Alpha is a fixed point number between 0.0 and 1.0.
- Example:
Without alpha (unchanged from before):
HudMessage(s:"Some text", HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 0.5, 0.5, 3.0);
With alpha (alpha is added to the end):
HudMessage(s:"Some text", HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 0.5, 0.5, 3.0, 0.5 /* this is the alpha */);
SVN r3825 (trunk)
* HUDMSG_NOTWITH3DVIEW : This message does not appear when the 3D view is active.
* HUDMSG_NOTWITHFULLMAP : This message does not appear when the fullscreen automap is active.
* HUDMSG_NOTWITHOVERLAYMAP : This message does not appear when the overlay automap is active.
These flags may be combined, so for example: HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP
would prevent the message from appearing if any form of automap is active.
- Added HUD message layers, which are ORed into the type field:
* HUDMSG_LAYER_OVERHUD : This is the default and standard behavior. The message appear on
top of most HUD elements. This definition is just included for completeness' sake; you
don't need to explicitly use it.
* HUDMSG_LAYER_UNDERHUD : The message appears underneath other HUD elements, such as the status bar.
* HUDMSG_LAYER_OVERMAP : The message appears on top of the fullscreen automap. At the moment,
this layer is functionally equivalent to using the flags HUDMSG_NOTWITH3DVIEW | HUDMSG_NOTWITHOVERLAYMAP.
However, if Blzut3 decides to implement support for drawing the automap permanently on a
second screen, messages on this layer will move to that screen with the automap and be permanently
visible as long as the map is visible on that other screen.
These are not flags, so for example HUDMSG_LAYER_UNDERHUD | HUDMSG_LAYER_OVERHUD is not valid.
SVN r3821 (trunk)
is more efficient than ThingCount(tid, T_NONE), because it only needs to check for one actor
with the TID and not all of them. It also makes no distinction between dead things and live
things like ThingCount does.
- Added ACS function UniqueTID(tid, limit): It returns a new TID that is not currently used by
any actors. It has two modes of operation. If tid is non-zero, then it checks TIDs one-by-one
starting at the given tid until if finds a free one. If tid is zero, then it returns a completely
random TID. If limit is non-zero, then it will only check that many times for a free TID, so
it might not find a free one. If no free TID is found, 0 is returned. If limit is zero, then
the search is effectively unlimited.
SVN r3798 (trunk)