diff --git a/polymer/eduke32/source/lunatic/doc/lunatic.txt b/polymer/eduke32/source/lunatic/doc/lunatic.txt index 0e85211c7..5f1caa0e7 100644 --- a/polymer/eduke32/source/lunatic/doc/lunatic.txt +++ b/polymer/eduke32/source/lunatic/doc/lunatic.txt @@ -566,10 +566,12 @@ spr.cstat = CS.TRANS1 + CS.BLOCK ---------- one could proceed as follows for the sake of example: -* `spr.cstatbits:set(CS.TRANS2)`, make the sprite 66% translucent now -* `spr.cstatbits:flip(CS.BLOCK + CS.HITSCAN)`, make it hitscan-sensitive but - not blocking -* `spr.cstatbits:test(CS.FLIP_BITMASK)`, check whether it is flipped (no) +[source] +---------- +spr.cstatbits:set(CS.TRANS2) -- make the sprite 66% translucent now +spr.cstatbits:flip(CS.BLOCK + CS.HITSCAN) -- make it hitscan-sensitive and non-blocking +local isflipped = spr.cstatbits:test(CS.FLIP_BITMASK) -- is it x- or y-flipped? (no) +---------- ========== Engine-side composites diff --git a/polymer/eduke32/source/lunatic/test.lua b/polymer/eduke32/source/lunatic/test.lua index 338bd6edb..78e4fa789 100644 --- a/polymer/eduke32/source/lunatic/test.lua +++ b/polymer/eduke32/source/lunatic/test.lua @@ -18,6 +18,8 @@ local hitscan = hitscan local assert, error, print, tostring = assert, error, print, tostring +local D = require("CON.DEFS") + print('---=== ELua Test script ===---') local function printf(fmt, ...) @@ -108,6 +110,24 @@ gameevent end } +gameevent +{ + "JUMP", + + function() + print("tweaking forcefield with lotag 34 (E2L1)") + + for w=0,gv.numwalls-1 do + local wal = wall[w] + if (wal.overpicnum == D.W_FORCEFIELD or wal.overpicnum == D.W_FORCEFIELD+1) then + if (wal.lotag==34) then + wal.cstat = wal.cstatbits:test(85) and 0 or 85 + end + end + end + end +} + local unsafe = pcall(function() string.UNSAFE=true; end) checkfail("tostring = nil", "attempt to write into the global environment") @@ -252,7 +272,6 @@ gameevent } --]] -local D = require("CON.DEFS") local WEAPON = gv.WEAPON -- Bad hack to test out pitch/roll: EVENT_GAME is discouraged from Lunatic.