Programming Question

NOTE: I HATE A LOT OF YOUR ZZT GAMES, SO WATCH OUT!

Moderators: Commodore, Zenith Nadir

Post Reply
MJaredSwenson
newcomer
Posts: 5
Joined: Sun Jan 06, 2008 4:16 am
Location: Idaho, USA

Programming Question

Post by MJaredSwenson »

Im new to the community, but I played ZZT a long time ago. When one day i was reminiscing about my roots, i remembered this fine game and google'd it to see what would come up. Then you guys came up. Im happy to have found you all.

So i then downloaded it and my favorite games of old, and even went as far as to perform a restoration on an old PC of mine to get some of my projects i was working on in the past to resurrect them.

To cut to the chase: I have a programming question. I remember there was a way to get an object to explode, where it places fakes and whatnot around itself, but it wouldnt place one if it was blocked in that direction.

I played around with the #if blocked direction commands, but cant seem to remember how it was done.
M. Jared Swenson
Productions
User avatar
Jotz
rank bank jotz
Posts: 120
Joined: Thu Oct 16, 2003 2:59 am
Contact:

Post by Jotz »

#if not blocked n #put n red fake
#if not blocked s #put s red fake
#if not blocked e #put e red fake
#if not blocked w #put w red fake
MJaredSwenson
newcomer
Posts: 5
Joined: Sun Jan 06, 2008 4:16 am
Location: Idaho, USA

Post by MJaredSwenson »

Perfect!

Thats what i was looking for. Thankyou Jotz

Howabout another question:

Is there a way for me to build selection menu's based on what flags are set?

For example, in an object i can put up selections (using the ! commands), but it will only display the selections if a player has the flag. Such as the potential is to put up selections for FlagA FlagB and FlagC, and the player only has FlagA and FlagC, so it only displays the selections corresponding to flags A and C.

Am i making any sense here? lol
M. Jared Swenson
Productions
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Post by Quantum P. »

That's possible:

Code: Select all

#end
:touch
It's a control panel of some sort.
#if hammer !h;Smash it with your hammer
#if screwdriver !s;Unscrew the front panel
#if code !c;Enter self-destruct code
#end
:h
You put a small dent in the panel. Nothing
happens.
#end
:s
The panel is held down by Phillips head
screws, and they're in tight. No go.
#end
:c
SYSTEM WILL SELF-DESTRUCT IN T-60 SECONDS
You can put just about anything after an #if, even another if statement.

Also, welcome! Don't know if you've seen it yet, but we've got a ZZT wiki that might be worth a look.
MJaredSwenson
newcomer
Posts: 5
Joined: Sun Jan 06, 2008 4:16 am
Location: Idaho, USA

Post by MJaredSwenson »

Thankyou, Quantum P. That will do perfectly.

I didnt know about that wiki, so ill check it out.

Again, i appreciate the help.
M. Jared Swenson
Productions
MJaredSwenson
newcomer
Posts: 5
Joined: Sun Jan 06, 2008 4:16 am
Location: Idaho, USA

Post by MJaredSwenson »

Im going to go ahead and keep any ZZT-OOP question i have to this thread, so as to not continue flooding your boards.

I noticed the rndns direction and a rndne. What's weird is the rndne. You would think it would be a rndew. Can we do a random east/west? Why is it north/east? Just sort of confusing.
M. Jared Swenson
Productions
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

put clockwise before random ns

?cw rndns
Post Reply