Commit graph

505 commits

Author SHA1 Message Date
hendricks266
efe58c71f9 C-CON: Fix a harmless "Internal compiler error" warning when using quick structure access on userdef.
git-svn-id: https://svn.eduke32.com/eduke32@5354 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-24 06:31:52 +00:00
hendricks266
f69f1e73df CON: Add "defstate" token which functions identically as in M32script: synonymous with CON's "state" only at top-level (when defining a state). Useful for syntax highlighting.
git-svn-id: https://svn.eduke32.com/eduke32@5353 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-24 06:31:44 +00:00
hendricks266
a557eedf7e Remove NULL checks before calling free(): they are unnecessary as per the C standard. Other cleanup includes factoring code into DO_FREE_AND_NULL() macros.
git-svn-id: https://svn.eduke32.com/eduke32@5352 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:55:31 +00:00
hendricks266
ad94a8399c C-CON: Add userdef members "globalflags" and "globalgameflags", which control the values specified by the def commands of the same name.
git-svn-id: https://svn.eduke32.com/eduke32@5248 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-27 08:45:30 +00:00
terminx
a1b4d05c48 Minor internal CON changes.
git-svn-id: https://svn.eduke32.com/eduke32@5245 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-26 00:48:17 +00:00
helixhorned
85be0bebec LunaCON: from 'definevolumename', make g_numVolumes be determined as in C-CON.
git-svn-id: https://svn.eduke32.com/eduke32@5236 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-25 12:57:51 +00:00
helixhorned
1fc7e10843 savegame: fix g_tile[].proj memory leaks, halve number of projectile_t allocations.
git-svn-id: https://svn.eduke32.com/eduke32@5191 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-16 11:56:49 +00:00
hendricks266
5979378c4e CON: Add player[].index, which returns the player ID that you put in. Mostly useful to get the magic value of THISACTOR when applied to the player struct.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5165 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-26 00:07:57 +00:00
helixhorned
5683beec3d Do "typedef projectile_t defaultprojectile_t;" instead of having an indetical-member type.
Move projectile_t to player.h.

git-svn-id: https://svn.eduke32.com/eduke32@5159 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-18 21:59:21 +00:00
hendricks266
c24e5f51cd Add events for the remaining player-related HUD display functions:
EVENT_DISPLAYSPIT - loogies from the SPIT projectile
EVENT_DISPLAYFIST - nukebutton fist (shrunk fists are part of EVENT_DISPLAYWEAPON)
EVENT_DISPLAYKNEE - pstomp knee (quick kick is part of EVENT_DISPLAYWEAPON)
EVENT_DISPLAYKNUCKLES - knuckle crack idle animation
EVENT_DISPLAYSCUBA - scuba gear
EVENT_DISPLAYTIP - tip hand
EVENT_DISPLAYACCESS - access cards / keycards

git-svn-id: https://svn.eduke32.com/eduke32@5118 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-30 05:57:30 +00:00
hendricks266
0bc349fde2 C-CON: Add two new structs, tiledata and paldata, accessible only through quick-access.
git-svn-id: https://svn.eduke32.com/eduke32@5115 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-30 05:56:37 +00:00
hendricks266
0adcc4a3f7 C-CON: Add read-only player structure member "hudpal", that returns the result of P_GetHudPal().
git-svn-id: https://svn.eduke32.com/eduke32@5099 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:29:24 +00:00
hendricks266
8a9fb41d5f CON: 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.
git-svn-id: https://svn.eduke32.com/eduke32@5098 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:29:05 +00:00
hendricks266
c784fdb21c C-CON: 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.
git-svn-id: https://svn.eduke32.com/eduke32@5097 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:28:45 +00:00
hendricks266
0805a0ed45 CON: 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.
git-svn-id: https://svn.eduke32.com/eduke32@5093 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 21:31:11 +00:00
hendricks266
a14109da20 C-CON: 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>

git-svn-id: https://svn.eduke32.com/eduke32@5089 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 06:28:09 +00:00
hendricks266
49c85f644d C-CON: Add quick access for the remaining structures without it.
git-svn-id: https://svn.eduke32.com/eduke32@5088 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 06:27:57 +00:00
hendricks266
5c8a2e3ea6 C-CON: Enumify quick structure access.
git-svn-id: https://svn.eduke32.com/eduke32@5087 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 06:27:42 +00:00
hendricks266
ab58a33ec6 Menus: Add a Cheats menu to options.
It's old-school.

git-svn-id: https://svn.eduke32.com/eduke32@5084 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 10:49:03 +00:00
terminx
c9ce545ab8 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. ;)

git-svn-id: https://svn.eduke32.com/eduke32@5080 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:55 +00:00
hendricks266
6e64696605 Expand the quote #13 auto-replacement to catch "OPEN" and "ANY BUTTON" in addition to "SPACE".
git-svn-id: https://svn.eduke32.com/eduke32@5063 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-23 06:28:40 +00:00
hendricks266
f821434195 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.

git-svn-id: https://svn.eduke32.com/eduke32@5047 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:58:24 +00:00
hendricks266
ef28cac919 CON: 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.

git-svn-id: https://svn.eduke32.com/eduke32@5046 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:58:06 +00:00
hendricks266
35bee70ee6 CON: Add EVENT_DISPLAYLEVELSTATS. Set RETURN to -1 to disable them.
git-svn-id: https://svn.eduke32.com/eduke32@5045 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:57:47 +00:00
hendricks266
c86bd80dd7 C-CON: Add read-only userdef members "gametypeflags" and "m_gametypeflags", which return GametypeFlags[ud.coop] and GametypeFlags[ud.m_coop] respectively.
git-svn-id: https://svn.eduke32.com/eduke32@5044 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:57:28 +00:00
hendricks266
d7409a5a95 C-CON: Add read-only userdef members "usevoxels", "usehightile", and "usemodels".
git-svn-id: https://svn.eduke32.com/eduke32@5043 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:57:13 +00:00
hendricks266
b61908cbf3 CON: Add "resetplayerflags". Flag 1 means "don't ask the user if they want to load".
git-svn-id: https://svn.eduke32.com/eduke32@5039 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-04 02:15:15 +00:00
hendricks266
697e7d0936 CON: 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,
};

git-svn-id: https://svn.eduke32.com/eduke32@5033 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-22 22:15:20 +00:00
hendricks266
afccb6d735 CON: Extend undefinevolume so that it also undefines all levels in the specified volume.
git-svn-id: https://svn.eduke32.com/eduke32@5032 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-22 22:14:54 +00:00
hendricks266
31c9d21b06 CON: Rename "cutscene" command to "startcutscene".
git-svn-id: https://svn.eduke32.com/eduke32@5031 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-22 22:14:39 +00:00
helixhorned
702f80cc17 gamedef.c: tweak g_keywdate[] entries.
git-svn-id: https://svn.eduke32.com/eduke32@5022 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-20 22:10:28 +00:00
hendricks266
d88a938320 Replace erroneous use of EVENT_DISPLAYCROSSHAIR with new event EVENT_DISPLAYCURSOR.
git-svn-id: https://svn.eduke32.com/eduke32@5003 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 07:08:27 +00:00
terminx
25668422d8 Get rid of the "press space to restart" message on mobile. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4996 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:41 +00:00
terminx
50c30ab790 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.

git-svn-id: https://svn.eduke32.com/eduke32@4987 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:07 +00:00
hendricks266
929b04d473 CON: Add undefinevolume, undefineskill, and undefinelevel.
git-svn-id: https://svn.eduke32.com/eduke32@4977 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-09 05:50:33 +00:00
hendricks266
e8f842ac28 CON: Add read-only access to ud.config.MusicToggle through the "musictoggle" member.
git-svn-id: https://svn.eduke32.com/eduke32@4970 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:04:09 +00:00
hendricks266
b355d75ab3 CON: Add STR_YOURTIME, STR_PARTIME, STR_DESIGNERTIME, and STR_BESTTIME to qgetsysstr.
git-svn-id: https://svn.eduke32.com/eduke32@4969 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:03:50 +00:00
hendricks266
d7f846d0b6 Factor out generation of strings for time values in the bonus screen. This involves the creation of ud.playerbest.
git-svn-id: https://svn.eduke32.com/eduke32@4968 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:03:30 +00:00
helixhorned
57079dfee1 Add SFLAG_NOWATERDIP, unconditionally preventing actors from dipping into ST1 water.
By default, the following enemies have this flag set: OCTABRAIN, COMMANDER, DRONE.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4956 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:14 +00:00
hendricks266
93a3ff34e8 Add events EVENT_DISPLAYINACTIVEMENU and EVENT_DISPLAYINACTIVEMENUREST and userdef members m_origin_x and m_origin_y.
This allows for CON screen display code to use menu animations. The following is an example of how to adapt screen features that should animate.

before:

onevent EVENT_DISPLAYMENUREST
    ifvare current_menu 0 // main menu
    {
        setvar x 1
        setvar y 1
        rotatesprite x y zoom ang tilenum shade pal orientation 0 0 xdim ydim
    }
endevent

after:

state DisplayMenuCommon
    ifvare RETURN 0 // main menu
    {
        getuserdef[THISACTOR].m_origin_x x
        getuserdef[THISACTOR].m_origin_y y
        addvar x 65536
        addvar y 65536
        rotatesprite16 x y zoom ang tilenum shade pal orientation 0 0 xdim ydim
    }
ends

onevent EVENT_DISPLAYMENUREST state DisplayMenuCommon endevent
onevent EVENT_DISPLAYINACTIVEMENUREST state DisplayMenuCommon endevent

git-svn-id: https://svn.eduke32.com/eduke32@4945 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:16:58 +00:00
hendricks266
011fd40dda CON: Add new commands "getmusicposition" and "setmusicposition" that operate on the playback position of the current music track.
// Example: Switch between tracks like radio stations.
 getmusicposition temp
 starttrackvar next_music_track
 setmusicposition temp

Only implemented for Ogg Vorbis, FLAC, and XA. Consult the devs before using these commands.

git-svn-id: https://svn.eduke32.com/eduke32@4928 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 00:28:49 +00:00
hendricks266
e7b7a9fcf1 Clean up duplicate and strangely-formed cases in C_ParseCommand().
git-svn-id: https://svn.eduke32.com/eduke32@4926 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 00:27:19 +00:00
terminx
364cf15c4f Questionable CON changes and optimizations. <3
git-svn-id: https://svn.eduke32.com/eduke32@4902 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:56:10 +00:00
helixhorned
a1091233d2 CON: allow passing more than one flag to the 'spriteflags' directive.
These will be bitwise-OR'd.

git-svn-id: https://svn.eduke32.com/eduke32@4841 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:58 +00:00
helixhorned
2eff7bf6ce gamedef.c: factor out some dup'd code into C_BitOrNextValue(), C_FinishBitOr().
git-svn-id: https://svn.eduke32.com/eduke32@4840 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:57 +00:00
terminx
8934226bb2 Another 5000 lines of pain and tears. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4680 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:36:34 +00:00
terminx
8e98cbe083 Free h_labels table when done compiling CONs
git-svn-id: https://svn.eduke32.com/eduke32@4628 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:15:41 +00:00
helixhorned
2713bc3d75 Get rid of EnvMusicFilename[] and use MapInfo[].musicfn for that.
The additional space was there all the time, so it's not understandable why
another array was necessary.
CON: for 'music', error if volume number is outside [0 .. MAXVOLUMES+1], and
in LunaCON, additionally warn if it's MAXVOLUMES+1 (0 is preferred for that).

git-svn-id: https://svn.eduke32.com/eduke32@4588 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-07 18:10:14 +00:00
helixhorned
73a252a73e More music-related cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@4586 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-07 18:10:12 +00:00
helixhorned
7254bf7ac4 Fix crash using INTERNAL DEFAULTS after CON error when CON modules were given.
git-svn-id: https://svn.eduke32.com/eduke32@4582 1a8010ca-5511-0410-912e-c29ae57300e0
2014-08-31 11:15:21 +00:00