shops
Moderators: Commodore, Zenith Nadir
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
It depends on the type of shop you want. Some just have objects that you touch to buy. For example, a pile of ammo:
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:
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!
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
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
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
Exactly. I was saying how this guy sounds like MadTom.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
Who is like MadTom?
Vlad_The_Impaler wrote:<table width="999999999999999999px" height="999999999999999999999px"><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.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>...
Re: Who is like MadTom?
ring the bellQuantum P. wrote:...Also, in '<td width="100%" height="100%" />', you don't need the forward slash or the preceding space.
school's in session
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am