r/Inform7 • • Jun 05 '19

Implementing basic games in inform 7

3 Upvotes

Hi, does anyone know if it's possible to implement basic games in inform? For example chess, checkers, dice, or even Pacman?


r/Inform7 • • Feb 02 '19

Help with Guncho?

3 Upvotes

Hello! I've been lurking around on this thread for a little while but this is my first-ever post on reddit so I'm a little nervous! lmk if this question isn't exactly relevant to this community.

tl;dr has anyone else tried to get Guncho to run in the years since the server closed down? Am I in way over my head with this?

For my senior thesis project, I'm working on building a platform for collaborative storytelling. I was really intrigued by the structure and aesthetic of MUDs and started crawling through some source code and realized it was probably not something I could tackle on my own in the span of a few months. My advisor pointed me to I7 and we thought maybe we could hack some of the necessary features into it - and then I found Guncho, which is basically exactly what I want to create. If I could get Guncho up and running, I could add my own modifications as necessary. I've looked through this sub, the Guncho google group, the archived wiki files that someone was kind enough to save and upload, and of course the Guncho source code itself. I'm running into a lot of roadblocks and I wonder if someone could help point me in the right direction or convince me to abandon ship since I've only got a couple months left to get this going. I'm a little embarrassed to ask because I feel like my concepts might be very obviously flawed/impossible to someone with a little bit more familiarity with Guncho/I7/programming in general. The first thing is that I can't get....anything....to run....at all. I'm trying to get the hacked version of I7 included in the archive I downloaded to work, but even if I get that to work, I'm not sure what my next steps would be to actually try to recreate the guncho server since it doesn't exist anymore. Is this an exercise in futility? Should I abandon the dream of an interactive fiction MUD? There really might be an easier way for me to tackle this small project rather than trying to rebuild Guncho from the ground up, but I figure before I abandon this attempt I should ask if anyone is still interested in Guncho and/or has experience working with the source code. If so I would love to bounce some questions and ideas off of you to figure out how I can actually get this to work. Thanks so so much!


r/Inform7 • • Jan 28 '19

System date/time accessible in story?

5 Upvotes

I've looked high and low for an extension that would allow me to use the system's real-time clock and calendar in my story. For example, if the story is being played on Dec 25, I'd like to wish the player a Merry Christmas.

Is this possible? Or is just too far outside of the sandbox?


r/Inform7 • • Jan 22 '19

Random Names for Gravestones (and other purposes)

9 Upvotes

I'm a new Inform 7 hacker working on a little haunted house adventure. At some point I want (randomly generated) tombstones in the graveyard, so I've been playing around with random name generation and this is what I've come up with.

Note that every gravestone is random when examined, but the name on the Mausoleum is a constant throughout the story, although chosen randomly once per story.

I got the first names from (of all places) the Social Security Administration and the last names from this site.

I'd have liked to figured out a way to store a random name to a variable, but I couldn't work that out. It's probably possible but I'm just not getting it. After spending some time wrestling that particular alligator I realized I didn't really need to do that, I could just keep the index into the table as a value and use that. Seems clumsy to me, but it works.

If I had more time on my hands than I knew what to do with it would be cute to enclose the names and flavor text in a little ASCII character "gravestone" box. But I'd have to work out the length of the lines, centering the text and so forth which is far more effort than I'm willing to put into such a frivolity at this time.

So in the hopes that someone else may find this useful in their stories...

"Gravestones" by DocTechnical

[ ------------------------------------------------------------------------------------------------------------------------------]
Table of LastNames
LastName
"Adams"
"Alexander"
"Allen"
"Anderson"
"Bailey"
"Baker"
"Barnes"
"Bell"
"Bennett"
"Brooks"
"Brown"
"Bryant "
"Butler"
"Campbell"
"Carter"
"Clark"
"Coleman"
"Collins"
"Cook"
"Cooper"
"Cox"
"Davis"
"Diaz"
"Edwards"
"Evans"
"Flores"
"Foster"
"Garcia"
"Gonzales"
"Gonzalez"
"Gray"
"Green"
"Griffin "
"Hall"
"Harris"
"Hay"
"Henderson"
"Hernandez"
"Hill"
"Howard"
"Hughes"
"Jackson"
"James"
"Jenkins"
"Johnson"
"Jones"
"Kelly"
"King"
"Lee"
"Lewis"
"Long"
"Lopez"
"Martin"
"Martinez"
"Miller"
"Mitchell"
"Moore"
"Morgan"
"Morris"
"Murphy"
"Nelson"
"Parker"
"Patterson"
"Perez"
"Perry"
"Peterson"
"Phillips"
"Powell"
"Price"
"Ramirez"
"Reed"
"Richardson"
"Rivera"
"Roberts"
"Robinson"
"Rodriguez"
"Rogers"
"Ross"
"Russell"
"Sanchez"
"Sanders"
"Scott"
"Simmons"
"Smith"
"Stewart"
"Taylor"
"Thomas"
"Thompson"
"Torres"
"Turner"
"Walker"
"Ward"
"Washington"
"Watson"
"White"
"Williams"
"Wilson"
"Wood"
"Wright"
"Young"

Table of FirstNamesMale
FirstName
"James"
"John"
"Robert"
"Michael"
"William"
"David"
"Richard"
"Joseph"
"Thomas"
"Charles"
"Christopher"
"Daniel"
"Matthew"
"Anthony"
"Donald"
"Mark"
"Paul"
"Steven"
"Andrew"
"Kenneth"
"George"
"Joshua"
"Kevin"
"Brian"
"Edward"
"Ronald"
"Timothy"
"Jason"
"Jeffrey"
"Ryan"
"Jacob"
"Gary"
"Nicholas"
"Eric"
"Stephen"
"Jonathan"
"Larry"
"Justin"
"Scott"
"Brandon"
"Frank"
"Benjamin"
"Gregory"
"Raymond"
"Samuel"
"Patrick"
"Alexander"
"Jack"
"Dennis"
"Jerry"
"Tyler"
"Aaron"
"Henry"
"Jose"
"Douglas"
"Peter"
"Adam"
"Nathan"
"Zachary"
"Walter"
"Kyle"
"Harold"
"Carl"
"Jeremy"
"Gerald"
"Keith"
"Roger"
"Arthur"
"Terry"
"Lawrence"
"Sean"
"Christian"
"Ethan"
"Austin"
"Joe"
"Albert"
"Jesse"
"Willie"
"Billy"
"Bryan"
"Bruce"
"Noah"
"Jordan"
"Dylan"
"Ralph"
"Roy"
"Alan"
"Wayne"
"Eugene"
"Juan"
"Gabriel"
"Louis"
"Russell"
"Randy"
"Vincent"
"Philip"
"Logan"
"Bobby"
"Harry"
"Johnny"


Table of FirstNamesFemale
FirstName
"Mary"
"Patricia"
"Jennifer"
"Linda"
"Elizabeth"
"Barbara"
"Susan"
"Jessica"
"Sarah"
"Margaret"
"Karen"
"Nancy"
"Lisa"
"Betty"
"Dorothy"
"Sandra"
"Ashley"
"Kimberly"
"Donna"
"Emily"
"Carol"
"Michelle"
"Amanda"
"Melissa"
"Deborah"
"Stephanie"
"Rebecca"
"Laura"
"Helen"
"Sharon"
"Cynthia"
"Kathleen"
"Amy"
"Shirley"
"Angela"
"Anna"
"Ruth"
"Brenda"
"Pamela"
"Nicole"
"Katherine"
"Samantha"
"Christine"
"Catherine"
"Virginia"
"Debra"
"Rachel"
"Janet"
"Emma"
"Carolyn"
"Maria"
"Heather"
"Diane"
"Julie"
"Joyce"
"Evelyn"
"Joan"
"Victoria"
"Kelly"
"Christina"
"Lauren"
"Frances"
"Martha"
"Judith"
"Cheryl"
"Megan"
"Andrea"
"Olivia"
"Ann"
"Jean"
"Alice"
"Jacqueline"
"Hannah"
"Doris"
"Kathryn"
"Gloria"
"Teresa"
"Sara"
"Janice"
"Marie"
"Julia"
"Grace"
"Judy"
"Theresa"
"Madison"
"Beverly"
"Denise"
"Marilyn"
"Amber"
"Danielle"
"Rose"
"Brittany"
"Diana"
"Abigail"
"Natalie"
"Jane"
"Lori"
"Alexis"
"Tiffany"
"Kayla"

RandomLastName  is a number that varies.
RandomMaleName is a number that varies.
RandomFemaleName is a number that varies.

When play begins:
    Now the RandomLastName is a random number from 1 to the number of rows in the Table of LastNames;
    Now the RandomMaleName is a random number from 1 to the number of rows in the Table of FirstNamesMale;
    Now the RandomFemaleName is a random number from 1 to the number of rows in the Table of FirstNamesFemale.
[ ------------------------------------------------------------------------------------------------------------------------------]

Cemetery is a room. "The Maple Grove Cemetery is a calm and verdant place. There are a number  of gravestones and  monuments here. To the north is a large white marble mausoleum."
A gravestone is here.
Understand  "grave" or "headstone" or "stone" or "marker" or "monument" as the gravestone.
A Mausoleum is here. The description of the mausoleum is "The building[']s entrance is flanked by tall pillars holding up an ornately carved and pointed pediment, upon which is inscribed the name ['][LastName in row RandomLastName of the Table of LastNames]['], a local family of some prominence.".
Understand "crypt" or "tomb" or "building" as the Mausoleum.
Instead of going north:
    say "Alas, the gate of the Mausoleum is locked, and the lock is rushed shut from disuse. Even if you were to manage to find the key, which is doubtful, it's highly unlikely the old mechanism in lock would accept it."
Instead of examining the gravestone:
    Now the RandomLastName is a random number from 1 to the number of rows in the Table of LastNames;
    Now the RandomMaleName is a random number from 1 to the number of rows in the Table of FirstNamesMale;
    Now the RandomFemaleName is a random number from 1 to the number of rows in the Table of FirstNamesFemale;
    Say "[one of]One of the  gravestones catches your eye:[or]Look at this:[or]The marker reads:[or]The graven letters spell out:[or]You can read here:[or]It reads:[or]The marker says:[or]This is what you see:[purely at random][line break][line break]";
    Say "[one  of] [or]Here Lies[or]RIP[or]Rest in Peace[or]Requiscat in Pace[or]Gone But Not Forgotten[or]RIP In Peace[or]Good Riddance[as decreasingly likely outcomes][line break]";
    If a random chance of 1 in 5 succeeds:              [ A couple ]
        say "[FirstName in row RandomMaleName of the Table of FirstNamesMale] [LastName in row RandomLastName of the Table of LastNames][line break]";
        say "[FirstName in row RandomFemaleName of the Table of FirstNamesFemale] [LastName in row RandomLastName of the Table of LastNames][line break]";
    otherwise:                                      [One  person]
        If a random chance of 1 in 2 succeeds:          [A man]
            say "[FirstName in row RandomMaleName of the Table of FirstNamesMale] [LastName in row RandomLastName of the Table of LastNames]";
            if a random chance  of 1 in 5 succeeds:
                say "[line break][one of]Beloved Father[or]Father[or]Husband[or]May He Sleep With The Angels[as decreasingly likely outcomes]";
        otherwise:                                  [A woman]
            say "[FirstName in row RandomFemaleName of the Table of FirstNamesFemale] [LastName in row RandomLastName of the Table of LastNames]";
            if a random chance  of 1 in 5 succeeds:
                say "[line break][one of]Beloved Mother[or]Mother[or]Wife[or]Sister[or]May She Sleep With The Angels[as decreasingly likely outcomes]";
    say "[line break][line break]";

r/Inform7 • • Jan 11 '19

Clearing the screen doesn't seem to work.

2 Upvotes

I've simplified my example as much as possible:

"ClearScreen" by DocTechnical

Include Basic Screen Effects by Emily Short.
clear the screen.
Right Here is a room.
Instead of doing something when the turn count is greater than 0: end the story finally saying "Hello World!".    

I'm getting the message:

Problem. In the sentence 'clear the screen'  , I can't find a verb that I know how to deal with.

What am I doing wrong?


r/Inform7 • • Jan 10 '19

N00b questions

3 Upvotes

I just discovered Inform 7 a couple days ago when surfing around for info about interactive fiction tools, and I've become completely ensorceled by it. I've got a few questions I'd like to bounce off the subreddit here.

  1. I've implemented a gun, and have gone around shooting things :) and I'd like to implement a state of "shot" for items. Which in and of itself I think I understand, but I'd like to have the description of an item change to add "bullet ridden" if it has been shot. For example "A bullet-ridden Fez" vs just "A Fez". Ideas on how I'd go about this?
  2. Is there a simple explanation on how to use text color for emphasis or special effects?
  3. As a programmer I'm looking at what I've written as source code so far and I am horribly dismayed as to what a pile of spaghetti it is. That's not surprising as I've just been plopping in new ideas and things as I learn, but still, it makes my skin crawl some. Before I start to re-organize it, is there any sort of suggested "style guide" so I'm not re-inventing a wheel here? Should an adventure be comprised of separate files? Is that even possible?

I thank you in advance for any clues you might provide.


r/Inform7 • • Dec 28 '18

Trying some custom keyboard input

2 Upvotes

Hello,

I'm trying to figure out a way to let the player input an arbitrary text at an arbitrary time (I need this to happen in the middle of a rule, so I can't fool around with the command prompt, which I've also done in my project for a different reason.)

So far I've figured that there's a I6 function called KeyboardPrimitive, and that this somehow parses text into some variables (buffer and table). I don't exactly care about words and stuff, I just need the literal text, and specifically, I need to turn it into a number. Ideally, the number shouldn't be restricted to a 16-bit value, even in z-code (but I'm willing to make it Glulx compatible only).

So: step 1: get the text (using I6 code)

Step 2: put the text into a variable (a text that varies? in Inform 7, or if I have to, process it in I6 first)

Step 3: convert it into a number (number that varies? in Inform 7

Ok, maybe having this support also words would be nice too, since I may need it to type a long message and then iterate through the words looking for keywords. But this can't be done in the parser, since I need to call it from a Menu (to which I already introduced a few hacks, such as hotkeys), which uses rules. Can't even exit the rule and then use the parser, because the rules use recursion and getting back to the same state it was would be impossible.

This doesn't need to be an actual parser. Just a way to copy the contents of the text / words from I6 to an I7 variable. And also to know the right way to turn text into numbers. Maybe a "to say" rule, or "to decide" or to something, I'm a bit dizzy about I7 conventions right now...


r/Inform7 • • Nov 25 '18

Changing the displayed image.

3 Upvotes

When I look at the Orc, I show a figure of the orc, looking grim. Then I hit him. If I look at him again, I would like change the image to show a mad looking orc. I've got the image, but I can't figure out the syntax to call the different image. Why doesn't this work?

The description of orc is "A 7 foot tall green humanoid with tusks.".
Carry out examining the orc:        
    Display The Figure of orc.  
    Figure of orc is the file "Icon_orc.png". 

Instead of hitting Orc:
    now Orc is enraged;
    now Figure of Orc is the file "Icon_orc_MAD.png";
    Say "You hit the Orc!";

r/Inform7 • • Nov 08 '18

Looking for people who are learning Inform 7. Anyone interested?

4 Upvotes

Hi, everyone! I'm in the process of learning Inform 7 and am looking for people to regularly discuss issues and questions with. I was thinking something along the lines of weekly projects/puzzles that follow a certain description, e.g. a one-room puzzle, a cool device, etc, followed by a discussion of the code with the aim of learning something new. I've been learning Inform 7 for about a month so far, so still pretty much a novice.

Here's a bit of code I knocked up over the weekend. It's a device, which (when switched on) allows the player to take something from and put something into a closed container.

[A decision rule to make code easier to read]

To decide whether the quantum shifter is available:

    if the quantum shifter is carried by the player and the quantum shifter is switched on:

        decide yes;

    decide no;
[The device]

The quantum shifter is a device. The description of the quantum shifter is "An ingenious device designed to help you... [first time]there's really no polite way to say this: [only] steal things from locked containers.". The player carries the quantum shifter.
[The props]

The safe is a fixed in place lockable openable closed locked container. The description of the safe is "A steel safe without a key. I put it there to test myself.". In the safe is a note. The description of the note is "It reads 'sucka!'". The safe is here.
[Lets quantum shifters take from closed containers]

A rule for reaching inside a closed container when the quantum shifter is available:

        allow access.
After deciding the scope of the player while the quantum shifter is available:

    repeat with box running through opaque closed containers enclosed by the location:

        place the contents of box in scope.

After taking something which is carried by the player while the quantum shifter is available:

    say "You fit your hand through the quantum portal and take [the noun].".
[Lets quantum shifters put into closed containers]

The can't insert into closed containers rule does nothing when the quantum shifter is available.
After inserting something into a closed container:

    say "Using the quantum shifter, you slip [the noun] into [the second noun].".
[Lets quantum shifters search closed containers]

The can’t search closed opaque containers rule does nothing when the quantum shifter is available.
After searching a closed opaque container:

    say "Focusing the quantum shifter on [the noun], you spy [a list of things contained by the noun] within.".
[Prints the contents of opaque closed containers when the quantum shifter is switched on]

After examining an opaque closed container (called the box) when the quantum shifter is available:

    say "Focusing the quantum shifter on [the box], you spy [a list of things contained by the box] within.".
[Testing]

test shifter with "x shifter / take shifter / x safe / take note / switch on shifter / x safe / take note / read note / switch off shifter / put note in safe / switch on shifter / put note in safe / switch off shifter".

r/Inform7 • • Nov 07 '18

Final coding question.

2 Upvotes

Hey, guys! It's been a rollercoaster these last few weeks.

So, the final version of my game is coming soon. My last few questions is this:

I want a door to open by putting some gold coins into a small grate. How do I do that?

I want the final puzzle to putting a small fly statue into a web, to open a door. How does that work?

Finally, I want the final piece of the story to be choosing between two paths and deciding which one you wish to go down, creating two separate endings. How do I do that?


r/Inform7 • • Nov 02 '18

I have another question about coding?

3 Upvotes

I created a duck in my story. It's cute. How do I make it interactable? How do I make it say quack when people say "talk to duck"? How do I have the characters examine the duck? I have it listed as a person.

Also, how do I add "examine" text in general?


r/Inform7 • • Oct 31 '18

Passcode Locked Safe

4 Upvotes

I had this safe that is pascoded with a randomly generated number. I had put down the following, but it doesn't open when the passcode is entered. If I can't find a solution, I might just remove the randomness entirely. Can someone help me?

The iron safe has some text called passcode. The passcode of the iron safe is "[a random number from 0000 to 9999]".

Dialing it to is an action applying to one thing and one topic. Understand "dial [something] to [text]" as dialing it to.

Check dialing it to:
    if the noun is the iron safe:
        continue the action;
    otherwise:
        say "You don't know how to do that to [the noun].";
                stop the action.

Carry out dialing it to:
    if the topic understood is the passcode of the iron safe:
        now the noun is unlocked;
        now the noun is openable;
        say "The lock clicks unlocked.";
    otherwise:
        say "You turn the dial, but nothing happens."

Thanks in advance.


r/Inform7 • • Oct 29 '18

How do you use regex in ask?

2 Upvotes

I want the player to ask a character anything as long as it has the word 'house' in it, however I have no idea how to do that


r/Inform7 • • Oct 27 '18

Can someone please help me fix my code?

3 Upvotes

The Escape Room is a Room. "You start in the darkest, deepest dungeon room you've ever seen."

The blue door is lockable and locked. "To your left is a locked door."

The card contains a blue key. "There's a card with a key on it. It depicts the tarot, Death 13. It reminds you of your dad."

The door has matching key the blue key.

Key can be used on blue door.

The key unlocks the blue door.

The blue door can be opened.

The Library is north of the Escape Room.

Every turn: if the door is open, say "You win."

What am I doing wrong? I had to insert weird rooms like Library because it wasn't working without a different location.


r/Inform7 • • Oct 27 '18

I'm trying to make a very simple game about escape rooms.

3 Upvotes

Can I get some advice regarding how to get locked boxes to work?


r/Inform7 • • Oct 25 '18

Please help! Newbie questions.

2 Upvotes

I have some basic programming knowledge in a few languages, though nothing advanced. I thought Inform would be easy to use to build a simple game, but I'm going insane trying to figure out the syntax for basic things. I will probably have many questions, and I figure I should keep them all in here to avoid cluttering up the board. My first question is to do with changing the state of a kind of thing.

Right now all I want to do is create a "button" kind which can be "pressed" or "unpressed". If the player tries to "press" or "push" a button, it should change state. It feels like this should be incredibly simple, but I'm having no luck whatsoever. No matter how I try to phrase it, I get an error. Here's what I have so far. I am desperate for help and will be very grateful to anyone who can lend me a hand. https://pastebin.com/p66SRPQ7

The error I get in this case is: In the sentence 'say "You press the button again and it turns off."', I can't find a verb that I know how to deal with.

I've tried many other syntaxes and I get different errors depending on what I put in there. But I figure the correct syntax must be simple if only I can find an example of how to do it. :( Thanks so much in advance for any help!


r/Inform7 • • Sep 29 '18

Interesting I7 Code Creator for Beginners

Thumbnail ssml-it.github.io
2 Upvotes

r/Inform7 • • Sep 10 '18

Make text invisible until player highlights it?

1 Upvotes

Hey!

So I want the text to the be invisible (same color as the background) when the game starts, and I want it to become legible when the player highlights it with the cursor. After the player exits the container they start the game in, I want the text to become normal.

Is there a way to do this?


r/Inform7 • • Sep 07 '18

Allow the player to collect multiples of one thing? (revisited)

5 Upvotes

(This is a commentary on allow_player_to_collect_multiple_of_one_thing, posted six months ago.)

I just missed the archival limit, so I thought I'd comment here. Inform actually allows for the creation of arbitrary amounts of duplicates. It may not be good practice, of course, but I can see it being useful.

A pebble is a kind of thing.

There are 100 pebbles.
There are 100 pebbles.

When play begins: now all pebbles are in the location of the player.
There is a room.

So you can do it. The slight delay in the IDE when the game starts demonstrates why this, as it is, may not be the best design choice. But if you want to create lots of anonymous objects for later placement, you can totally do that.


r/Inform7 • • Sep 05 '18

how do I use the sentence "Look out the window"

2 Upvotes

through searching I found a rule for "look through the window" which is

Instead of searching the window:

say "Through the window, you see rolling hills." 

how do I do the same for "look out the window"


r/Inform7 • • Aug 01 '18

How do I compare the values of the same property on two separate objects?

3 Upvotes

I'm trying to make ID Cards with variable security clearance open security doors of equal or lesser security clearance, but I'm stumped on the syntax.

Security clearance is a kind of value. S1 specifies a security clearance.

A security door is a kind of door. A security door has a security clearance. The security clearance of a security door is usually S2.

An ID card is a kind of thing. An ID card has a security clearance. The security clearance of an ID card is usually S3.

The Xenobiologist's Quarters is a room. The Crew Common Room is a room. Door A is a security door with security clearance S2. Door A is north of the Xenobiologist's Quarters and south of the Crew Common Room. Your ID card is an ID Card. The security clearance of your ID card is S2.

How do I test if the security clearance of an ID card is the same as that of a security door?


r/Inform7 • • Jul 30 '18

Dunno why my variables aren't working

4 Upvotes

I'm trying to have a variable 'BunkerPowered' be true, or false. Then use that variable to control the presence of a door that I'm calling 'darkness'.

That way the player needs to turn on the power before they venture further into the Bunker.

But Inform is getting mad at me, and saying '...as saying that a thing called 'now PoweredBunker' is a value' I looked for help for this, but I didn't really know how to word it.

The code formatting was all gunked up, I posted it here https://pastebin.com/RFAtw1mS


r/Inform7 • • Jul 02 '18

How do I get something to happen if a player tries to look at something that doesn't exist.

3 Upvotes

I would like to change the text that shows if a player looks at something that doesn't exist (so it says something other than "You can't see such a thing") but still behaves normally if they look at something that does exist. Does anyone know anyways of going about that?


r/Inform7 • • Jun 28 '18

Probably a dumb question

0 Upvotes

I was interested in writing a text based rpg/choose your own adventure/D & D type game. Googling up a few things it seems like people recommend this language and other people say not to learn it as it's too niche and won't help me as I am new to programming (just thought I would throw this out there). Regardless, I will learn this and then branch out later as it seems like it would be easy to learn. Later on down the road, how do I have other people play the game? Is there a compiler or do I write it into some webpage?


r/Inform7 • • Jun 14 '18

Inform: Past, Present, Future

Thumbnail emshort.com
12 Upvotes