which toolkit has keys & locks that are robots?

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

Moderators: Commodore, Zenith Nadir

520
What can be said now?
Posts: 0
Joined: Wed Dec 10, 2003 1:41 am

which toolkit has keys & locks that are robots?

Post by 520 »

hi again! which toolkit has keys & locks that are robots in disguise???
-smilymzx
User avatar
Zenith Nadir
this is my hammer
Posts: 2767
Joined: Wed Mar 12, 2003 11:40 am
Location: between the black and white spiders

Post by Zenith Nadir »

Transformers! Robots in disguise!
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
539
What can be said now?
Posts: 0
Joined: Thu Dec 25, 2003 8:15 pm

Post by 539 »

Was that supposed to be a joke, or did you really mean that? (the toolkit with the robot thing.)
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

@key
#end
:touch
#set key
#die

@door
#end
:touch
#if key #do
/i
Locked!
#end
:do
Unlocked!
#clear key
#die

Or some variation on that.
*POW* *CLANK* *PING*
User avatar
Dr. Dos
OH YES! USE VINE WHIP! <3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

Yeah, it was like Morekeys or something stupid like that.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
536
What can be said now?
Posts: 0
Joined: Wed Dec 24, 2003 6:30 pm

Post by 536 »

The Mystical Winds Encyclopedia had an object library of immitation robots. I don't remember if I made key/door immitations, but Commodore's code is about as close as you can get. Objects don't have any way of setting real keys, nor can they be "captured" by the player like ammo, torches, gems, etc., unless you do some freaky stuff that you probably don't want to do (which requires multiple objects).
Ryan Ferneau
LOOK OUT FER BAAAD BOB
Posts: 116
Joined: Fri Mar 28, 2003 12:51 am

Post by Ryan Ferneau »

You could make an object put out or turn into a key, though that's boring.
518
What can be said now?
Posts: 0
Joined: Tue Dec 09, 2003 2:04 am

Post by 518 »

If you're really bored, you could have a yellow object for yellow key code like so:

Code: Select all

@Yellow key
#cycle 1
:loop
#if contact do
#loop
:do
#go opp seek
#put seek yellow key 
#die
Hence, to give the illusion that a yellow key was there all along. Since this is practically pointless in itself, have a green key-like object make a yellow key.
536
What can be said now?
Posts: 0
Joined: Wed Dec 24, 2003 6:30 pm

Post by 536 »

"#become yellow key" would be better.
136
What can be said now?
Posts: 0
Joined: Thu Apr 03, 2003 2:10 am

Post by 136 »

I remember in 1 game I made on ZZT I made the program to atomaticly giv you the key in 1 secend. This is how, from west to est (all ar color dark red on dark red):

(1) Object:

Code: Select all

@secret
#end
:ok
#go e
(2) Key

(3) Fake

(4) Duplicator: Dir=W Speed=fast speed

(5) Extra Player No Stats

Put a red solid wall around all uv this.
Last edited by 136 on Sat Dec 27, 2003 5:20 pm, edited 1 time in total.
518
What can be said now?
Posts: 0
Joined: Tue Dec 09, 2003 2:04 am

Post by 518 »

Damnit, I always miss something ridiculously obvious.
536
What can be said now?
Posts: 0
Joined: Wed Dec 24, 2003 6:30 pm

Post by 536 »

For a similar engine to zzo38's, check out the Give Anything engine in the MW Encyclopedia.
518
What can be said now?
Posts: 0
Joined: Tue Dec 09, 2003 2:04 am

Post by 518 »

If you want a door that is a real door but displays a different message when you don't have the key, do the following:

Key

Code: Select all

@YellowKey
#cycle 1
:loop
#if contact do
#loop
:do
#if not key do2
You already have a key of this kind!
#loop
:do2
#set key
#become yellow key
Door

Code: Select all

@YellowDoor
#cycle 1
:loop
#if contact check
#loop
:check
#if key do2
You don't have a key! 
#loop
:do2
#clear key
#become yellow door
You can use whatever color of key or door you want.
536
What can be said now?
Posts: 0
Joined: Wed Dec 24, 2003 6:30 pm

Post by 536 »

There is a problem with that code. If the player already has a key and stands next to the key, you would see:

You already have a key of this kind!

You already have a key of this kind!

You already have a key of this kind!

etc. in a text box. Similar situation if you stand next to the door and don't have a key. You can fix this by adding "/i" before "#loop", but then the message at the bottom of the screen would rapidly refresh. I recommend adding another loop that it stay in as long as the player is in contact with the object before returning to the original loop. This would ensure that it doesn't display the message again until the player at least steps away and returns.

I wouldn't use real keys in conjunction with flags because that uses up both flag and key space. If you're doing something simple like that last example, I would just use real keys and door, but if you're doing something that absolutely requires them to be objects, I would probably use flags. One flag can easily represent three keys using a "piggy-back" technique. Basically, the following flags could represent "key 1" being set: key100, key101, key110, key111. Whereas flag 2 would be: key010, key011, key110, key111. Instead of just checking if "flag1" is set, check if one of the four are set. Setting the flag is a little more complicated, so here's a snippet:

Code: Select all

@key
#end
:touch
#if key100 havekey
#if key101 havekey
#if key110 havekey
#if key111 havekey
' The player doesn't have the key, so we're setting it
#if key000 k00
#if key001 k01
#if key010 k10
#if key011 k11
:k00
#clear key000
#set key100
#die
:k01
#clear key001
#set key101
#die
:k10
#clear key010
#set key110
#die
:k11
#clear key111
#set key111
#die
:havekey
You already have this key.
For doors, you would just switch the 'clear's and 'set's and switch the flag names in the two groups of 'if' commands.
User avatar
Dr. Dos
OH YES! USE VINE WHIP! <3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

Christ people IT'S FUCKING KEYS. WHO CARES?
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
Post Reply