Mapster32: RESPAWN-preview coded in M32-script.

The m32script variable 'showrespawn_always' toggles whether the respawned picnum
is shown unconditionally instead of only when aimed at (and locked onto the
RESPAWN sprite) in 3D mode.
Cool idea by Micky C.
NOTE: sometimes doesn't work because of a bug in the m32script interpreter.

git-svn-id: https://svn.eduke32.com/eduke32@3447 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-02-01 13:05:05 +00:00
parent 9230ec7ba7
commit 294f97a004
2 changed files with 47 additions and 3 deletions

View file

@ -34,6 +34,10 @@ gamevar dayx 65536 0
// (notebook/netbook convenience, see EVENT_KEYPRESS for details)
gamevar use_notebook_keys 0 0
// Whether RESPAWN sprites show the respawned sprite picnum unconditionally instead of
// only when aimed at (and locked onto) the RESPAWN sprite in 3D mode.
gamevar showrespawn_always 0 0
// see end of file for more user settings and examples
////////// END USER SETTINGS //////////
@ -1033,7 +1037,45 @@ defstate tduplin
}
ends
defstate respawnpreview
var ts ow pic z
var k onumtspr
ife showrespawn_always 0
{
ifaimingsprite ife sprite[searchwall].picnum RESPAWN nullop
else break
}
set onumtspr spritesortcnt
for ts range onumtspr
{
set ow tsprite[ts].owner
ife showrespawn_always 0 ifn ow searchwall nullop else
{
ife sprite[ow].picnum RESPAWN
{
set k spritesortcnt
tdupsprite ow
// XXX: doesn't work with E1L5 boss RESPAWN...
// Something's wrong with setting tsprite[] members.
sub tsprite[k].z 4096
set tsprite[k].xrepeat 16
set tsprite[k].yrepeat 16
set pic sprite[ow].hitag
ifge pic 0 ifl pic MAXTILES
set tsprite[k].picnum pic
}
}
}
ends
onevent EVENT_ANALYZESPRITES
state respawnpreview
state tduprot
state tduplin
endevent
@ -1409,7 +1451,7 @@ onevent EVENT_DRAW3DSCREEN
printext256 TQUOTE 30 30 -15 0 0
qsprintf TQUOTE "y panning = %d" wall[searchwall].ypanning
printext256 TQUOTE 30 30 -15 0 0
printext256 TQUOTE 30 40 -15 0 0
}
endevent
*/

View file

@ -387,7 +387,7 @@ readonly:
// how: bitfield: 1=set? 2=vars? 4=use spriteext[].tspr? (otherwise use tsprite[])
static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t lLabelID, int32_t lVar2)
{
int32_t lValue, lightp = (lLabelID >= LIGHT_X);
int32_t lightp = (lLabelID >= LIGHT_X);
int32_t i = (how&ACCESS_USEVARS) ? vm.g_i : lVar1;
spritetype *datspr = NULL;
const memberlabel_t *dalabel = lightp ? &LightLabels[lLabelID-LIGHT_X] : SpriteLabels;
@ -446,7 +446,7 @@ static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t l
if (how&ACCESS_SET)
{
int32_t damin, damax;
int32_t lValue, damin, damax;
if (!m32_script_expertmode && (dalabel->flags & 1))
goto readonly;
@ -520,6 +520,8 @@ static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t l
}
else
{
int32_t lValue;
switch (lLabelID)
{
case SPRITE_X: lValue=datspr->x; break;