z2

I agree. Take me to the spicy page.
It is currently Mon Dec 18, 2017 12:31 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: ZZT-OOP questions
PostPosted: Sun Sep 07, 2014 12:58 pm 
Offline
newcomer
User avatar

Joined: Sun Sep 07, 2014 12:55 pm
Posts: 5
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.

Top
 Profile  
 
PostPosted: Sun Sep 07, 2014 1:42 pm 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
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

_________________
*POW* *CLANK* *PING*


Top
 Profile  
 
PostPosted: Sun Sep 07, 2014 6:23 pm 
Offline
newcomer
User avatar

Joined: Sun Sep 07, 2014 12:55 pm
Posts: 5
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.


Top
 Profile  
 
PostPosted: Sun Sep 07, 2014 7:47 pm 
Offline
newcomer
User avatar

Joined: Sun Sep 07, 2014 12:55 pm
Posts: 5
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!


Top
 Profile  
 
PostPosted: Sun Sep 07, 2014 9:52 pm 
Offline
newcomer
User avatar

Joined: Sun Sep 07, 2014 12:55 pm
Posts: 5
Okay! One more question.

Is it possible to make every instance of an object on screen #die with one command?


Top
 Profile  
 
PostPosted: Sun Sep 07, 2014 11:15 pm 
Offline
Official Clamp School Defender
User avatar

Joined: Thu Mar 01, 2012 3:00 am
Posts: 328
Location: earthbound
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.

madhair60 wrote:
neither ZZT nor Kevedit are loading my game for editing or playing anymore.

I recommend strictly using KevEdit for editing and ZZT for testing to avoid corruption.

madhair60 wrote:
Is it possible to make every instance of an object on screen #die with one command?

@objecta
#all:death

@objects
#end
:death
#die

_________________
Image Image


Top
 Profile  
 
PostPosted: Mon Sep 08, 2014 2:48 am 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
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

Code:
@object
:r

;a bunch of code

:e
#end


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.

_________________
*POW* *CLANK* *PING*


Top
 Profile  
 
PostPosted: Mon Sep 08, 2014 3:09 am 
Offline
Official Clamp School Defender
User avatar

Joined: Thu Mar 01, 2012 3:00 am
Posts: 328
Location: earthbound
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.

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.

_________________
Image Image


Top
 Profile  
 
 Post subject: Re: ZZT-OOP questions
PostPosted: Mon Sep 08, 2014 8:47 am 
Offline
newcomer
User avatar

Joined: Sun Sep 07, 2014 12:55 pm
Posts: 5
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. :)

Commodore wrote:
Not sure why a 17k board broke your world. Maybe there is a smaller restriction on title screens.


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.


Top
 Profile  
 
 Post subject: Re: ZZT-OOP questions
PostPosted: Mon Sep 08, 2014 2:56 pm 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
You could also use #change object empty, but not if you want some of the objects to survive!

_________________
*POW* *CLANK* *PING*


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group