Commit Graph

115 Commits

Author SHA1 Message Date
helixhorned e4849af91f LunaCON: implement 'tossweapon'.
git-svn-id: https://svn.eduke32.com/eduke32@3943 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:38 +00:00
helixhorned 1e26e640e4 Lunatic: swap first and second arg of con.spawn().
git-svn-id: https://svn.eduke32.com/eduke32@3939 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:41 +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 f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned 7c3f7909cc Lunatic: various changes.
- swap 2d and 3rd args in xmath.rotate() -- now rotate(point, ang, pivot)
- add vec3 method 'rotate', calling xmath.rotate
- store game tic count in savegames

git-svn-id: https://svn.eduke32.com/eduke32@3929 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:46 +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 fb0c13f9f2 Lunatic: serialization for cdata types, currently xmath.vec3 and ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3914 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:35 +00:00
helixhorned 885036a6a3 Lunatic: retire 'geom' module, putting vector types into xmath.
git-svn-id: https://svn.eduke32.com/eduke32@3909 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:41 +00:00
helixhorned 7cb94070e1 Lunatic: allow serialization of tables in more general cases.
git-svn-id: https://svn.eduke32.com/eduke32@3908 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:39 +00:00
helixhorned 89d865b8b1 Lunatic: don't pass 0x80000000 to int32_t arg, document xmath functions.
git-svn-id: https://svn.eduke32.com/eduke32@3906 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:33 +00:00
helixhorned bfd9feb5aa Lunatic: document vector types, add forgotten warning icon.
git-svn-id: https://svn.eduke32.com/eduke32@3895 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:12 +00:00
helixhorned 1febaae767 Lunatic: various minor tweaks and fixes.
- Pass original module name (dot=dirsep) to module via our require()
- geom.lua: fix some operations using the vector type constructor
- geom.lua: provide constructor for ivec3, useable like vec3

git-svn-id: https://svn.eduke32.com/eduke32@3894 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:09 +00:00
helixhorned 5db04f585e Lunatic: player method fadecol(), an improved palfrom.
Also, an external 'minitext' with optional shade and pal. args and
documentation for ps:padecol().

git-svn-id: https://svn.eduke32.com/eduke32@3893 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:50 +00:00
helixhorned b319ae5613 Lunatic: major overhaul of gamevar serialization for savegames.
- Handle local gamevars.
- Restore gamevars from require('end_gamevars').

git-svn-id: https://svn.eduke32.com/eduke32@3891 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:47 +00:00
helixhorned 878ba20af9 LunaCON: make mail, money, paper be affected by tile remapping, fix one printf.
git-svn-id: https://svn.eduke32.com/eduke32@3881 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:06 +00:00
helixhorned f6065e227a Lunatic: make gameactor and gameevent be "table-called" functions.
git-svn-id: https://svn.eduke32.com/eduke32@3873 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:53 +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 16b3cb6a42 LunaCON: showview and showviewunbiased.
git-svn-id: https://svn.eduke32.com/eduke32@3861 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:32 +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 34138cdc96 Lunatic: fix current incarnation of gamevar saving/restoration.
git-svn-id: https://svn.eduke32.com/eduke32@3857 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:17 +00:00
helixhorned f0ed046a98 LunaCON: fix mistranslation of CON "else { if" to Lua "elseif".
When encountering a non-empty statement inside braces, emit "do" ... "end".

git-svn-id: https://svn.eduke32.com/eduke32@3840 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:37 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
helixhorned 1715b7631f Make deletion of an ambient sound MUSICANDSFX sprite stop its sound again.
Add a test case source/lunatic/test/delmusicsfx.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3822 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:51 +00:00
helixhorned 8d74181ddf LunaCON: fix qsprintf, add test code for GAMEVAR_{NODEFAULT,NORESET} flags.
git-svn-id: https://svn.eduke32.com/eduke32@3805 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:27 +00:00
helixhorned 76299ca635 LunaCON: partially implement {save,load}mapstate CON commands.
What is missing is saving and restoring per-player and per-actor gamevars.
Also add a test CON mutator 'mapstate.con'.

git-svn-id: https://svn.eduke32.com/eduke32@3794 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:34 +00:00
helixhorned a082ec76dd Lunatic: fix randgen module after md4 removal, run DEFS_BC_SIZE cmd only once.
git-svn-id: https://svn.eduke32.com/eduke32@3785 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 10:41:57 +00:00
helixhorned a648522c68 Lunatic: move utility scripts to util/, bittest.lua -> test/test_bitar.lua.
git-svn-id: https://svn.eduke32.com/eduke32@3657 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:03 +00:00
helixhorned 023ff8f190 Lunatic: begin gamevar system. Not much there yet.
In Lunatic, gamevars (variables that are saved with savegames) are per-module.

git-svn-id: https://svn.eduke32.com/eduke32@3642 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:06 +00:00
helixhorned cbfd2eb438 In 'tip' display code, extrapolate four more values of the y coord table.
Also, for tip_incs values greater or equal than the number of elements in
this table, return early reporting that the hand has been drawn, so that
the otherwise selected weapon is not drawn.

git-svn-id: https://svn.eduke32.com/eduke32@3630 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:09 +00:00
helixhorned 85d6526264 Add some test CON files to source/lunatic/test.
The code is mostly by other people, who are credited in the CON files.

git-svn-id: https://svn.eduke32.com/eduke32@3627 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:26 +00:00
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
helixhorned efbc4cec90 Lunatic: actor usertypes from CON, set SFLAGs as 2nd gameactor() arg in Lua.
In passing, fix a couple of omissions: gameactor() being passed nil's in the
middle, more than one moveflag to CON *actor.

git-svn-id: https://svn.eduke32.com/eduke32@3597 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:28 +00:00
helixhorned d909173065 Lunatic t.: allow hex literals with >9 digits if the high ones are all 'F's.
(Or '0's, but that case is handled automatically.) The resulting generated
number is taken by looking at the 8 lower nibbles and interpreting them as
a signed 32-bit integer.
Also add some number parsing tests to test/nlcf_break.con.

git-svn-id: https://svn.eduke32.com/eduke32@3571 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:53 +00:00
helixhorned c7e90f2ed4 Lunatic translator: else if* -> elseif, fix codegen for "if {}".
The first transformation makes the "control structure too long" error appear
only with larger if/else cascades, though it's still possible.

git-svn-id: https://svn.eduke32.com/eduke32@3569 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:44 +00:00
helixhorned 56ea732ccd Lunatic translator: dynamic tile remapping.
Also, fix message when tiles get remapped in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3568 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:38 +00:00
helixhorned 4601b2d203 Add new LOGO_FLAGS bit 2048, preventing cutscene at E4 beginning if set.
git-svn-id: https://svn.eduke32.com/eduke32@3566 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:29 +00:00
helixhorned 90421f0e10 geom.lua: fix copy-paste bugs and clean up code. Remove __eq metamethod.
git-svn-id: https://svn.eduke32.com/eduke32@3565 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:24 +00:00
helixhorned c02199be48 Lunatic: g_tile access, rudimentary system gamearray support for the translator.
The only operation for which proper code is generated is reading a single value
from a system gamearray.

git-svn-id: https://svn.eduke32.com/eduke32@3562 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:11 +00:00
helixhorned ba0970cede Lunatic translator: dangling else for the 1000th time: not dangling any more.
Also update test/dangling_else.con. See there for how if* cascades are handled
in CON. It's actually kind of pretty. Also, take care to handle code deferred
to after the if/if-else properly (ifpdistl, ifpdistg, ifcanseetartet).

git-svn-id: https://svn.eduke32.com/eduke32@3534 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:12 +00:00
helixhorned 8955316bba Lunatic t.: {read,save}gamevar, fix break in nested while, fix rotatesprite16.
git-svn-id: https://svn.eduke32.com/eduke32@3533 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:15 +00:00
helixhorned 677c585b72 Lunatic translator: fix codegen for "break" inside while loops.
Note: usually, languages call this "continue". Jeez, CON...

git-svn-id: https://svn.eduke32.com/eduke32@3529 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:29:58 +00:00
helixhorned acddac64be Lunatic translator: nearing a workable state...
- some more outer commands
- gamearray persistence
- faster 'mod': use math.modf instead of math.fmod (the former is JIT-compiled)
- checkavail*
- THISACTOR special handling
- Fix building in Windows (export A_ShootWithZvel instead of A_Shoot).

git-svn-id: https://svn.eduke32.com/eduke32@3516 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:22 +00:00
helixhorned b0a8a381c8 Lunatic translator: eventloadactor.
git-svn-id: https://svn.eduke32.com/eduke32@3515 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:54:13 +00:00
helixhorned e6fd95dde8 Lunatic translator: qgetsysstr.
git-svn-id: https://svn.eduke32.com/eduke32@3512 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:57 +00:00
helixhorned db2c24b7ef Lunatic translator: fix quote commands, taking care of corner cases. Add test.
git-svn-id: https://svn.eduke32.com/eduke32@3511 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:49 +00:00
helixhorned d1442ac88e Lunatic translator: qsprintf.
git-svn-id: https://svn.eduke32.com/eduke32@3507 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:59 +00:00
helixhorned 3665fde85b Lunatic: more commands...
git-svn-id: https://svn.eduke32.com/eduke32@3491 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:24 +00:00
helixhorned 6cd3b9f4fc Lunatic: xmath module + timing test for distance functions.
git-svn-id: https://svn.eduke32.com/eduke32@3488 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:09 +00:00
helixhorned 35802d7e41 Lunatic: [gs]et{player,actor}var, access to protected projectile members.
git-svn-id: https://svn.eduke32.com/eduke32@3469 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:23:59 +00:00
helixhorned 90793f6a67 Lunatic: working tsprite methods, static members, struct array timing test.
git-svn-id: https://svn.eduke32.com/eduke32@3468 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:23:54 +00:00
helixhorned 7c861cac42 Rework how the z velocity is passed from *zshoot to A_Shoot().
Previously, actor[].shootzvel (implementation detail, not available to CON)
was checked, and if it was !=0, that was the overridden velocity. The value
0 meant "hardcoded, projectile-dependent velocity". But that neccesiated a
hack where if zvel 0 was passed and really meant, it needed to be set to
1 instead.  Now we have A_ShootWithZvel() taking an additional last argument
plus a macro SHOOT_HARDCODED_ZVEL permissible for that argument.

git-svn-id: https://svn.eduke32.com/eduke32@3465 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:12 +00:00
helixhorned b92edcc798 Lunatic: projectiles...
git-svn-id: https://svn.eduke32.com/eduke32@3463 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:03 +00:00
helixhorned 34c9bc8489 Lunatic: sync with preceding change, complete two commands.
git-svn-id: https://svn.eduke32.com/eduke32@3430 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:02:57 +00:00
helixhorned 56ef10c893 Lunatic translator: handle -mx.
git-svn-id: https://svn.eduke32.com/eduke32@3388 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:07 +00:00
helixhorned 8ed4667265 Lunatic: grabbag of different things.
- fix error handing with recursing events
- wallsofsect iterator, sector[]:contains()
- more codegen; mangle function names
- m32: compinside

git-svn-id: https://svn.eduke32.com/eduke32@3375 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:31 +00:00
helixhorned fa2ac57674 Lunatic: event chaining.
git-svn-id: https://svn.eduke32.com/eduke32@3320 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:45 +00:00
helixhorned 596b83aec1 Add a couple of test CONs: non-local control flow, rotation-fixed useractors.
git-svn-id: https://svn.eduke32.com/eduke32@3317 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:25 +00:00
helixhorned ed0e73c84a Lunatic: update structures, find maps case-insensitively in findmaps.sh.
git-svn-id: https://svn.eduke32.com/eduke32@3109 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:43 +00:00
helixhorned dd681886c3 Add lunatic/test/tables.lua, which was used to compare the calc'd sin/atan values.
git-svn-id: https://svn.eduke32.com/eduke32@2989 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:09:49 +00:00
helixhorned e9095c8470 Lunatic: rotatesprite+test, player access, misc.
git-svn-id: https://svn.eduke32.com/eduke32@2923 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:52:18 +00:00
helixhorned b983ec7b49 Lunatic: cleanup
git-svn-id: https://svn.eduke32.com/eduke32@2863 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:23 +00:00
helixhorned fdfcca557b Lunatic: add 'randgen' module, implementing an encapsulated JKISS PRNG.
Also fix error handling path in our_require(), i.e. when loadstring fails.

git-svn-id: https://svn.eduke32.com/eduke32@2857 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:28 +00:00
helixhorned 69365f2a0b Lunatic: add 'geom' module, sporting a vec2 type and a general 'intersect' func.
git-svn-id: https://svn.eduke32.com/eduke32@2855 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:21 +00:00
helixhorned f2789ab90f Lunatic translator: fix dangling else and add a test file, tweak warnings
git-svn-id: https://svn.eduke32.com/eduke32@2756 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:26 +00:00