Commit Graph

102 Commits

Author SHA1 Message Date
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
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
helixhorned 70dc2f7376 CON: 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.

git-svn-id: https://svn.eduke32.com/eduke32@4972 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 18:48:28 +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
helixhorned ca7a5acce7 LunaCON: expose more members, properly handle setting ud.screen_size.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4814 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:07 +00:00
helixhorned 442a9bbfef voxmodel.c: fix Polymost rendering of voxels.
This reverts/corrects two semantic changes of r4639 as far as what is now
voxmodel.c (formerly part of mdsprite.c) is concerned. One correction ends
up having no effect (m->bscale is always 1.f for voxel models, as far as I
can see), but is the proper rewrite.

Also, in osdcmds.c:registerosdcommands(), tweak two help strings.

git-svn-id: https://svn.eduke32.com/eduke32@4800 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-06 21:05:36 +00:00
helixhorned 0cc9f05b8b LunaCON: player[].loogcnt, userdef[].color, minor fixes.
git-svn-id: https://svn.eduke32.com/eduke32@4732 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-07 22:07:10 +00:00
helixhorned 757dbe9d6b LunaCON: properly initialize values of session (NODEFAULT) gamevars.
git-svn-id: https://svn.eduke32.com/eduke32@4570 1a8010ca-5511-0410-912e-c29ae57300e0
2014-08-08 20:02:55 +00:00
helixhorned 1486a2937b A couple of Lunatic updates. DONT_BUILD.
- LunaCON: support for setting userdef[].m_volume_number, getting .last_level
- bump con_lang.MAXEVENTS
- fix compilation of astub.c

git-svn-id: https://svn.eduke32.com/eduke32@4567 1a8010ca-5511-0410-912e-c29ae57300e0
2014-08-02 17:24:39 +00:00
hendricks266 fd78e9f954 By request, implement EVENT_ACTIVATECHEAT.
git-svn-id: https://svn.eduke32.com/eduke32@4515 1a8010ca-5511-0410-912e-c29ae57300e0
2014-06-16 23:16:55 +00:00
helixhorned e810071cfc LunaCON: add read-only variable 'Numsprites', r/w userdef member .mouseaiming.
git-svn-id: https://svn.eduke32.com/eduke32@4475 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-18 09:55:42 +00:00
helixhorned fb05cf5b7e CON: add getactor[]/sprite[] member 'movflags'.
This is exactly the same as the actor[].movflags member in the Lunatic build:
http://lunatic.eduke32.com/lunatic.html#actor

git-svn-id: https://svn.eduke32.com/eduke32@4448 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-19 22:42:18 +00:00
helixhorned 7603f432df Rename sector[].filler member to '.fogpal'. From CON, keep the '.alignto' alias.
The overall situation is thus as follows:
 - in C and from Lua, that member is called 'fogpal'
 - In CON (both C-CON and LunaCON), it's 'fogpal' with 'alignto' being an alias;
   'filler' wasn't available before, either.
 - In m32script, it's 'fogpal' or 'alignto' ('filler' is not available any more)

git-svn-id: https://svn.eduke32.com/eduke32@4416 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-05 11:28:10 +00:00
helixhorned d656171777 LunaCON: provide access to wall[].blend.
git-svn-id: https://svn.eduke32.com/eduke32@4396 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-25 21:04:37 +00:00
helixhorned 6908ce6be7 LunaCON: warn if using reserved bits in 'spriteflags'.
Reserved bits are those that have no predefined SFLAG_* label in CON.

git-svn-id: https://svn.eduke32.com/eduke32@4372 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:48 +00:00
helixhorned 5cb6e20c63 Add new actor flag and predefined CON label SFLAG_NODAMAGEPUSH.
This flag is set from C for some enemies that should not be pushed back when
damaged, such as TANK. Both the tile flag and the per-sprite flag are used
(i.e. the ultimate flag value is the XOR of the two).
Add currently non-functional example to test.lua that attempts to set this bit
for NEWBEAST.

git-svn-id: https://svn.eduke32.com/eduke32@4371 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:47 +00:00
helixhorned ea8c081084 LunaCON: add and document option -ferror-negative-tag-write.
git-svn-id: https://svn.eduke32.com/eduke32@4356 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-28 20:33:46 +00:00
helixhorned a37c31cab7 Lunatic: rename sprite[].filler member to 'blend' on the Lua side.
From LunaCON, remove 'detail' as alias to that member.

git-svn-id: https://svn.eduke32.com/eduke32@4302 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:51 +00:00
helixhorned 60612d07f0 LunaCON: error on userdefs accesses with non-local current player.
Add lunatic/test/getuserdef.con.

git-svn-id: https://svn.eduke32.com/eduke32@4285 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:01 +00:00
helixhorned 14db86ebb5 Lunatic: make gv.current{Level,Episode} one-based and document them.
Also, in LunaCON, make player .palette member read-only. BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4260 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-15 20:29:10 +00:00
helixhorned 70d84cd75b Lunatic: run EVENT_INIT after initial Lua state creation.
git-svn-id: https://svn.eduke32.com/eduke32@4231 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:50 +00:00
helixhorned 148badc32a Lunatic: allow access to sprite[].yvel through set_yvel() member, document.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4230 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:39 +00:00
helixhorned 0c69779b98 Scripting: Add EVENT_DAMAGEHPLANE and document it in Lunatic doc Appendix B.
Also add test/damagehplane.lua with these demonstrations:
 - custom breakable ceilings
 - breakable TROR glass

git-svn-id: https://svn.eduke32.com/eduke32@4206 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:33 +00:00
helixhorned 44351528db LunaCON: statically check some member assignments with literal numbers.
And issue warnings whenever the assignment would fail (error) at game time.

git-svn-id: https://svn.eduke32.com/eduke32@4195 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-11 21:23:42 +00:00
helixhorned b6efd5e57e LunaCON: disable some player members, tweak decls of others.
The ones disabled are because they were found to not be used in any mod I
tested. Exposing members directly is rarely good API.

- bool toggle_key_flag -> const uint8_t ... (because value 2 is used)
- make scream_voice, cheat_phase read-only

git-svn-id: https://svn.eduke32.com/eduke32@4179 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:02 +00:00
helixhorned cc1574464b LunaCON: fix assignment to projectile sound/bsound/isound.
git-svn-id: https://svn.eduke32.com/eduke32@4177 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:17:56 +00:00
helixhorned 987eb858d3 LunaCON: add a couple of userdefs members, fix tsprite's sectnum for writing.
git-svn-id: https://svn.eduke32.com/eduke32@4150 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:16 +00:00
helixhorned 8029aceaa4 CON: add sprite pseudo-member 'isvalid', getting 1 if the sprite is valid.
And 0 otherwise. Before accessing a sprite that is not not known to be
definitely valid (e.g. a loop over all sprites from 0 to MAXSPRITES-1),
one should check for validity before accessing it in any other fashion.

git-svn-id: https://svn.eduke32.com/eduke32@4146 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 16:48:17 +00:00
helixhorned d9b94c772d LunaCON: implement NODEFAULT flag (1024) as session variables.
This is in contrast to C-CON, where the implications are not clearly obvious.
See this discussion/monologue:
http://forums.duke4.net/topic/955-eduke32-scripting/page__view__findpost__p__159613

Currently not implemented for session gamevars:
 - per-player, will be made a global one instead
 - per-actor, will be made a plain per-actor one instead

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4112 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-20 12:35:06 +00:00
helixhorned 9ecbd633aa Lunatic: rework weapondata_t __newindex handling for the sound members.
Also, in test.elua, add a currently failing must-fail test (i.e. it wrongly
succeeds where it should not!).

git-svn-id: https://svn.eduke32.com/eduke32@3954 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:59 +00:00
helixhorned e13cae69ce LunaCON: add forgotted "screensound" to keyword list in con_lang.lua.
Also, fix 'spriteflags' directive.

git-svn-id: https://svn.eduke32.com/eduke32@3945 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:43 +00:00
helixhorned 7f2175fcec Lunatic: retire per-sprite tsprite access for per-tile animation callback reg.
Don't yet make this official API though, since there are unresolved issues
with newly created tsprites potentially being fed back to the animation loop.
Add xmath.angvec(), xmath.bangvec(), tspr:set_sectnum(), tspr:setpos().

git-svn-id: https://svn.eduke32.com/eduke32@3937 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:10 +00:00
helixhorned d580c1e998 Lunatic: many changes, motivated by writing test "helixspawner".
- some renames of functions/methods
- con.actorvar: explicitly allow (for now) boolean and number values
- added gv.gametic, player.holdskey(), player.all(), actor.check*()/hit*(),
  gv.rendmode, gv.REND, <bitint>:mask(), spr:getheightofs()
- make read of nil var in "finalized" (live) module produce error, too
- add test/helixspawner.lua

git-svn-id: https://svn.eduke32.com/eduke32@3928 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:42 +00:00
helixhorned e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned 9911e96fe8 Lunatic: rename spriteext[].*off->mdoff.*, actor[].actorstayput->stayputsect.
git-svn-id: https://svn.eduke32.com/eduke32@3874 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:55 +00:00
helixhorned 2f29a89368 Lunatic: provide CON-defined labels in read-only table require("CON.DEFS").
git-svn-id: https://svn.eduke32.com/eduke32@3870 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:47 +00:00
helixhorned 2003954492 CON: add projectile member .userdata and predefined label PROJ_USERDATA.
It is a 32-bit signed integer. No version bump necessary, although CON code
accessing this new member will not work with earlier revisions (obviously).

git-svn-id: https://svn.eduke32.com/eduke32@3866 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:18 +00:00
helixhorned bd49bc7bbd LunaCON: strip dir prefixes on file-not-found; _getpname, ud.m_player_skill.
git-svn-id: https://svn.eduke32.com/eduke32@3862 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:34 +00:00
helixhorned 5e5f80d61b Lunatic: keep status number symbols in actor.STAT instead of gv.STAT_*.
git-svn-id: https://svn.eduke32.com/eduke32@3860 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:30 +00:00
helixhorned 7fcb577f51 LunaCON: hook up qstrdim and screentext.
Also add some recent keywords to the list in con_lang.lua which I had
forgotten all along.

git-svn-id: https://svn.eduke32.com/eduke32@3845 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:45 +00:00
helixhorned 97f857ec39 Lunatic: split 'replace' option for actor chaining flags into soft/hard.
Hard replacement reassigns the tile flags, while soft replacement bitwise
ORs them, as in CON (since some flags might already have been set using
commands like spritenoshade).

git-svn-id: https://svn.eduke32.com/eduke32@3829 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:54 +00:00
helixhorned 640eda2194 LunaCON: implement 'definegametype', allow writing userdef.level_number.
Also, allow (implicit) actor index -1 to 'sound' like in C-CON and fix
MULTIMODE gamevar definition (was 0, not 1).

git-svn-id: https://svn.eduke32.com/eduke32@3826 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:49 +00:00
helixhorned 13b69711ac LunaCON: add a couple of ud members, gamevars; handle 'dynamicremap' only once.
Also, allow MAXVOLUMES+1 to first arg of 'music'.

git-svn-id: https://svn.eduke32.com/eduke32@3817 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-26 18:42:53 +00:00
helixhorned 1ee43d5a6e LunaCON: Add -Wall option and sector[].*bunch, warn on some NYI gamevar flags.
git-svn-id: https://svn.eduke32.com/eduke32@3804 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:25 +00:00
helixhorned 65a10afbc8 LunaCON: make on-disk gamearray footer contain non-printable chars.
Also, allow writing userdefs[].auto_run.

git-svn-id: https://svn.eduke32.com/eduke32@3732 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:30 +00:00