Limited ammo in Inform (16)

1 Name: #!/usr/bin/anonymous : 2008-08-01 22:11 ID:3w7Q5nhm

I wasn't sure if this belonged on "Games" or "Programming," but I figured it would more likely belong in "Programming." Feel free to move it if you feel this is the incorrect place for this topic.

http://www.inform-fiction.org/I7/Welcome.html

I am making a text adventure, and I have a pistol. But I want the pistol to have limited ammo. Could you tell me how to do that, please?

2 Name: #!/usr/bin/anonymous : 2008-08-02 00:32 ID:Heaven

fuck you and fuck you.

3 Name: #!/usr/bin/anonymous : 2008-08-02 13:18 ID:Heaven

Track how much ammo is used and make the pistol unable to shoot when you run out of it, problem solved.

4 Name: #!/usr/bin/anonymous : 2008-08-02 16:45 ID:3w7Q5nhm

>>3 See, I do not know how to do that. I'm a beginning Inform programmer. Do any of you have a Google account? If so, maybe you could ask here for me.

http://groups.google.com/group/rec.arts.int-fiction

I don't have a Google account, and I do not want to bother getting one, especially just to ask one question.

5 Name: #!/usr/bin/anonymous : 2008-08-03 03:05 ID:Heaven

http://www.inform-fiction.org/I7/ex209.html#e209

I think you could adapt this example to represent a gun & bullets instead of containers full of lemonade.

Read the entire chapter, anyway.

6 Name: #!/usr/bin/anonymous : 2008-08-06 20:28 ID:Heaven

its called a lower bound
wtf

7 Name: #!/usr/bin/anonymous : 2008-08-07 09:12 ID:Heaven

>>4
you don't need a google account to post there. it's a freaking usenet group.
Use any NNTP client to post at rec.arts.int-fiction.

8 Name: #!/usr/bin/anonymous : 2008-08-08 05:16 ID:3w7Q5nhm

>>7 Oh. That's good, except now I have another problem. I viewed some of the user's profiles, and on each of them, their e-mail address were visible. You can't hide your e-mail address? I do not want anybody, except the people I e-mail, to know my e-mail address. It's for privacy reasons.

9 Name: #!/usr/bin/anonymous : 2008-08-08 05:48 ID:Heaven

>>8
It doesn't have to be a real e-mail address.

10 Name: #!/usr/bin/anonymous : 2008-08-08 20:14 ID:LKsvKhAs

You make me sick

11 Name: #!/usr/bin/anonymous : 2008-08-12 05:36 ID:3w7Q5nhm

>>8 I'm not sure, but wouldn't that be a violation of the user agreements? Even if it isn't, I don't feel like making up an e-mail address.

>>9 Who is making you sick, and why? Is it me who's making you sick?

12 Name: #!/usr/bin/anonymous : 2008-08-18 05:59 ID:Heaven

>>11 hotmail accounts are free and disposable. I mean really.

13 Name: #!/usr/bin/anonymous : 2008-08-22 21:30 ID:Heaven

>>11

Presumably he is sick because you are using an entire suite to make a text-based game, not to mention your lack of knowledge concerning Kareha.

14 Name: #!/usr/bin/anonymous : 2008-08-24 06:55 ID:g31/KTVL

1) have 'pistolAmmo' variable or something; when player picks up the pistol set this to the number of rounds they should start with
2) every time the player shoots the pistol, check if pistolAmmo is 0; if so, print 'pistol ran out' or something, and if not, subtract 1 from it and run the code to shoot it
3) you have no fucking reason to use a suite for a text-based program, the stuff you need to make one is damned simple and practically any language out of the box is more than cut out for this

but honestly if you need to ask this then please, please tell me you are under 10 years old

15 Name: #!/usr/bin/anonymous : 2008-08-25 02:08 ID:Heaven

this thread proof that /code/ is shit and can't understand the value of dsls.

16 Name: #!/usr/bin/anonymous : 2008-08-25 06:11 ID:Heaven

BUT ITS AN ENTIRE SUITE. C IS JUST ONE LETTER. USE C.

This thread has been closed. You cannot post in this thread any longer.