ZZT Guy's ZZT Questions

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

Moderators: Commodore, Zenith Nadir

User avatar
ZZT Guy
enjoys muffins
Posts: 73
Joined: Wed Sep 27, 2006 6:17 pm
Location: Town Of ZZT

ZZT Guy's ZZT Questions

Post by ZZT Guy »

Im an extreme ZZT noob but...
How do i get it so that when I
touch a character it says its message?
when i make a message object, and go
into the room its in, it says its text as soon as i move one space!
Last edited by ZZT Guy on Wed Sep 27, 2006 6:39 pm, edited 1 time in total.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

You need to stop it. So use #end then you need to start it when you :touch it.

@person
#end
:touch
Hello!
*POW* *CLANK* *PING*
User avatar
ZZT Guy
enjoys muffins
Posts: 73
Joined: Wed Sep 27, 2006 6:17 pm
Location: Town Of ZZT

Post by ZZT Guy »

Commodore wrote:You need to stop it. So use #end then you need to start it when you :touch it.

@person
#end
:touch
Hello!
THANK YOU!
EDIT: Alright, now i want the Object to move to the
West after giving out the message, how do i do that?
User avatar
Schroedingers Cat
We must invent teleportation!
Posts: 721
Joined: Mon Jun 19, 2006 11:35 pm
Location: Idaho, Wisconsin

Post by Schroedingers Cat »

Code: Select all

@person
#cycle 1
#end

'this is a comment.
'ZZT ignores all comments.
'comments begin with a '.
'they don't end until the next line.
'comments are used to help the programmer.
'they have no bearing on gameplay.

:touch
Hello!
/w 'tells the object to go one square west, regardless of whether or
'not the space is blocked. The object will keep trying until it suceeds.
'alternativly, you could use "?w", which tells the object to try to go west,
'but if it can't, no biggie.
#end
User avatar
ZZT Guy
enjoys muffins
Posts: 73
Joined: Wed Sep 27, 2006 6:17 pm
Location: Town Of ZZT

Post by ZZT Guy »

Schrödinger's Cat wrote:

Code: Select all

@person
#cycle 1
#end

'this is a comment.
'ZZT ignores all comments.
'comments begin with a '.
'they don't end until the next line.
'comments are used to help the programmer.
'they have no bearing on gameplay.

:touch
Hello!
/w 'tells the object to go one square west, regardless of whether or
'not the space is blocked. The object will keep trying until it suceeds.
'alternativly, you could use "?w", which tells the object to try to go west,
'but if it can't, no biggie.
#end
Thanks
EDIT:Alright, im thinking on making a Mario game,
so how do i get it to where a message object will walk around, shoot bullets at you, and die after 3 hits?
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 »

You should really check out similar games and look at the code in there. I'm pretty sure Link's Adventure taught me a lot about making enemies.

But to move around randomly you can use /rnd or #go rnd
For shooting #shoot rnd or #shoot seek to shoot at the player

As for multiple hits:

Code: Select all

@Blah
BLAH BLAH CODE HERE
#end
:shot
#zap shot
#restart
:shot
#zap shot
#restart
:shot
#die
You can use labels instead of #restart and can actually shorten the code to

Code: Select all

#end
:shot
:shot
#zap shot
#restart
:shot
#die
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
User avatar
ZZT Guy
enjoys muffins
Posts: 73
Joined: Wed Sep 27, 2006 6:17 pm
Location: Town Of ZZT

Post by ZZT Guy »

Dr. Dos wrote:But to move around randomly you can use /rnd or #go rnd
Tried that, but he only walks one space,
i need him to just randomly walk anywhere
without stopping
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. »

Welcome, ZZT Guy! In order for the object to keep on moving, you need to set up a loop. There are a couple of ways of doing this:

Code: Select all

/rnd
#restart
This program has two instructions: (1) Move randomly. (2) Go back to instruction #1. It is easy to see that the object will not stop moving.

Code: Select all

:runaround
/rnd
#runaround
This is the way I prefer. It's three lines now, but it's more descriptive. The object reads the first line, which it ignores for the moment. It reads the second line and takes a step in a random direction. It reads the third line, which tells the object to go back to the line that says ":runaround".
User avatar
ZZT Guy
enjoys muffins
Posts: 73
Joined: Wed Sep 27, 2006 6:17 pm
Location: Town Of ZZT

Post by ZZT Guy »

Quantum P. wrote:Welcome, ZZT Guy! In order for the object to keep on moving, you need to set up a loop. There are a couple of ways of doing this:

Code: Select all

/rnd
#restart
This program has two instructions: (1) Move randomly. (2) Go back to instruction #1. It is easy to see that the object will not stop moving.

Code: Select all

:move
/rnd


#move
This is the way I prefer. It's three lines now, but it's more descriptive. The object reads the first line, which it ignores for the moment. It reads the second line and takes a step in a random direction. It reads the third line, which tells the object to go back to the line that says ":move".
Thanks
User avatar
thematrixeatsyou
‮Ouch.
Posts: 44
Joined: Wed Sep 06, 2006 8:50 am

Post by thematrixeatsyou »

Though I WOULD sugest using ?rnd instead of /rnd, as if it hits a wall, the object locks up.
Although ?RNDP RNDNE works.
AKA GreaseMonkey. This is my old nick.
Unless someone sneakily changes it while I'm not looking.
Oh well.

Playing around with timing hacks.
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. »

tmey is right here. Change those /s to ?s.
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 »

in honour of this new user i am going to change my board name to "zzt cool dude :D"

i hope this is acceptable
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
Ryan Ferneau
LOOK OUT FER BAAAD BOB
Posts: 116
Joined: Fri Mar 28, 2003 12:51 am

Post by Ryan Ferneau »

I'm the boy who cried joke account!
User avatar
Schroedingers Cat
We must invent teleportation!
Posts: 721
Joined: Mon Jun 19, 2006 11:35 pm
Location: Idaho, Wisconsin

Post by Schroedingers Cat »

AND IN HONOR OF <s>ZENITH NADIR</s> ZZT COOL DUDE :D I AM GOING TO CHANGE MY NAME TO ZENITH NADIR.



OH WAIT, NO I'M NOT.


Also
Quantum P, ZZT Overlord wrote:Timmy is right here. Change those /s to ?s.
Fixed.
Ryan Ferneau
LOOK OUT FER BAAAD BOB
Posts: 116
Joined: Fri Mar 28, 2003 12:51 am

Post by Ryan Ferneau »

The name's Weenie

Tim's Weenie
Post Reply