2009-09-12 23:13:02 +00:00
|
|
|
// m32 script test & show-off file
|
|
|
|
// do "include a" in the console
|
|
|
|
|
|
|
|
include names.h
|
|
|
|
|
|
|
|
gamevar i 0 1 // per-block (top-level, event, or state) variable
|
|
|
|
gamevar j 0 1
|
2009-09-17 22:08:37 +00:00
|
|
|
gamevar k 0 1
|
|
|
|
gamevar l 0 1
|
|
|
|
|
|
|
|
gamevar tmp 0 0
|
2009-09-12 23:13:02 +00:00
|
|
|
|
|
|
|
gamevar davr 65536 0
|
|
|
|
gamevar dayx 65536 0
|
|
|
|
|
2009-09-17 22:08:37 +00:00
|
|
|
gamevar drawcol 9 0
|
|
|
|
|
2009-09-16 22:24:24 +00:00
|
|
|
define TQUOTE 3
|
|
|
|
|
2009-09-12 23:13:02 +00:00
|
|
|
definequote 0 OK
|
|
|
|
definequote 1 DAMN
|
|
|
|
|
2009-09-16 22:24:24 +00:00
|
|
|
definequote 2 BU:%d ABS:%d
|
|
|
|
definequote TQUOTE write on me!
|
|
|
|
|
|
|
|
definequote 4 ASPECT: VR=%d, YX=%d
|
|
|
|
definequote 5 KEY:%d
|
|
|
|
|
2009-09-17 22:08:37 +00:00
|
|
|
definequote 6 time: %d ms
|
|
|
|
definequote 7 SPRITES:
|
|
|
|
|
2009-09-12 23:13:02 +00:00
|
|
|
gamearray ar 128
|
|
|
|
gamearray parm 8
|
|
|
|
|
|
|
|
defstate artest
|
2009-09-17 22:08:37 +00:00
|
|
|
getarraysize ar tmp
|
|
|
|
resizearray ar 65536
|
|
|
|
getticks parm[2]
|
|
|
|
for j range 65536
|
2009-09-12 23:13:02 +00:00
|
|
|
set ar[j] j
|
|
|
|
set i 0
|
2009-09-17 22:08:37 +00:00
|
|
|
for j range 65536
|
2009-09-12 23:13:02 +00:00
|
|
|
add i ar[j]
|
2009-09-17 22:08:37 +00:00
|
|
|
getticks parm[3]
|
|
|
|
resizearray ar tmp
|
|
|
|
ife i 2147450880 quote 0 else quote 1
|
|
|
|
sub parm[3] parm[2]
|
|
|
|
qsprintf TQUOTE 6 parm[3]
|
|
|
|
quote TQUOTE
|
2009-09-12 23:13:02 +00:00
|
|
|
ends
|
|
|
|
|
|
|
|
defstate setas
|
|
|
|
set j dayx
|
|
|
|
mul j ydim mul j 8
|
|
|
|
div j xdim div j 5
|
|
|
|
setaspect davr j
|
|
|
|
ends
|
|
|
|
|
2009-09-17 22:08:37 +00:00
|
|
|
onevent EVENT_ENTER3DMODE
|
|
|
|
state setas
|
|
|
|
endevent
|
|
|
|
|
2009-09-12 23:13:02 +00:00
|
|
|
onevent EVENT_ANALYZESPRITES
|
2009-09-17 22:08:37 +00:00
|
|
|
|
|
|
|
for i drawnsprites
|
|
|
|
{
|
|
|
|
switch tsprite[i].picnum
|
|
|
|
case LIZTROOP spritepal 1 break
|
|
|
|
case PIGCOP spritepal 2 break
|
|
|
|
case BOSS1 spritepal 6 break
|
|
|
|
endswitch
|
|
|
|
}
|
|
|
|
/*
|
2009-09-12 23:13:02 +00:00
|
|
|
for i drawnsprites
|
2009-09-17 22:08:37 +00:00
|
|
|
{
|
|
|
|
ife tsprite[i].picnum LIZTROOP spritepal 1 else
|
|
|
|
ife tsprite[i].picnum PIGCOP spritepal 2 else
|
|
|
|
ife tsprite[i].picnum BOSS1 spritepal 6
|
|
|
|
}
|
|
|
|
*/
|
2009-09-12 23:13:02 +00:00
|
|
|
endevent
|
|
|
|
|
2009-09-17 22:08:37 +00:00
|
|
|
defstate cmp_by_lotag
|
|
|
|
set RETURN sprite[SV2].lotag
|
|
|
|
sub RETURN sprite[SV1].lotag
|
|
|
|
ends
|
2009-09-12 23:13:02 +00:00
|
|
|
|
2009-09-16 22:24:24 +00:00
|
|
|
onevent EVENT_DRAW2DSCREEN
|
2009-09-17 22:08:37 +00:00
|
|
|
ifl cursectnum 0 return
|
|
|
|
|
|
|
|
getarraysize ar tmp
|
|
|
|
set j 0
|
|
|
|
for i spritesofsector cursectnum
|
|
|
|
{
|
|
|
|
ifge j tmp nullop else
|
|
|
|
ifactor LOCATORS
|
|
|
|
{
|
|
|
|
set ar[j] i
|
|
|
|
add j 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set tmp j
|
|
|
|
sort ar tmp cmp_by_lotag
|
|
|
|
|
|
|
|
sub tmp 1
|
|
|
|
for i range tmp
|
|
|
|
{
|
|
|
|
set j ar[i]
|
|
|
|
set k i, add k 1, set k ar[k]
|
|
|
|
drawline16b sprite[j].x sprite[j].y sprite[k].x sprite[k].y drawcol
|
|
|
|
}
|
|
|
|
/*
|
2009-09-16 22:24:24 +00:00
|
|
|
set drawlinepat -1
|
|
|
|
for i allsprites
|
|
|
|
ifactor LIZTROOP
|
|
|
|
drawcircle16b sprite[i].x sprite[i].y 256 9
|
2009-09-17 22:08:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
set i totalclock
|
|
|
|
shiftr i 6
|
|
|
|
drawcircle16b posx posy 256 i
|
|
|
|
set j i
|
|
|
|
add j 8
|
|
|
|
drawcircle16 halfxdim16 midydim16 12 j
|
|
|
|
qsprintf 3 2 i j
|
|
|
|
printmessage16 3
|
|
|
|
*/
|
2009-09-16 22:24:24 +00:00
|
|
|
endevent
|
|
|
|
|
|
|
|
onevent EVENT_OVERHEADEDITOR
|
|
|
|
for i range 27
|
|
|
|
{
|
2009-09-17 22:08:37 +00:00
|
|
|
ifholdkey alphakeys[i]
|
2009-09-16 22:24:24 +00:00
|
|
|
{
|
|
|
|
qsprintf TQUOTE 5 i
|
|
|
|
quote TQUOTE
|
|
|
|
}
|
|
|
|
}
|
2009-09-17 22:08:37 +00:00
|
|
|
|
2009-09-16 22:24:24 +00:00
|
|
|
for i range 10
|
|
|
|
{
|
2009-09-17 22:08:37 +00:00
|
|
|
ifholdkey numberkeys[i]
|
2009-09-16 22:24:24 +00:00
|
|
|
{
|
|
|
|
qsprintf TQUOTE 5 i
|
|
|
|
quote TQUOTE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
endevent
|
|
|
|
|
|
|
|
onevent EVENT_KEYS3D
|
|
|
|
for i range 10
|
|
|
|
// ife 0 1
|
|
|
|
{
|
2009-09-17 22:08:37 +00:00
|
|
|
ifholdkey numberkeys[i]
|
2009-09-16 22:24:24 +00:00
|
|
|
{
|
|
|
|
qsprintf TQUOTE 5 i
|
|
|
|
quote TQUOTE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-17 22:08:37 +00:00
|
|
|
ifhitkey KEY_SPACE
|
|
|
|
{
|
|
|
|
ifn searchstat 3 break
|
|
|
|
ifn sprite[searchwall].picnum SECTOREFFECTOR break
|
|
|
|
set tmp 0
|
|
|
|
ife sprite[searchwall].lotag 7 set tmp 1
|
|
|
|
ife sprite[searchwall].lotag 17 set tmp 1
|
|
|
|
ife tmp 0 break
|
|
|
|
|
|
|
|
for i allsprites
|
|
|
|
{
|
|
|
|
ifn i searchwall, ifactor SECTOREFFECTOR, ife sprite[i].lotag sprite[searchwall].lotag
|
|
|
|
ife sprite[i].hitag sprite[searchwall].hitag
|
|
|
|
{
|
|
|
|
add posx sprite[i].x, sub posx sprite[searchwall].x
|
|
|
|
add posy sprite[i].y, sub posy sprite[searchwall].y
|
|
|
|
add posz sprite[i].z, sub posz sprite[searchwall].z
|
|
|
|
|
|
|
|
updatecursectnum
|
|
|
|
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ifholdkey KEY_0
|
2009-09-16 22:24:24 +00:00
|
|
|
// ife 0 1
|
|
|
|
{
|
|
|
|
ifeithershift sub davr 512 else add davr 512
|
|
|
|
ifl davr 32768 set davr 32768
|
|
|
|
ifg davr 256000 set davr 256000
|
|
|
|
setaspect davr yxaspect
|
|
|
|
qsprintf TQUOTE 4 davr yxaspect
|
|
|
|
quote TQUOTE
|
|
|
|
}
|
|
|
|
endevent
|
|
|
|
|
2009-09-12 23:13:02 +00:00
|
|
|
defstate itertest
|
|
|
|
for i spritesofsector searchsector
|
|
|
|
// ife sprite[i].picnum AMMO set sprite[i].picnum BATTERYAMMO
|
|
|
|
ifactor parm[0] cactor parm[1]
|
|
|
|
ends
|