weird #puts and stuff.

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

Moderators: Commodore, Zenith Nadir

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

weird #puts and stuff.

Post by Scribbit »

Does anyone know if you can make an object put a pushable object (or anything for that matter) directly under itself? I tried [#put i boulder] and [#put flow boulder] (on a stationary object) but it doesn't work. What I want here is a player-controlled object that can drop boxes and then move them around, and I figured it might be easier to just put it underneath and move off than to try to prompt the player for a direction to drop to.
I'm nupanick.
Seventh Shade
secret sauce
Posts: 129
Joined: Sun Feb 22, 2004 10:38 pm
Location: MO :(

Post by Seventh Shade »

Things can't be put under other things in zzt. You'll have to put it beside the robot generating it.
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. »

The file format allows for stuff to be under objects, but there's not a way to #put stuff under an object at runtime.

Of course, that doesn't mean you can't simulate box dropping:

Code: Select all

#end
:n
#lock
#try n stop
#if d put s boulder
#cstop
'
:s
#lock
#try s stop
#if d put n boulder
#cstop
'
:e
#lock
#try e stop
#if d put w boulder
#cstop
'
:w
#lock
#try w stop
#if d put e boulder
#cstop
'
:drop
#if not d set d
#end
'
'like #stop, except it #clears the drop flag first
:cstop
#clear d
'
'like #end, except it #unlocks the object first
:stop
#unlock
To move the object, you send it the messages :n, :s, :e, and :w, and to drop a boulder, you sent it :drop.
User avatar
Scribbit
is keeping the new avatar, thanks.
Posts: 543
Joined: Tue Sep 18, 2007 8:06 pm

Post by Scribbit »

Okay, I could try that. I've got the object taking commands from the player using a similar system, so I could just do that. It looks like you're setting a flag in the "dropping" command, then actually dropping the box when the object moves away. I'd have to add several lines to my movement code, but it would work. I could just also set a default direction for box dropping, but I want to make sure the player can use the box once it's been dropped, so I won't impose a direction like that, I don't think.
I'm nupanick.
Post Reply