Build 5108
SVN-
Add projectile workslike flag PROJECTILE_NOSETOWNERSHADE = 0x00200000 = 2097152 that prevents actors from inheriting a projectile's shade when shooting it.
-
Really fix get/setprojectile.
SVN handles and Git names are merged into one person.
Add projectile workslike flag PROJECTILE_NOSETOWNERSHADE = 0x00200000 = 2097152 that prevents actors from inheriting a projectile's shade when shooting it.
Really fix get/setprojectile.
weapons.con.sample: Update to use the hudpal member so that fogpals and custom makepalookup definitions display properly.
Fix a mistake in r5086 that broke get/setprojectile.
Add read-only player structure member "hudpal", that returns the result of P_GetHudPal().
Add EVENT_WORLD, EVENT_PREWORLD, and EVENT_PRELEVEL, which respectively function as EVENT_GAME, EVENT_PREGAME, and EVENT_LOADACTOR, but only running once instead of per-actor.
Redefine "break" within events to mean "skip the remainder of this event block", not "skip the remainder of execution of this event, through all chained blocks". The latter behavior is still available through the "return" keyword.
Add token "appendevent", which functions identically to "onevent" except that the event's code is chained to the end of any previous events, instead of the beginning.
Fix processing the bytecode in an incorrect order when executing setplayer on a member with a second parameter, a missed instance of a consideration from r5086.
Remove the restriction that prevents userdef access when the current player is not myconnectindex.
Implement tilesizx/y gamearrays in a fashion similar to M32Script's solution: a STRIDE2 flag.
Modify the parsing of definevolumename and defineskillname so that they only look for the text before a newline.
// valid definevolumename 3 <text> // invalid definevolumename 3 <text>
Add quick access for the remaining structures without it.
Enumify quick structure access.
Factor fast struct access and get<struct> out into single functions.
Add PLAYER_PALETTE to quick player struct access, and add a setter that calls P_SetGamePalette().
A lot of CON rewrites/optimizations. Converts projectile system to dynamic allocation, saving a bunch of memory (something like sizeof(projectile_t) * MAXTILES * 2). This commit also contains changes that reduce overhead for CON commands that take a lot of parameters, by way of adding a Gv_GetManyVars() to replace long strings of subsequent calls to Gv_GetVarX().
Savegame version has been bumped due to the projectile changes. There is no way this commit doesn't cause at least one bug, so DONT_BUILD. ;)
Further gamevar changes/optimizations. This also fixes a bug Fox reported with the "shortcut" access to structure members that's tacked on to GetVar, where if the value of the index you're trying to access happened to equal the ID of the current sprite, it would act as if the variable passed was THISACTOR.
Replace the drawing code for the level stats with nearly equivalent code that can be much more easily reproduced in CON.
Add EVENT_DISPLAYROOMSCAMERA and EVENT_DISPLAYSTART.
EVENT_DISPLAYROOMSCAMERA functions exactly like EVENT_DISPLAYROOMS, including RETURN values, but for the ud.camerasprite >= 0 case. EVENT_DISPLAYSTART is executed immediately after the screen background is cleared and drawn. Ensure its RETURN value is zero, because it is currently not being used. WARNING: Consult the devs before using EVENT_DISPLAYSTART. Its position in the display code sequence is not finalized.
Add EVENT_DISPLAYCAMERAOSD. Set RETURN to -1 to disable it.
From this event, if "getactor[THISACTOR].htg_t 0" is zero, then the camera is functional. Nonzero values indicate the camera has been destroyed, which is only possible when the CAMERASDESTRUCTABLE parameter of gamestartup has been enabled.
Add EVENT_DISPLAYLEVELSTATS. Set RETURN to -1 to disable them.
Add read-only userdef members "gametypeflags" and "m_gametypeflags", which return GametypeFlags[ud.coop] and GametypeFlags[ud.m_coop] respectively.
Add read-only userdef members "usevoxels", "usehightile", and "usemodels".
Add "resetplayerflags". Flag 1 means "don't ask the user if they want to load".
add 'definevolumeflags' to keyword pattern, re-apply some changes of r5026.
DONT_BUILD.
Add "definevolumeflags", currently equipped to hide an episode from the single player and/or multiplayer screens.
enum { EF_HIDEFROMSP = 1<<0, EF_HIDEFROMMP = 1<<1, };
Extend undefinevolume so that it also undefines all levels in the specified volume.
Rename "cutscene" command to "startcutscene".
Stick update of 'totalclocklock' at beginning of G_DrawRooms() instead of drawrooms().
This fixes engine-side sprite animation in the following scenario: CON code wants to draw a scene from EVENT_DISPLAYREST, but since it covers the whole screen, disables the drawing of the 3D scene beforehand (RETURN set to 1 from EVENT_DISPLAYROOMS). DONT_BUILD.
in 'for i drawnsprites' handling, back up and restore sprite MAXSPRITES-1.
This fixes the level 5 corruption encountered when issuing that iteration. (Because the last sprite would be changed from e.g. statnum MAXSTATUS to 0.) It is also mandatory anyhow since the last sprite may be contained in the map.
Add lunatic/test/thisactor_getzrange.con, providing 'state thisactor_getzrange'.
Also, note a place that is the real cause for "what makes the player slide off enemies", as far as I can see.
add 'cutscene' and 'ifcutscene' as NYI commands. DONT_BUILD.
Replace erroneous use of EVENT_DISPLAYCROSSHAIR with new event EVENT_DISPLAYCURSOR.
C-CON changes
Animation system overhaul part 1. This allows for an unlimited number of .anm/.ivf files to be defined via duke3d.def and played back at any time with the new CON commands. Syntax is currently as follows, but may change:
cutscene "somefile.anm" { delay 10 } // defines somefile.anm with a delay of 10 120Hz tics between frames. a more typical framerate method may come later, but this is how the originals worked. Once defined, they can be played through CON with the new playback command, also called "cutscene". It works like this: definequote 12345 somefile.anm define ANIM_SOMEFILE 12345 ... cutscene ANIM_SOMEFILE // halts game execution and immediately plays cutscene, resuming execution when finished ... Sounds can be played during animations (and tiles can be overlaid, etc) like this: onevent EVENT_CUTSCENE ifcutscene ANIM_SOMEFILE { ifvare RETURN 12 // frame 12 sound FLY_BY rotatesprite ... } endevent The value of the RETURN var at the end of EVENT_CUTSCENE determines the next frame to play. This can be used for looping, etc. Attempting to play animations backwards outright is not advised as animations only seek in one direction (so rewinding requires running it through from frame 0 again). This is will WIP and hasn't been heavily tested at all, so please try it out.
Provide a RETURN value of -2 to EVENT_DISPLAYLOADINGSCREEN after G_CacheMapData().
Add undefinevolume, undefineskill, and undefinelevel.
Amend retrieval of STR_*TIME for qgetsysstr, fixing LunaCON and possible oob.
- Add declarations of C functions to defs.ilua, names to dynsymlist, fix typo in con_lang.lua, ffi.string() calls in control.lua - Assert that G_LastMapInfoIndex() is always called with ud.last_level >= 1. (A stricter requirement than necessary to prevent follow-up oob accesses, but logically the most meaningful.) - In G_PrintParTime() and G_PrintDesignerTime(), return "<invalid>" if the above does not hold. This can happen from EVENT_NEWGAME, for example. Add a test to lunatic/test/qgetsysstr.con. DONT_BUILD.
Add read-only access to ud.config.MusicToggle through the "musictoggle" member.
Add STR_YOURTIME, STR_PARTIME, STR_DESIGNERTIME, and STR_BESTTIME to qgetsysstr.
Move EVENT_DISPLAYMENU to after the black translucent background is drawn when in-game.