Build 6411
SVN-
Fix checkavailweapon command.
SVN handles and Git names are merged into one person.
Fix checkavailweapon command.
Fix playervar quick structure access.
CON-solidation
Sorry for the shitty pun
Another attempt at fixing the problems caused by my recent changes to gamearrays
Maybe, possibly, unfuck gamearrays.
ifspawnedby and ifwasweapon are really the same command. Merge the code to execute them.
Syntax changes for gamevar and gamearray declarations:
Gamevar: default value and flags are now optional. A var declared without a value will default to 0 and a var declared without flags will default to global. Multiple flags can now be stacked one after another in a var declaration, and the most useful ones (GAMEVAR_PERPLAYER, GAMEVAR_PERACTOR, GAMEVAR_NODEFAULT, and GAMEVAR_NORESET) are now pre-defined tokens for easy use. Gamearray: flags field now allows stacking of multiple flags as described above. Arrays can now be defined with specific data types, including int16_t, uint8_t, and a new bit-packed boolean data type. The tokens GAMEARRAY_RESTORE, GAMEARRAY_INT16, GAMEARRAY_UINT8, and GAMEARRAY_BOOLEAN are pre-defined for use of this feature. This is all still pretty experimental.
Remove special limitations on CON customization access to the DNCGS cheat.
Revise some CON VM error messages for consistency. Upgrade a couple of CON VM errors to a new critical error type which pops up a dialog box when the error is encountered. If you've been writing crappy scripts that spam "divide by zero!" errors into the log that you've been ignoring, you're gonna have a bad time.
Some work on CON arrays. Hopefully nothing is broken!
Add support for bitmap gamearrays and expose gotpic to CON
Allow writing to 8 and 16-bit CON arrays
Add OSD_PROTECTED flag, set when gamefunc_Show_Console has been undefined from CON. Currently just requires you hold down shift when pressing the console key to open the console.
When calculating which rotation to use for CON action viewtype 7, offset the frame intervals by 15 degrees instead of 22.5, clearly a copypaste error from viewtypes 5 or 8. Now these are properly centered.
Add wall.blend to structure access.
Add EVENT_PRELOADGAME and EVENT_POSTLOADGAME.
Add drawline256 and drawlinergb commands that call the internal functions used for the automap lines.
drawline256 <x0> <y0> <x1> <y1> <index> drawlinergb <x0> <y0> <x1> <y1> <index> <rgb> The coordinates are xdim<<12/ydim<<12 based, not 320<<16x200<<16. <index> is a palette index, and for drawlinergb is used as a fallback in the software renderer. <rgb> is encoded the same as PROJ_FLASH_COLOR.
Add getclosestcol command, which finds the closest palette index given
getclosestcol <return> <color> <limit> <color> is encoded the same as PROJ_FLASH_COLOR. <limit> is the index of the last palette color that should be considered. Use 255 for the whole palette, 254 to exclude the transparent color, 239 to exclude Duke 3D's fullbrights, etc.
Add EVENT_DISPLAYOVERHEADMAPTEXT.
Set RETURN to any non-zero value to disable hardcoded display of text. If you wish to replace the hardcoded text, you must check that userdef[].overhead_on == 2 yourself.
Potential CON performance improvements
Can Duke3D CON version compatibility messages in standalone builds
Gamevar cleanup
Use macros for special gamevar access range checking
Change hard-coded subway effect damage to generic explosive damage that can be handled by CON. Fixes subway kills not counting toward the dead monster count and allows CON scripts to handle subway damage however they like.
Move Mapster32 autoexec to before the map specified on the command line is loaded, to allow EVENT_PRELOADMAP and EVENT_LOADMAP to work when loading a map from the command line. This makes the console output of autoexec a little worse but the OSD will be fixed at a later time.
Handle the save and savenn commands after the full tic is processed, instead of in the middle of it during execution. DONT_BUILD.
Add undefinegamefunc.
Factor out code for launching EVENT_GAME and EVENT_PREGAME.
weapons.con.sample: Use full precision when applying weapon scaling.
weapons.con.sample: Add internal temp variables for rotatesprite parameters that the subroutines need to modify. This fixes weapon scaling.
weapons.con.sample: Rename hud_G_Draw_temp* to hud_int_temp*.
weapons.con.sample: Only setvar RETURN -1 for values of drawweapon that we actually handle. (Currently all of them, but this is more future-proof.)
weapons.con.sample: No need to andvar before getting a sine value. The source does that for us.
Remove bounds check on rotatesprite coordinates.