Portal in ZZT,

Housing for low income families.

Moderators: nuero, Ando

User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

Portal in ZZT,

Post by Scribbit »

Hey, I was watching some videos on youtube of the game Portal (by Valve) and I was thinking about making a game like that in ZZT using player clones. But I can't get it to work, can someone help me figure out player clone-based transporters?
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

Player clones are covered fairly extensively in the ZZT Encyclopedia. (search "ZEOL")

Traditionally it goes like this:

Make an input object that can be touched by the player.

Input object tells a destination object to #put [dir] player.

The player teleports one block away from the clone when he moves.

Have the input object lock and check in a loop for contact with the player. when not in contact, tell the destination object to shoot the clone.

(all in cycle 1)

@input
#end
:touch
#lock
#destination:do
:loop
/i#if contact loop
#destination:fire
#unlock

@destination
#end
:do
#put n player
#end
:fire
#shoot n

making it so that the player could set entry and exit points would be tedious, though it probably could be done.
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 »

i like this idea and eagerly await an interpretation of Portal ZZT
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
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 »

If I knew of a way to get rid of arbitrarily placed player clones (#change player empty doesn't work) I could do it.

In fact, here are two different attempts.

The second is very finicky.

http://zzt.org/dr_dos/Portal.zzt

Image
Image
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
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 »

I think I have a solution for the second one. I'll try it later tonight.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

I screwed around with trying to kill the player clone, you can do it if you flash the area with stars with #change empty star (also provides a teleportation effect) but that limits the area you can have for game play to 150 squares minus the number of objects needed for the engine. Also you have to #endgame for health to restore a variable amount of damage the player can sustain.
*POW* *CLANK* *PING*
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 »

but what about fake walls, they'd give you some leeway on the empty to stat thing, surely?
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

I DID IT!!

Post by Scribbit »

I made portals that you can put anywhere. When you shoot them a box asks if you want yellow or blue, and if there is already one of that color it is deactivated. The only drawback is that you can only put portals on certain walls. I suppose I could put deactivated portals on every wall, but then I'd hit the object limit and have to make small testing rooms.

My solution: Several copies of a big object that uses #char, #zap, and #restore to become either a blue, yellow, or deactivated portal. I tried using #bind to change one object into another but that kept messing up, so I put all the code into one object. The #zap and #restore bits were tedious, and I used #char with a yellow-on-blue object to make color-changing work with one object. Getting rid of the player clone was as easy as shooting it (I got that bit from ZEOL). So at least each portal is a single object. I made a sample test world, but I don't think I fully captured the essence of GLAdOS.

Umm... How do I post the file?

EDIT: as of today (01/26/08) the file is in the unprocessed files bin.
Link: http://zzt.org/upload//portal ... pdated.zip

EDIT2: as of today (01/29/08) it's not there no more!
http://zzt.org/zgames/p/porta ... pdated.zip
*course, it won't be here, either, once v0.02 is added. Just read the thread.
Last edited by Scribbit on Tue Jan 29, 2008 1:34 pm, edited 2 times in total.
I'm nupanick.
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 »

http://zzt.org/?p=submithtml You can just zip it and put it in here.

Edit: Which you already did.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

Post by Scribbit »

Yeah, that was an interesting back-and forth. btw, did anyone else know that if you #bind to an object, then #zap or #restore labels in it, it changes all #bind-ed objects as well? I had been under the impression that it only binded to the existing code at the time of binding. For this reason my earlier idea to save space by binding all portals to a deactivated "root" portal didn't work.
I'm nupanick.
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 »

That's an annoying issue with ZZT. It just points the code.

An alternative method which may or may not work for your purposes is Binders Keepers

http://zzt.org/dr_dos/BindersK.zzt
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

Binders Keepers is cool! How did I miss that thread?
*POW* *CLANK* *PING*
User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

Interesting...

Post by Scribbit »

I never thought about that before. After looking at my code, do you think that would be too complicated? I tried #bind-ing like that first, before my massive all-in-one portals, but there were all sorts of weird issues, and my theory was that somehow #bind-ing one object made them all #bind, but that wouldn't explain it either... hmmm... maybe I should try that again. Thanks for the idea, if it was practical to put portal objects on every wall I could do much more with the gameplay, I bet! Incidentally, has anyone here tried my sample level? I'd like feedback on the level design.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

i like this, it has a lot of potential. shooting through the door like that made me feel like I was playing portal. i'd suggest centering and some mechanical decoration on the walls.
*POW* *CLANK* *PING*
User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

thx 4 teh f33db4k

Post by Scribbit »

Yeah, did you try "destroying vital testing apparatus" yet? Also, I'm trying to figure out how to make the weighted [companion] cube work. I have two ideas so far:
1. An inventory system; touch a cube to pick it up, shoot to drop it. The problem would be that you'd need to be able to get a copy of the cube object to the appropriate spot so you could move it more than once. It would stink if you could only drop the cube in certain spots.
2. Use boulders, push them like normal. I would then have to modify portals to detect if a cube was being pushed into them. This might shut a portal down because it would be blocked in all four directions and, by my current code, would do nothing if it was blocked in all directions. I considered #put-ing in all four directions and using #if any-- to find the cube, but boulders would just be pushed back by the #put, right?

Of course, I have just realized an alternate option is using a second object next to each portal whose only function is to transport the cubes, but that would make the game start to lose its Portally flavor. Any ideas?

Oh!!! I just got it! What do you think of this:

#change red boulder cyan fake
#put s solid
#put n solid
#put e solid
#put w solid
#if any cyan solid dosomething
#change cyan fake red boulder
#end
:dosomething

Code: Select all

#end

would this work? or is this a ZZT variant on SHS (Scrabble Hallucination Syndrome)?

I'll go try it, at any rate.

EDIT: Augh, I was partway through writing the code when I realized it would obliterate anything the other cubes were sitting on, like a fake I was using as a pressure plate. Maybe #if any yellow empty, or something like that...

EDIT: nope, I just tried it and that doesn't work either. Maybe I'll have to use a cube carrying object in every room.
I'm nupanick.
Post Reply