Commit Graph

70 Commits

Author SHA1 Message Date
hendricks266 0ca09c08da CON: Add user_map and m_user_map read-only userdefs.
git-svn-id: https://svn.eduke32.com/eduke32@6616 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:13:30 +00:00
hendricks266 2cdf98f07a Systematize the appearance of the menu fonts using the DOS version as a reference.
New events:
"EVENT_MENUCURSORLEFT"
"EVENT_MENUCURSORRIGHT"
"EVENT_MENUCURSORSHADE"
"EVENT_MENUSHADESELECTED"

New userdef structures:
"menu_shadedeselected"
"menu_shadedisabled"
"menutext_zoom"
"menutext_xspace"
"menutext_pal"
"menutext_palselected"
"menutext_paldeselected"
"menutext_paldisabled"
"menutext_palselected_right"
"menutext_paldeselected_right"
"menutext_paldisabled_right"
"gametext_zoom"
"gametext_xspace"
"gametext_pal"
"gametext_palselected"
"gametext_paldeselected"
"gametext_paldisabled"
"gametext_palselected_right"
"gametext_paldeselected_right"
"gametext_paldisabled_right"
"minitext_zoom"
"minitext_xspace"
"minitext_tracking"
"minitext_pal"
"minitext_palselected"
"minitext_paldeselected"
"minitext_paldisabled"
"minitext_palselected_right"
"minitext_paldeselected_right"
"minitext_paldisabled_right"
"menutitle_pal"
"slidebar_palselected"
"slidebar_paldisabled"

Self-explanatory. Use in conjunction with "menutext_tracking" and "gametext_tracking" ("mgametext_tracking" is now ignored).

The values for disabled shade is added to the selected or deselected shades. The palettes have a disabled > selected > deselected hierarchy, and are applied if not zero.

Patch from Fox

git-svn-id: https://svn.eduke32.com/eduke32@6613 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:14:16 +00:00
hendricks266 e1e5e338dc New commands: "divr", "divru", "divrd"
divr <dividend> <divisor>

Divide gamevar <dividend> by <divisor> and round (aka round to nearest) the result. A result of 0.5 will equal 1.

divru <dividend> <divisor>

Divide gamevar <dividend> by <divisor> and round up (aka round away from zero) the result.

Additionally "divrd" can be used to round down (aka round toward zero), which is equivalent to the current div command as tested on x86, ARM, and PowerPC.

Note that "shiftr" rounds up negative values.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6611 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:14:04 +00:00
hendricks266 1cbf5e36e1 New command "qstrcmp"
qstrcmp <quote1> <quote2> <var>

Compare two quotes. <var> returns zero if they are identical, -1 if the first quote comes first in alphabetical order, 1 if it comes later.

Note that the lexicographical order is rudimentary, for example "Player 2" is considered greater than "Player 10".

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6609 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:13:55 +00:00
hendricks266 97fd71c3db Add EVENT_DISPLAYOVERHEADMAPPLAYER.
RETURN is the tilenum to be displayed. It is pre-populated with what the game will display for the current frame.

Set RETURN to -1 to disable.

git-svn-id: https://svn.eduke32.com/eduke32@6608 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-28 04:31:04 +00:00
hendricks266 740cedefbb New userdef structures "default_volume", "default_skill"
Lets you choose which episode or skill should be selected by default in the menus. Default values are 0 and 1, respectively.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6596 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:33 +00:00
hendricks266 a96613f496 Add "Alternate Weapon" key similar to Shadow Warrior Classic Redux.
When pressed it switches between pipebomb / detonator or shrinker / expander.

New event "EVENT_ALTWEAPON"

Akin to "EVENT_PREVIOUSWEAPON" and "EVENT_NEXTWEAPON". RETURN is set to 12.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6594 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:23 +00:00
hendricks266 67438d0cd2 New userdef structure: "global_r", "global_g", "global_b"
Set the tinting RGB values of textures being rendered. Can be used in DISPLAYROOMS or before rotatesprite (similar to setaspect). Remember to reset the values afterwards.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6591 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:11 +00:00
hendricks266 1e04f43240 New userdef structure: "menu_slidebarz", "menu_slidebarmargin", "menu_slidecursorz"
Self-explanatory. Default value for all is 65536.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6589 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:02 +00:00
hendricks266 4da012a15f Add an option to move the status bar to the top of the screen in the Android version.
Restores a feature temporarily disabled in r6553.

Currently only supports the modern status bar.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6588 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:34:57 +00:00
hendricks266 150ddded12 New userdef structure: "statusbarflags", "statusbarrange", "statusbarcustom"
"statusbarflags" is a bitfield. Values are:
STATUSBAR_NONONE = 1
STATUSBAR_NOMINI = 2
STATUSBAR_NOFULL = 4
STATUSBAR_NOSHRINK = 8
STATUSBAR_NOFRAGBAR = 16
STATUSBAR_NOOVERLAY = 32
STATUSBAR_NOMODERN = 64
Default value is 8. In case you modify it, you also have to set the other status bar related userdefs in EVENT_SETDEFAULTS. Default values in EDuke32 are: screen_size = 4; statusbarmode = 1; althud = 1;

"statusbarrange" is used to add more alternatives for the status bar without breaking the option in the menu. If used, the mini status bar (screen_size = 4) will cycle through "statusbarcustom" when changing the screen size.

Also fix the size of the viewport when the screen is shrunk and the scale of the status bar is not 100%.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6587 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:34:51 +00:00
hendricks266 85d0a3c520 New userdef structure "menubackground"
Set to 0 to disable the black transparent mask below the in-game menu.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6585 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:34:43 +00:00
hendricks266 cf64b480f1 Add new events at various points that display hardcoded screens.
New event "EVENT_MAINMENUSCREEN"

Triggered before the main menu is displayed. Set RETURN to -1 to disable the screens that appear before the main menu.

New event "EVENT_NEWGAMESCREEN"

Triggered when a new game is started. Set RETURN to -1 to disable The Birth intro animation.

New event "EVENT_ENDLEVELSCREEN"

Triggered when a level ends. Set RETURN to -1 to disable the bonus and deathmatch score screens after a level ends.

New event "EVENT_EXITGAMESCREEN"

Triggered when a running game is ended. Set RETURN to -1 to disable the deathmatch score screen when you quit mid-game.

New event "EVENT_EXITPROGRAMSCREEN"

Triggered when the program is closed. Set RETURN to -1 to disable the shareware or TEN screen,sif they were enabled in LOGO_FLAGS.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6584 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:34:38 +00:00
hendricks266 bcb41aac3e New player structures "frags" and "deaths"
player[<killer>].frags <victim>

Equals how many times player <killer> killed <victim>. Note that the sum of these values will not equal the total kills or deaths for a player since another player may disconnect, so use "frag" or "deaths" instead.

player[<id>].deaths

Equals the total number of times the player died in the round, not including suicides.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6563 1a8010ca-5511-0410-912e-c29ae57300e0
2017-12-12 05:14:19 +00:00
hendricks266 756fa2bbd8 New userdef structure "screenfade"
Set to zero to disable the hard-coded fade to black transition between screens, menu or when the level ends.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6556 1a8010ca-5511-0410-912e-c29ae57300e0
2017-12-12 05:13:53 +00:00
hendricks266 ea36d5289a New event "EVENT_SETDEFAULTS".
Use this event to change the value of userdefs when initializing cfg settings with defaults.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6554 1a8010ca-5511-0410-912e-c29ae57300e0
2017-12-12 05:13:46 +00:00
hendricks266 6164e3dae8 Revise view background / border drawing code.
New event "EVENT_UPDATESCREENAREA"

Use this event to change the size of the game view, similar to when you press + or -.

New event "EVENT_DISPLAYBORDER"

Set RETURN to change the background tile of the game view, set -1 to disable the background and border.

New userdef structures "screenarea_x1", "screenarea_y1", "screenarea_x2", "screenarea_y2"

Use these structures to change the boundaries of the view in EVENT_UPDATESCREENAREA.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6518 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:44 +00:00
hendricks266 1c107bd877 CON: Add EVENT_RECOGSOUND.
Set RETURN to -1 to disable the sound played when an enemy awaken. You have to use a command to play a sound, because the bosses use globalsound.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6517 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:40 +00:00
hendricks266 102a720402 CON: Add EVENT_OPENMENUSOUND.
Set RETURN to the sound played when the menu is opened. -1 to cancel.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6516 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:37 +00:00
hendricks266 c9981e76af CON: Add EVENT_DISPLAYEND and EVENT_DISPLAYROOMSEND.
EVENT_DISPLAYROOMSEND: Triggered right after the game world is rendered and before any sprite above the screen.
EVENT_DISPLAYEND: Triggered after the game draws everything above the screen, including menus. A counterpart to EVENT_DISPLAYSTART.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6512 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:23 +00:00
hendricks266 74908b1def CON: Add screenpal command.
screenpal <r> <g> <b> <a>

Similar to palfrom, but works on screen events. Values range from 0 to 255.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6509 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:14 +00:00
hendricks266 f6678b336a CON: Add command "startscreen" and corresponding EVENT_SCREEN.
Use startscreen to take control away from the game and display content with rotatesprite.

RETURN is set to 1 when any key is pressed, and if it is nonzero when the event ends, the screen ends and the game resumes.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6508 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:11 +00:00
hendricks266 dbd8b72d10 CON: Add EVENT_SKIPCUTSCENE.
Used with startcutscene. RETURN is set to 1 when any key is pressed, and is used to control when a cutscene ends.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6507 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:07 +00:00
hendricks266 1377afe414 CON: Add EVENT_PRECUTSCENE.
Used with startcutscene. RETURN sets the frame of an ANM before it is rendered.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6506 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:29:04 +00:00
hendricks266 38df0b7e82 CON: Add "actorsound" command.
Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@6504 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:28:58 +00:00
hendricks266 bad61e3934 Replace arbitrary MAXGAMEEVENTS macro with the properly generated MAXEVENTS.
git-svn-id: https://svn.eduke32.com/eduke32@6503 1a8010ca-5511-0410-912e-c29ae57300e0
2017-11-29 07:28:54 +00:00
terminx 7bdd0e1361 Crash fix
git-svn-id: https://svn.eduke32.com/eduke32@6493 1a8010ca-5511-0410-912e-c29ae57300e0
2017-10-31 02:09:39 +00:00
hendricks266 d6682d58d3 Expand use of VM_GetKeywordForID to all other references to vm_keywords[].
Fixes printing of incorrect keywords, reported by Trooper Dan.

git-svn-id: https://svn.eduke32.com/eduke32@6485 1a8010ca-5511-0410-912e-c29ae57300e0
2017-10-16 03:32:34 +00:00
hendricks266 b3455b7b4d Amend r6460 to move vm_keywords[] back to gamedef.cpp and factor the ID to keyword mapping into VM_GetKeywordForID().
git-svn-id: https://svn.eduke32.com/eduke32@6484 1a8010ca-5511-0410-912e-c29ae57300e0
2017-10-16 03:32:30 +00:00
terminx 938d444b35 This should fix the scrambled log output when the game crashes while executing a CON script somewhere
git-svn-id: https://svn.eduke32.com/eduke32@6460 1a8010ca-5511-0410-912e-c29ae57300e0
2017-10-04 22:30:53 +00:00
hendricks266 fc0eabebb6 Add player[].connected.
Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@6453 1a8010ca-5511-0410-912e-c29ae57300e0
2017-09-27 02:30:24 +00:00
terminx 98cd4a5c6c Use tokenmap_t struct to define all CON keywords
git-svn-id: https://svn.eduke32.com/eduke32@6432 1a8010ca-5511-0410-912e-c29ae57300e0
2017-08-27 10:20:23 +00:00
hendricks266 df70cbbbeb CON: Add "stopallmusic" command.
git-svn-id: https://svn.eduke32.com/eduke32@6427 1a8010ca-5511-0410-912e-c29ae57300e0
2017-08-06 13:45:02 +00:00
hendricks266 cbb18f5c70 CON: Add starttrackslot <volume> <level>
Clobbering ud.volume_number is a hack no one should need to use any more.

Only this command supports specifying -1 for volume to access the main menu, briefing, etc themes.

git-svn-id: https://svn.eduke32.com/eduke32@6414 1a8010ca-5511-0410-912e-c29ae57300e0
2017-08-01 09:48:59 +00:00
hendricks266 bc1ed207d6 CON parser: Merge some cases for code size savings.
git-svn-id: https://svn.eduke32.com/eduke32@6413 1a8010ca-5511-0410-912e-c29ae57300e0
2017-08-01 09:48:55 +00:00
hendricks266 0f54975751 Yet another round of trailing whitespace.
git-svn-id: https://svn.eduke32.com/eduke32@6400 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-29 20:39:46 +00:00
terminx 7c7f550100 Useless change to force a synthesis build
git-svn-id: https://svn.eduke32.com/eduke32@6398 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-28 20:24:54 +00:00
terminx b00266b47f CON-solidation
Sorry for the shitty pun

git-svn-id: https://svn.eduke32.com/eduke32@6382 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-27 09:13:21 +00:00
terminx dad337add8 Fix gcc 7.1.0 warnings
git-svn-id: https://svn.eduke32.com/eduke32@6370 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-18 20:53:41 +00:00
terminx af0a291a59 Improve C_AddDefaultDefinitions()
git-svn-id: https://svn.eduke32.com/eduke32@6367 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-18 20:53:15 +00:00
hendricks266 494c778feb Fix some int/int32_t mismatches. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@6362 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-15 21:56:21 +00:00
terminx f4e1012081 "qputs" alias for "redefinequote"
git-svn-id: https://svn.eduke32.com/eduke32@6358 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-12 04:10:29 +00:00
terminx 01d92aeed2 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.

git-svn-id: https://svn.eduke32.com/eduke32@6356 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-11 04:02:52 +00:00
hendricks266 c980410ecc Remove special limitations on CON customization access to the DNCGS cheat.
git-svn-id: https://svn.eduke32.com/eduke32@6349 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-10 13:43:50 +00:00
terminx 3706ac1b43 Allow scripts to change MAXSPRITESONSCREEN before calls to drawrooms() and friends
git-svn-id: https://svn.eduke32.com/eduke32@6347 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-08 19:42:11 +00:00
terminx da0cc1b9bd Some work on CON arrays. Hopefully nothing is broken!
git-svn-id: https://svn.eduke32.com/eduke32@6343 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-08 19:41:43 +00:00
terminx 2b7cd33fc2 script command aliases
git-svn-id: https://svn.eduke32.com/eduke32@6336 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-07 22:50:47 +00:00
hendricks266 ad32eaeee0 Don't execute setcfgname if the provided name is the same as the one already in place.
git-svn-id: https://svn.eduke32.com/eduke32@6317 1a8010ca-5511-0410-912e-c29ae57300e0
2017-07-05 05:37:52 +00:00
hendricks266 0d7518891b CON: Add wall.blend to structure access.
git-svn-id: https://svn.eduke32.com/eduke32@6277 1a8010ca-5511-0410-912e-c29ae57300e0
2017-06-25 11:23:58 +00:00
hendricks266 7afc8202d2 CON: Add EVENT_PRELOADGAME and EVENT_POSTLOADGAME.
git-svn-id: https://svn.eduke32.com/eduke32@6262 1a8010ca-5511-0410-912e-c29ae57300e0
2017-06-24 09:21:07 +00:00