dMZX Forums: ZZT-style explosions - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ZZT-style explosions

#1 User is offline   Baby Bonnie Hood 

  • Neatsome!
  • PipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 16-August 00
  • Gender:Male
  • Location:Philippines

Posted 09 January 2014 - 12:28 AM

Lachesis's review on Town of ZZT got me wondering. Can ZZT-style explosions be done in MZX now, with the instant radial multicolored breakaways that destroy anything shootable, hurt the player, and send "bombed" to robots?
Posted Image
0

#2 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 09 January 2014 - 12:47 AM

I dunno exactly what they are but I'm sure they can be done.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#3 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 09 January 2014 - 02:33 AM

Here:
become pushable
set "commands" to "(-1>>1)"
cycle 3

set "EXPLOSION_DAMAGE" to 10

set "A_BLOW_UP_(0x06)" to 1
set "A_BLOW_UP_(0x07)" to 1
set "A_BLOW_UP_(0x08)" to 1
set "A_BLOW_UP_(0x09)" to 1
set "A_BLOW_UP_(0x0A)" to 1
set "A_BLOW_UP_(0x12)" to 1
set "A_BLOW_UP_(0x13)" to 1
set "A_BLOW_UP_(0x1B)" to 1
set "A_BLOW_UP_(0x1C)" to 1
set "A_BLOW_UP_(0x1D)" to 1
set "A_BLOW_UP_(0x37)" to 1
set "A_BLOW_UP_(0x3D)" to 1
set "A_BLOW_UP_(0x4E)" to 1
set "A_BLOW_UP_(0x4F)" to 1
set "A_BLOW_UP_(0x50)" to 1
set "A_BLOW_UP_(0x52)" to 1
set "A_BLOW_UP_(0x54)" to 1
set "A_BLOW_UP_(0x57)" to 1
set "A_BLOW_UP_(0x58)" to 1
set "A_BLOW_UP_(0x59)" to 1
set "A_BLOW_UP_(0x5A)" to 1
set "A_BLOW_UP_(0x5B)" to 1
set "A_BLOW_UP_(0x5E)" to 1
set "A_BLOW_UP_(0x5F)" to 1

set "A_UNDER_(0x00)" to 1
set "A_UNDER_(0x0D)" to 1
set "A_UNDER_(0x0E)" to 1
set "A_UNDER_(0x0F)" to 1
set "A_UNDER_(0x10)" to 1
set "A_UNDER_(0x11)" to 1
set "A_UNDER_(0x12)" to 1
set "A_UNDER_(0x13)" to 1
set "A_UNDER_(0x14)" to 1
set "A_UNDER_(0x15)" to 1
set "A_UNDER_(0x16)" to 1
set "A_UNDER_(0x17)" to 1
set "A_UNDER_(0x18)" to 1
set "A_UNDER_(0x19)" to 1
set "A_UNDER_(0x1A)" to 1
set "A_UNDER_(0x22)" to 1
set "A_UNDER_(0x2B)" to 1
set "A_UNDER_(0x2C)" to 1
set "A_UNDER_(0x30)" to 1
set "A_UNDER_(0x3F)" to 1
set "A_UNDER_(0x43)" to 1
set "A_UNDER_(0x44)" to 1
set "A_UNDER_(0x45)" to 1
set "A_UNDER_(0x46)" to 1

set "A_EXPLODE_(0x24)" to 1
set "A_EXPLODE_(0x25)" to 1
set "A_EXPLODE_(0x3E)" to 1
set "A_EXPLODE_(0x51)" to 1
end
: "touch"
lockself
end play
play "tcf+cf+c"
char '9'
wait for 5
char '8'
play "z3c"
wait for 5
char '7'
play "z2g"
wait for 5
char '6'
play "z3c"
wait for 5
char '5'
play "z2g"
wait for 5
char '4'
play "z3c"
wait for 5
char '3'
play "z2g"
wait for 5
char '2'
play "z3c"
wait for 5
char '1'
play "z2g"
wait for 5
end play
play "s+++c-c-c-c-c-c"
char "(11)"
set "local5" to 0
goto "#pass"
wait for 1
set "local5" to 1
goto "#pass"
die
: "#pass"
loop start
set "local2" to "('loopcount'%15-7)"
set "local3" to "('loopcount'/15-4)"
if "('local3'*'local3'*2+('local2'*'local2'))" < 50 then "#bomb&local5&"
loop for "(15 * 9 - 1)"
goto "#return"
: "#bomb0"
inc "local2" by "thisx"
inc "local3" by "thisy"
if "(('local2'<0)o('local3'<0)o('local2'>='board_w')o('local3'>='board_h'))" = 1 then "#return"
goto "#hit('A_BLOW_UP_('bid&local2&,&local3&')')"
if "A_UNDER_('bid&local2&,&local3&')" = 1 then "#draw"
goto "#return"
: "#bomb1"
inc "local2" by "thisx"
inc "local3" by "thisy"
if "(('local2'<0)o('local3'<0)o('local2'>='board_w')o('local3'>='board_h'))" = 1 then "#return"
if c?? Breakaway p00 at "('local2')" "('local3')" then "#cleanup"
goto "#return"
: "#cleanup"
set "local11" to "uco('local2'),('local3')"
set "local12" to "upr('local2'),('local3')"
set "local13" to "uid('local2'),('local3')"
put "local11" Ricochet "local12" at "('local2')" "('local3')"
set "bid('local2'),('local3')" to "local13"
goto "#return"

: "#draw"
set "local4" to random 9 to 15
put "local4" Breakaway p00 at "local2" "local3"
goto "#return"

: "#hit1"
: "hit1"
goto "#cleanup"
goto "#return"
: "#hit0"
if "(('bid&local2&,&local3&'=0x53)a('bpr&local2&,&local3&'a0x80=0))" = 1 then "hit1"
if "(('bid&local2&,&local3&'=0x55)a('bpr&local2&,&local3&'a0x08=0))" = 1 then "hit1"
if "(('bid&local2&,&local3&'=0x56)a('bpr&local2&,&local3&'a0xE0=0))" = 1 then "hit1"

if "bid&local2&,&local3&" = "(0x56)" then "dragon_hurt"

if "A_EXPLODE_('bid&local2&,&local3&')" = 1 then "boom"
if c?? Mine p?? at "local2" "local3" then "boom_mine"
if c?? Robot p?? at "local2" "local3" then "hurtrobot"
if c?? PushableRobot p?? at "local2" "local3" then "hurtrobot"
if player at "local2" "local3" "hurtpl"
goto "#return"
: "dragon_hurt"
dec "bpr&local2&,&local3&" by "(0x20)"
goto "#return"
: "boom"
goto "#cleanup"
put c?? Explosion p40 at "local2" "local3"
goto "#return"
: "boom_mine"
set "local16" to "bpr('local2'),('local3')"
goto "#cleanup"
put c?? Explosion "('local16'a0xF0)" at "local2" "local3"
goto "#return"

: "hurtpl"
dec "health" by "EXPLOSION_DAMAGE"
sfx 21
goto "#return"
: "hurtrobot"
send at "local2" "local3" to "bombed"
goto "#return"


It's not perfect. It's a weird mishmash of ZZT and MZX explosion behaviour, but it looks generally right. It doesn't sound quite right- I just lifted the SFX used from Gemini's Town of ZZT, but the tick tock isn't quite percussive enough.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#4 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 09 January 2014 - 04:13 AM

I did something similar in 2006, although it's nowhere near as accurate as the one Lancer-X posted and used the overlay and only worked with robots. Town of ZZT could have at least faked it :<

edit: WARNING:this code is a bull s***

As far as the features in Lancer's implementation go, I think the board access counters are the only stuff that has been added since the port. With minor reworking his thing would probably work in at least the Exo DOS versions. You'd be cutting a lot of corners to get it into 2.51 though...

This post has been edited by Lachesis: 09 January 2014 - 04:23 AM

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#5 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 09 January 2014 - 06:06 AM

Here's a hilarious proof-of-concept I made in 2.51. It's quite far from perfect (and uses up most of the board's robot memory to boot) but it at least looks like a ZZT bomb! >.>

Also, uses 4 + (2 * number of exploding bombs currently in queue) counters. (I accidentally used LOCAL instead of LOOPCOUNT in one of the robots or it would use one less. oh well)

EDIT: uploaded a new one that's a little more comprehensive in the things it does and doesn't blow up, has some test stuff on the board, and uses a bit less robot memory (there's now ~25% available instead of ~11%). Same link... edit the green 'W' robot at the bottom to change the rules on what explodes and what doesn't :3

This post has been edited by Lachesis: 09 January 2014 - 07:13 AM

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#6 User is offline   Baby Bonnie Hood 

  • Neatsome!
  • PipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 16-August 00
  • Gender:Male
  • Location:Philippines

Posted 13 January 2014 - 09:39 AM

Lancer's code pretty much emulates it perfectly. Well, almost; the explosion only stays for a frame (in ZZT, it hangs around for a while before vanishing), and the bomb counts to 1 before exploding (ZZT bombs never reach 1 and instead explode after 2, something that always bugged me but I got used to it anyway).
Posted Image
0

#7 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 14 January 2014 - 02:03 AM

Cant remember who did this one? I've updated it a since.

It will send the label bombed to the area of explosion. It will also destroy breakaways/custom breakaways and kill gems/magic gems (I believe bombs used to kill gems in ZZT). Also if you remember in ZZT the appearing explosions were shoot-able because they were themselves randomly colored breakaways. This is also the case in this example.

- Might want to change the sound effects for Tick and Tock.
- Keep in mind too that these won't work against built-in enemies.

set "commands" to "(-1>>1)"
end
: "touch"
* "Bomb activated!"
play "tcf+cf+c"
zap "touch" 1
loop start
char "(57-'loopcount')"
play "z2c"
wait for 10
loop for 8
char ''
set "exp_rad0" to 7
set "exp_rad1" to 6
set "exp_rad2" to 6
set "exp_rad3" to 5
set "exp_rad4" to 4
set "local" to -4
: "exp_loop"
loop start
set "local2" to "('exp_rad('abs&local&')'-'loopcount')"
send at "('thisx'+'local2')" "('thisy'+'local')" to "bombed"
if player at "('thisx'+'local2')" "('thisy'+'local')" "#hurt_player"
if c?? Breakaway p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? Gem p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? MagicGem p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? CustomBreak p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? Space p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? Floor p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? Carpet p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? Fake p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"
if c?? CustomFloor p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#place_explosion"

: "continue"
loop for "('exp_rad('abs&local&')'*2)"
inc "local" by 1
if "local" <= 4 then "exp_loop"
wait for 3
set "local" to -4
: "clear_loop"
loop start
set "local2" to "('exp_rad('abs&local&')'-'loopcount')"
if c?? Breakaway p?? at "('thisx'+'local2')" "('thisy'+'local')" then "#clear_explosion"
loop for "('exp_rad('abs&local&')'*2)"
inc "local" by 1
if "local" <= 4 then "clear_loop"
play "t+++c-c-c-c-c-c"
die
: "#place_explosion"
set "local3" to random 4 to 15
put "local3" Breakaway p00 at "('thisx'+'local2')" "('thisy'+'local')"
goto "#return"
: "#clear_explosion"
put c07 Space p00 at "('thisx'+'local2')" "('thisy'+'local')"
goto "#return"
: "#hurt_player"
take 10 HEALTHS
goto "#return"

Attached File(s)


This post has been edited by T-Bone: 14 January 2014 - 02:23 AM

Youtube - teabone3 - Twitter - teabone3 - Twitch - teabone3
0

#8 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 14 January 2014 - 04:03 AM

Lancer-X wrote it back in 2006. Also, that take 10 HEALTHS should be changed to dec "HEALTH" 10.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users