#alligned workaround?

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

Moderators: Commodore, Zenith Nadir

Post Reply
newbiejoe
newcomer
Posts: 2
Joined: Thu Dec 22, 2011 6:06 am

#alligned workaround?

Post by newbiejoe »

Hi there. I've been lurking for a bit and decided to sign up.. I used to zzt a long time ago, however i never released anything.. so I guess i am a newbie, hence the name. I'd started tinkering with zzt recently (for my own amusement mainly) and was wondering..

Is there any way to block the aligned command? has anyone figured that out? I've tried the "edge of board" blocks, as well as even the glitch block that the player skips over.. none of them seem to work.. I'm working on a maze, and some parts I need to check if the player is aligned with key places, but since it registers anywhere parallel to the player.. it kind of limits where he can really go without setting it off in the wrong spots.

eg. two corridors side by side. you walk down one, if you are detected there, something happens. if i use the #alligned command to do the detecting, then it goes off in both corridors. any ideas?

Thanks!
User avatar
Saxxon
the Gargoyle.
Posts: 608
Joined: Tue Jul 25, 2006 10:02 am
Contact:

Re: #alligned workaround?

Post by Saxxon »

ALLIGNED only checks if one of the player's coordinates matches the object's own. It doesn't take into account anything between the player and the object.

In order to selectively use ALLIGNED, you can use this method. It will only allow the check to pass in directions it is not blocked in immediately nearby.

Code: Select all

#Cycle 1
/i
#If Not Blocked Seek If Alligned Trigger
#Restart
:Trigger
..Something happens here..
That #IF is 40 characters long and the ZZT maximum is 42. That's about as far as you can take it, since more code would add a delay.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Re: #alligned workaround?

Post by Commodore »

if you have objects to spare you could use two sets of them to check for horizontal and vertical alignment.

Code: Select all

*aaa****
*      *
*   *  *
*   *  *
*   *  *
b...*  *
b...*  *
b...*  *
*   *  *
the player aligns with the "a" objects which then tells the "b" objects to do its check. There can be some latency with this method though, if you have only have one "b" the player might be able to dash through. In this case the "a" objects should be plotted to the screen first, so that they send their message to "b" before the player update.

Alternatively you could place invisible objects that check for contact and die after sending their message.

Code: Select all

@trigger
#cycle 1
:loop
#if not contact #loop
#send thing:dosomething
#send trigger:do    'multiple instances of @trigger are no longer needed
:do
#die
The player might pause when it tries to run through, but it shouldn't be too bad. The drawback is that it only goes once.
*POW* *CLANK* *PING*
newbiejoe
newcomer
Posts: 2
Joined: Thu Dec 22, 2011 6:06 am

Re: #alligned workaround?

Post by newbiejoe »

sounds good like ill be able to use that. the idea was to have fire come out of walls. one obj moves and places various walls red and yellow out as it moves. while they do that, objects see if the player is alligned/next to the flames and it takes health from the player. the obj that placed the textures puts empties where it had placed them and stops the sensors. meanwhile 2 board objects cycle walls for that simulated fire effect.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Re: #alligned workaround?

Post by Commodore »

sounds like other than that little hiccup you know what you're doing.
*POW* *CLANK* *PING*
Post Reply