ZZT-OOP questions
ZZT-OOP questions
I've picked up a project from a good decade ago to work on again, and I'm running into a silly little ZZT-OOP issue. I'm sure it's an oversight on my part, but basically I have monsters that I've programmed to take, say, 5 health on contact, 20 health for the harder hitters. However, when the player's health falls below these numbers, the monster will not kill them. It'll hit them over and over again with no effect. Is there any way to remedy this?
Last edited by madhair60 on Mon Sep 08, 2014 8:43 am, edited 2 times in total.
Re: ZZT-OOP death-related question
It could be you are taking too much.
Something like #take 20 health won't take health if the player only has 10
use this instead:
#take health 20 #endgame
Something like #take 20 health won't take health if the player only has 10
use this instead:
#take health 20 #endgame
*POW* *CLANK* *PING*
Re: ZZT-OOP death-related question
Brilliant, thanks.
I actually found a method -
#take health 20 kill
#end
:kill
You cannot withstand another blow.
You have died.
#endgame
#end
It checks if there is 20 health to take and if not, it skips to the "kill" command.
I actually found a method -
#take health 20 kill
#end
:kill
You cannot withstand another blow.
You have died.
#endgame
#end
It checks if there is 20 health to take and if not, it skips to the "kill" command.
Re: ZZT-OOP death-related question
Oh no - neither ZZT nor Kevedit are loading my game for editing or playing anymore. It just causes an instant crash to desktop. DreamZZT says "cannot load".
Edit: I think I must have gone over 20k on a board and now my game won't load at all. Is it lost forever? :(
Edit 2: Ah, ZZTAE sheds light on things. I've gone over the 20k. Fixing now.
Edit 3: Gaaah, even getting it to 17k won't make it load in ZZT or Kevedit.
Edit 4 (Four!): OK, the problem is my title screen - it's corrupt and won't load even in ZZTAE. Anyone know a fix? I guess I could just export all the boards except that one.
Edit 5: Or not, 'cos ZZTAE doesn't seem to let you export boards. (!?!?)
Edit 6: Aaaaand FIXED! Turns out ZZTAE does have that function, it's just not "advertised". Hooray! My game lives!
Edit: I think I must have gone over 20k on a board and now my game won't load at all. Is it lost forever? :(
Edit 2: Ah, ZZTAE sheds light on things. I've gone over the 20k. Fixing now.
Edit 3: Gaaah, even getting it to 17k won't make it load in ZZT or Kevedit.
Edit 4 (Four!): OK, the problem is my title screen - it's corrupt and won't load even in ZZTAE. Anyone know a fix? I guess I could just export all the boards except that one.
Edit 5: Or not, 'cos ZZTAE doesn't seem to let you export boards. (!?!?)
Edit 6: Aaaaand FIXED! Turns out ZZTAE does have that function, it's just not "advertised". Hooray! My game lives!
Re: ZZT-OOP death-related question (Please help!)
Okay! One more question.
Is it possible to make every instance of an object on screen #die with one command?
Is it possible to make every instance of an object on screen #die with one command?
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: ZZT-OOP death-related question
Hi madhair. Reviving an old game idea is best cause it ends up being chock full of nostalgia.
Forum tips: No need to update us on every edit unless someone replies or it's pertinent. Don't worry though, I fumble that up sometimes. :) If you change the name of this thread (by editing the first post's subject line) to something generic like ZZT-OOP questions, that will give you free reign and keep our forum tidy.
#all:death
@objects
#end
:death
#die
Forum tips: No need to update us on every edit unless someone replies or it's pertinent. Don't worry though, I fumble that up sometimes. :) If you change the name of this thread (by editing the first post's subject line) to something generic like ZZT-OOP questions, that will give you free reign and keep our forum tidy.
I recommend strictly using KevEdit for editing and ZZT for testing to avoid corruption.madhair60 wrote:neither ZZT nor Kevedit are loading my game for editing or playing anymore.
@objectamadhair60 wrote: Is it possible to make every instance of an object on screen #die with one command?
#all:death
@objects
#end
:death
#die
Re: ZZT-OOP death-related question (Please help!)
Some useful tips involve using kevedit to set the cycle instead of using #cycle 1. Also your problem sounds a little like you renamed the zzt file in windows instead of saving a new world. This breaks files.
Some code thinning techniques:
create labels with as few letters as possible.
if an object uses a lot of #end commands (or restart commands) instead create a 1 letter label
Even kevedit can break your world. Save multiple copies. I usually uses three different files, often I save the working files as 1world.zzt, 11world.zzt to make the names float to the top of the list.
Not sure why a 17k board broke your world. Maybe there is a smaller restriction on title screens.
Some code thinning techniques:
create labels with as few letters as possible.
if an object uses a lot of #end commands (or restart commands) instead create a 1 letter label
Code: Select all
@object
:r
;a bunch of code
:e
#end
Not sure why a 17k board broke your world. Maybe there is a smaller restriction on title screens.
*POW* *CLANK* *PING*
- bitbot
- Official Clamp School Defender
- Posts: 328
- Joined: Thu Mar 01, 2012 3:00 am
- Location: earthbound
- Contact:
Re: ZZT-OOP death-related question (Please help!)
Nice approach. I used to backup like a maniac before KevEdit earned my trust, but sure enough a file got corrupted just the other day. Three copies sounds about right.. two current and one legacy.Commodore wrote: Even kevedit can break your world. Save multiple copies. I usually uses three different files, often I save the working files as 1world.zzt, 11world.zzt to make the names float to the top of the list.
Re: ZZT-OOP questions
Yeah, sorry about the flurry of edits; that was "the process", me figuring out a fix, trying everything. Tidied it up; cheers.
Thanks for all the advice. I found a really rudimentary way to do the "clear all objects" thing, but now I have a better one. :)
Thanks for all the advice. I found a really rudimentary way to do the "clear all objects" thing, but now I have a better one. :)
The board was originally well over 20k. I had a load of spider-web objects, all of which recycled the same code instead of using #bind. I'm very rusty after a long while without using the program.Commodore wrote:Not sure why a 17k board broke your world. Maybe there is a smaller restriction on title screens.
Re: ZZT-OOP questions
You could also use #change object empty, but not if you want some of the objects to survive!
*POW* *CLANK* *PING*