Page 1 of 1
shops
Posted: Fri Apr 30, 2004 11:32 pm
by 705
in zzt, what code do i use to make shops?
Posted: Sat May 01, 2004 12:02 am
by Quantum P.
It depends on the type of shop you want. Some just have objects that you touch to buy. For example, a pile of ammo:
Code: Select all
#end
:touch
It's some ammo.
!a1;Buy 10 ammo for 5 gems
!a2;Buy 25 ammo for 10 gems
#end
:a1
#take gems 5 #cantafford
#give ammo 10
You buy some.
#end
:a2
#take gems 10 #cantafford
#give ammo 25
You buy some.
#end
:cantafford
You can't afford that!
#end
To change the item type, you just modify or replace the #give statement. Other shops have you go up to the front counter to buy goods. The counter code might look something like this:
Code: Select all
#end
:touch
SHOPKEEPER: Hello! Want to buy something?
!a1;Buy 10 ammo for 5 gems
!a2;Buy 25 ammo for 10 gems
!t1;Buy 1 torch for 1 gem
!t2;Buy 5 torches for 4 gems
!h1;Buy 10 health for 20 gems
!h2;Buy 20 health for 35 gems
#end
:a1
#take gems 5 #cantafford
#give ammo 1
You buy some.
#end
:a2
#take gems 10 #cantafford
#give ammo 25
You buy some.
#end
:t1
#take gems 1 #cantafford
#give torches 1
You buy some.
#end
:t2
#take gems 4 #cantafford
#give torches 5
You buy some.
#end
:h1
#take gems 20 #cantafford
#give health 10
You buy some.
#end
:h2
#take gems 35 #cantafford
#give health 20
You buy some.
#end
:cantafford
You can't afford that!
#end
There are other variants of shops, too. If any of this code doesn't make sense, I would advise going into the editor, pressing H, and reading the tutorial. You can also get some programmng help by going to the
main page and clicking on
"help/faq", and you can always post in the Z2 fora if you need help on a specific problem. Don't get discouraged, and good luck in the ZZT community!
Posted: Sat May 01, 2004 12:39 am
by Mooseka
A DETAILED RESPONSE TO A DETAILED QUESTION.
Posted: Sat May 01, 2004 12:47 am
by Ryan Ferneau
I love when things fit together like that!
Posted: Sat May 01, 2004 2:29 am
by 705
thank you very much
Posted: Sat May 01, 2004 4:37 pm
by zamros
this is the nicest thread ever
threads like this make me smile
Posted: Sat May 01, 2004 6:18 pm
by Dr. Dos
Exactly. I was saying how this guy sounds like MadTom.
Posted: Sat May 01, 2004 6:27 pm
by Mooseka
madtom is less like

and more like

nowdays.
Posted: Sat May 01, 2004 11:54 pm
by 640
<table width="999999999999999999px" height="999999999999999999999px"><tr><td width="100%" height="100%" /></tr></table>
Who is like MadTom?
Posted: Sun May 02, 2004 1:16 am
by Quantum P.
Vlad_The_Impaler wrote:<table width="999999999999999999px" height="999999999999999999999px"><tr><td width="100%" height="100%" /></tr></table>
W3C wrote:
There is no attribute "HEIGHT."
... width="999999999999999999px" height="999999999999999999999px"><tr><td width=...
There is no attribute "WIDTH."
...9999999999999999999px"><tr><td width="100%" height="100%" /></tr></table>...
There is no attribute "HEIGHT."
...99999px"><tr><td width="100%" height="100%" /></tr></table>...
...Also, in '<td width="100%" height="100%" />', you don't need the forward slash or the preceding space.
Re: Who is like MadTom?
Posted: Sun May 02, 2004 3:26 am
by 29
Quantum P. wrote:...Also, in '<td width="100%" height="100%" />', you don't need the forward slash or the preceding space.
ring the bell
school's in session
Posted: Sun May 02, 2004 5:25 am
by 705
WTF?!?!! how did this go from ZZT tags to rocket science!?!?!?
Posted: Sun May 02, 2004 6:19 am
by Ryan Ferneau
Everything is rocket science if you want it to be.
Posted: Sun May 02, 2004 9:16 pm
by clecky
ryan YOURE rocket science