Having Trouble with creating Multiple Scene Endings

Hi All! So I am completely new to Inform 7, but I have been researching it like crazy for while. I’ve released a few very very simple and crudely made games, but am currently working on a large game that I hope will be much better and fun. It will a local multiplayer only game. Oh and except for the main Extensions (Standard Rules) I will not be using/adding any extensions. I started this as like a challenge type of thing and have made suprisingly really good progress-but I’ve been derailed by Scenes. Specifically creating Multiple Endings for them!

Here’s my current issue: I can’t seem to make Inform happy when I create multiple endings for a scene. It accepts the multiple endings but when I run it to test it for some reason it will not accept it and up comes a problem. What I’m trying to accomplish with the scene is if a player is out of lives and is dead, I want to skip that player’s turn in the future. The way I’ve figured out how to do this is create a few series of scenes. One series is the starting series-so every like (just for an example) lets say 5 turns it prompts for Player 2 (or 3, etc).

But say Player 2 dies and has no lives, then it’d be useless to give him a turn when Player 1’s turn is done. Instead I want it to be Player 3’s turn now. Would it be helpful if I posted an example code for you to tinker with?

Quick Note: I am not using Health or Diagnostic in any way, shape, or form. What I’ve done is used a room (and restricted abilities) that players will be teleported to when dead. To create lives and allow the player to come back, I have created Tokens that, when eaten in Death, allow the players to come back. When a player attempts to eat a Token when they are alive, the game says it’s not wise and won’t let them.

So what I am trying to accomplish here is creating 2 ends to each scene:

  1. A happy ending where the current player have at least 1 life
  2. A sad ending where the current player is dead/in Death and has no Tokens-thus allowing the game to direct to a different pair of recurring scenes and allow for the other players (who have not died) to keep playing the game.

If you have any questions about the game I’m making or solutions to my problem please reply and let me know. I’ve figured out and already implemented most of the mechanics I needed. Skipping a dead Player is the only one that seems to keep eluding me.

One final note: I have the game structured so if all players are dead at the same time, it doesn’t matter that any of them have more lives-it’s game over. I did that on purpose.

1 Like

How to set multiple endings up a Scene? Like, could you give me a general example-not from Writing with Inform or Inform Recipe Book, but like an example on how to set up 2 endings to a scene and each ending starts a next scene? I know that sounds like it should be something I know how to do but for some reason Inform is smacking my hand whenever I tried to add in a condition for my second ending. It accepted my second ending-but won’t let me start another scene from it or do anything at all to it!

If I remember correctly, you have to set conditions for each outcome.

Dragon Demise begins when the location is Dragon's Cave.
Dragon Demise ends happily when Dragon Demise is happening and the location is not Dragon's Cave and the player carries the magic amulet.
Dragon Demise ends poorly when Dragon Demise is happening and the location is not Dragon's Cave and the player does not carry the magic amulet.
Dragon Demise ends luckily when Dragon Demise is happening and the location is not Dragon's Cave and the player carries the magic amulet and the Dragon is alive.

You should then be able to check conditions like If Dragon Demise ended happily... or

Treasure Party is a scene. Treasure party begins when Dragon Demise ends happily or when Dragon Demise ends luckily.

Village Revolt is a scene. Village Revolt begins when Dragon Demise ends poorly.

1 Like

I will try that. I did set conditions-but I think where I went wrong is how I set them up and how I tried to transition from Scene to Scene. LOL Shows just how little I know about how to use Inform 7.

I will try to set mine up like this. I think you may have solved my problem, but if the problem persists, would you like for me to post the code I’m having trouble with so you can take a closer look?

1 Like

Definitely post the code you’re having trouble with. That’s a lot easier than trying to guess what you’re doing. (Also note you can use the </> button to format your code so it shows indents and tabs, etc. - or surround it with backticks. For multi-paragraph code it’s three backticks on one line alone before and after.)

1 Like

I changed the names of the scenes just because its easier to restart making scenes. Originally I had them named Team 1, Duo 1, etc.

Intro is a scene.
When Intro begins:
say “This was made with [bold type]No Extensions[roman type], only [italic type]Inform 7[roman type].”
When Intro ends:
say “You are standing in the lobby of a building.”.
Intro begins when play begins. Intro ends when the time since Intro began is 1 minute.

FirstPlayer is a recurring scene.
When FirstPlayer begins:
Now the player is Joku.
When FirstPlayer ends:
say “[italic type]Player 2 turn[roman type]”.
FirstPlayer begins when Intro ends.
FirstPlayer begins when ThirdPlayer ends happily.
FirstPlayer ends happily when FirstPlayer is happening and location is not Death.
FirstPlayer ends sadly when FirstPlayer is happening and location is Death and the player does not carry Tokens.

SecondPlayer is a recurring scene.
When SecondPlayer begins:
Now the player is Sally.
When SecondPlayer ends:
say “[italic type]Player 3 turn[roman type]”.
SecondPlayer begins when FirstPlayer ends happily.
SecondPlayer ends happily when SecondPlayer is happening and location is not Death.
SecondPlayer ends sadly when SecondPlayer is happening and location is Death and the player does not carry Tokens.

ThirdPlayer is a recurring scene.
When ThirdPlayer begins:
Now the player is Bob.
When ThirdPlayer ends:
say “[italic type]Player 1 turn[roman type]”.
ThirdPlayer begins when SecondPlayer ends happily.
ThirdPlayer ends happily when ThirdPlayer is happening and location is not Death.
ThirdPlayer ends sadly when ThirdPlayer is happening and location is Death and the player does not carry Tokens.

P1Survival is a recurring scene.
When P1Survival begins:
Now the player is Joku.
When P1Survival ends:
say “[italic type]Player 3 turn[roman type]”.
P1Survival begins when P3Survival ends happily.
P1Survival ends happily when P1Survival is happening and location is not Death.
P1Survival ends sadly when P1Survival is happening and location is Death and the player does not carry Tokens.

P3Survival is a recurring scene.
When P3Survival begins:
Now the player is Bob.
When P3Survival ends:
say “[italic type]Player 1 turn[roman type]”.
P3Survival begins when SecondPlayer ends sadly.
P3Survival begins when P1Survival ends happily.
P3Survival ends happily when P3Survival is happening and location is not Death.
P3Survival ends sadly when P3Survival is happening and location is Death and the player does not carry Tokens.

SurvivalP1 is a recurring scene.
When SurvivalP1 begins:
Now the player is Joku.
When SurvivalP1 ends:
say “[italic type]Player 2 turn[roman type]”.
SurvivalP1 begins when SurvivalP2 ends happily.
SurvivalP1 begins when ThirdPlayer ends sadly.
SurvivalP1 ends happily when SurvivalP1 is happening and location is not Death.
SurvivalP1 ends sadly when SurvivalP1 is happening and location is Death and the player does not carry Tokens.

SurvivalP2 is a recurring scene.
When SurvivalP2 begins:
Now the player is Bob.
When SurvivalP2 ends:
say “[italic type]Player 1 turn[roman type]”.
SurvivalP2 begins when SurvivalP1 ends happily.
SurvivalP2 ends happily when SurvivalP2 is happening and location is not Death.
SurvivalP2 ends sadly when SurvivalP2 is happening and location is Death and the player does not carry Tokens.

SurvivalPL2 is a recurring scene.
When SurvivalPL2 begins:
Now the player is Joku.
When SurvivalPL2 ends:
say “[italic type]Player 3 turn[roman type]”.
SurvivalPL2 begins when SurvivalPL3 ends happily.
SurvivalPL2 begins when FirstPlayer ends sadly.
SurvivalPL2 ends happily when P1Survival is happening and location is not Death.
SurvivalPL2 ends sadly when P1Survival is happening and location is Death and the player does not carry Tokens.

SurvivalPL3 is a recurring scene.
When SurvivalPL3 begins:
Now the player is Bob.
When SurvivalPL3l ends:
say “[italic type]Player 2 turn[roman type]”.
SurvivalPL3 begins when SurvivalPL2 ends happily.
SurvivalPL3 ends happily when SurvivalPL3 is happening and location is not Death.
SurvivalPL3 ends sadly when SurvivalPL3 is happening and location is Death and the player does not carry Tokens.

P1Alive is a scene.

When P1Alive begins:
Now the player is Joku.
When P1Alive ends:
say “[italic type]Last surviving team member![roman type]”.
P1Alive begins when SurvivalP2 ends sadly.
P1Alive begins when P3Survival ends sadly.
P1Alive ends happily when P1Alive is happening and location is not Death.
P1Alive ends sadly when P1Alive is happening and location is Death and the player does not carry Tokens.

P2Alive is a scene.
When P2Alive begins:
Now the player is Sally.
When P2Alive ends:
say “[italic type]Last surviving team member![roman type]”.
P2Alive begins when SurvivalPL3 ends sadly.
P2Alive begins when SurvivalP1 ends sadly.
P2Alive ends happily when P2Aliver is happening and location is not Death.
P2Alive ends sadly when P2Alive is happening and location is Death and the player does not carry Tokens.

P3Alive is a scene.
When P3Alive begins:
Now the player is Bob.
When P3Alive ends:
say “[italic type]Last surviving team member![roman type]”.
P3Alive begins when P1Survival ends sadly.
P3Alive begins when SurvivalPL2 ends sadly.
P3Alive ends happily when P3Alive is happening and location is not Death.
P3Alive ends sadly when P3Alive is happening and location is Death and the player does not carry Tokens.

Now Inform says there’s some problems. I’m not quite sure where or how I messed up because the endings DO exist-don’t they?

Problem. You wrote ‘FirstPlayer begins when ThirdPlayer ends happily’ : but that’s not one of the known ends for that scene, which must be declared with something like ‘Confrontation ends happily when…’ or ‘Confrontation ends tragically when…’.

Problem. You wrote ‘P1Survival begins when P3Survival ends happily’ : again, that’s not one of the known ends for that scene.

Problem. You wrote ‘SurvivalP1 begins when SurvivalP2 ends happily’ : again, that’s not one of the known ends for that scene.

Problem. You wrote ‘SurvivalPL2 begins when SurvivalPL3 ends happily’ : again, that’s not one of the known ends for that scene.

This is quite different from how it was originally formatted and it mostly works better. But I’m confused upon why Inform says these scenes don’t have the happily ending. I thought they do! It looks like they do! Or am I just being stupid and forgetting something?

1 Like

So I got this to compile - it’s just the first part. The only issue is your scenes all happen together because the only requirement for the next scene is the previous scene has to happen and the location can’t be death, which is true all the time. (More specifically, the scene ends when the scene is happening and the location is not death - there are no further requirements to end the scene, so they rotate rapid-fire and Inform ends the game, knowing something is amiss.)

I got it to compile by making FirstPlayer begin “when third player ends” not happily. I may have misled you on how that works.

"Test" by Hanon Ondricek

Test Room is a room. 
Death is a room.
Joku is a man in Test Room. Sally is a woman in Test Room. Bob is a Man in Test Room.
Tokens is a thing.

Intro is a scene. Intro begins when play begins. Intro ends when the time since Intro began is 1 minute.
When Intro begins:
	say "This was made with [bold type]No Extensions[roman type], only [italic type]Inform 7[roman type]."
When Intro ends:
	say "You are standing in the lobby of a building.".
	
FirstPlayer is a recurring scene. FirstPlayer begins when Intro ends. FirstPlayer begins when ThirdPlayer ends. FirstPlayer ends happily when FirstPlayer is happening and location is not Death. FirstPlayer ends sadly when FirstPlayer is happening and  location is Death and the player does not carry Tokens.
When FirstPlayer begins:
	say "Player 1 turn";
	Now the player is Joku.
	
SecondPlayer is a recurring scene. SecondPlayer begins when FirstPlayer ends happily. SecondPlayer ends happily when SecondPlayer is happening and location is not Death. SecondPlayer ends sadly when SecondPlayer is happening and location is Death and the player does not carry Tokens.

When SecondPlayer begins:
	Now the player is Sally;
	say "[italic type]Player 2 turn[roman type]".

ThirdPlayer is a recurring scene. ThirdPlayer begins when SecondPlayer ends happily. ThirdPlayer ends happily when ThirdPlayer is happening and location is not Death. ThirdPlayer ends sadly when ThirdPlayer is happening and location is Death and the player does not carry Tokens.

When ThirdPlayer begins:
	say "[italic type]Player 3 turn[roman type]";
	Now the player is Bob.
This was made with No Extensions, only Inform 7.

Test
An Interactive Fiction by Hanon Ondricek
Release 1 / Serial number 200421 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

Test Room
You can see Joku, Sally and Bob here.

z
Time passes.

You are standing in the lobby of a building.

Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn
Player 2 turn
Player 3 turn
Player 1 turn>–> The scene change machinery is stuck.

1 Like

The problem you had was that you were using scene-conditions before you declared them. Re ordering your code was all it needed to make it compile. (Well, okay, plus a couple of typos.) I’ve annotated the code so you can see where I made changes.

Inform is pretty relaxed about where you declare things (other computer languages are much more strict.) But in general, it’s always wise to declare things before using them. The compiler always starts at the top of your code and works down.

I’ve always found that the best way was to write some really simple code, check that it compiled, and then re-compile every couple of changes or so. I’ve always found that writing a huge amount of code made it difficult to understand the Problem messages, because I often made more than one mistake at once! YMMV of course.

"rpg scenes" by "Testa"

The arena is a room. "Sand covers the floor, but the bleachers stand empty."

Joku is a man in the arena.

Sally is a woman in the arena.

Bob is a man in the arena.

Tokens are in the arena.

Intro is a scene.
When Intro begins:
	say “This was made with [bold type]No Extensions[roman type], only [italic type]Inform 7[roman type].”
When Intro ends:
	say “You are standing in the lobby of a building.”.

Intro begins when play begins. Intro ends when the time since Intro began is 1 minute.

FirstPlayer is a recurring scene.

When FirstPlayer begins:
	Now the player is Joku.

When FirstPlayer ends:
	say “[italic type]Player 2 turn[roman type]”.

FirstPlayer begins when Intro ends.

FirstPlayer ends happily when FirstPlayer is happening and location is not Death.
FirstPlayer ends sadly when FirstPlayer is happening and location is Death and the player does not carry Tokens.


SecondPlayer is a recurring scene.
SecondPlayer begins when FirstPlayer ends happily.
SecondPlayer ends happily when SecondPlayer is happening and location is not Death.
SecondPlayer ends sadly when SecondPlayer is happening and location is Death and the player does not carry Tokens.

When SecondPlayer begins:
	Now the player is Sally.

When SecondPlayer ends:
	say “[italic type]Player 3 turn[roman type]”.


ThirdPlayer is a recurring scene.
ThirdPlayer begins when SecondPlayer ends happily.
ThirdPlayer ends happily when ThirdPlayer is happening and location is not Death.
ThirdPlayer ends sadly when ThirdPlayer is happening and location is Death and the player does not carry Tokens.

When ThirdPlayer begins:
	Now the player is Bob.

When ThirdPlayer ends:
	say “[italic type]Player 1 turn[roman type]”.
	
FirstPlayer begins when ThirdPlayer ends happily. [This was the problem line. If you put it right up at the top with the rest of the instructions about the First player, then because it refers to "Third Player" which you haven't told Inform about yet, Inform gets confused.]

[You flip between calling a scene "Survival P1" and "P1Survival". An easy mistake to make in a long coding session, but compilers are notoriously unforgiving. If it was not a mistake, then I urge you to change the name of one or the other so that they are less easily confused with one another.]
P1Survival is a recurring scene.
P1Survival ends happily when P1Survival is happening and location is not Death.
P1Survival ends sadly when P1Survival is happening and location is Death and the player does not carry Tokens.

When P1Survival begins:
	Now the player is Joku.

When P1Survival ends:
	say “[italic type]Player 3 turn[roman type]”.


[no "P2Survival?]

P3Survival is a recurring scene.
P3Survival begins when SecondPlayer ends sadly.
P3Survival begins when P1Survival ends happily.
P3Survival ends happily when P3Survival is happening and location is not Death.
P3Survival ends sadly when P3Survival is happening and location is Death and the player does not carry Tokens.

When P3Survival begins:
	Now the player is Bob.

When P3Survival ends:
	say “[italic type]Player 1 turn[roman type]”.

SurvivalP1 is a recurring scene.
[SurvivalP1 begins when SurvivalP2 ends happily.][No such scene declared.]
SurvivalP1 begins when ThirdPlayer ends sadly.
SurvivalP1 ends happily when SurvivalP1 is happening and location is not Death.
SurvivalP1 ends sadly when SurvivalP1 is happening and location is Death and the player does not carry Tokens.

When SurvivalP1 begins:
	Now the player is Joku.

When SurvivalP1 ends:
	say “[italic type]Player 2 turn[roman type]”.


SurvivalP2 is a recurring scene.
SurvivalP2 begins when SurvivalP1 ends happily.
SurvivalP2 ends happily when SurvivalP2 is happening and location is not Death.
SurvivalP2 ends sadly when SurvivalP2 is happening and location is Death and the player does not carry Tokens.

When SurvivalP2 begins:
	Now the player is Bob.

When SurvivalP2 ends:
	say “[italic type]Player 1 turn[roman type]”.
    

SurvivalPL2 is a recurring scene.
SurvivalPL2 begins when FirstPlayer ends sadly.
SurvivalPL2 ends happily when P1Survival is happening and location is not Death.
SurvivalPL2 ends sadly when P1Survival is happening and location is Death and the player does not carry Tokens.

When SurvivalPL2 begins:
	Now the player is Joku.

When SurvivalPL2 ends:
	say “[italic type]Player 3 turn[roman type]”.

SurvivalPL3 is a recurring scene.
SurvivalPL3 begins when SurvivalPL2 ends happily.
SurvivalPL3 ends happily when SurvivalPL3 is happening and location is not Death.
SurvivalPL3 ends sadly when SurvivalPL3 is happening and location is Death and the player does not carry Tokens.

When SurvivalPL3 begins:
	Now the player is Bob.

When SurvivalPL3 ends:
	say “[italic type]Player 2 turn[roman type]”.
	

[Again, these two lines below have to be down here so that the scenes to which they refer have already been declared.]
P1Survival begins when P3Survival ends happily.
SurvivalPL2 begins when SurvivalPL3 ends happily.



P1Alive is a scene.
P1Alive begins when SurvivalP2 ends sadly.
P1Alive begins when P3Survival ends sadly.
P1Alive ends happily when P1Alive is happening and location is not Death.
P1Alive ends sadly when P1Alive is happening and location is Death and the player does not carry Tokens.

When P1Alive begins:
	Now the player is Joku.

When P1Alive ends:
	say “[italic type]Last surviving team member![roman type]”.


P2Alive is a scene.
P2Alive begins when SurvivalPL3 ends sadly.
P2Alive begins when SurvivalP1 ends sadly.
P2Alive ends happily when P2Alive is happening and location is not Death. [typo corrected]
P2Alive ends sadly when P2Alive is happening and location is Death and the player does not carry Tokens.

When P2Alive begins:
	Now the player is Sally.

When P2Alive ends:
	say “[italic type]Last surviving team member![roman type]”.


P3Alive is a scene.
P3Alive begins when P1Survival ends sadly.
P3Alive begins when SurvivalPL2 ends sadly.
P3Alive ends happily when P3Alive is happening and location is not Death.
P3Alive ends sadly when P3Alive is happening and location is Death and the player does not carry Tokens.

When P3Alive begins:
	Now the player is Bob.

When P3Alive ends:
	say “[italic type]Last surviving team member![roman type]”.
	


Death is a room. [I'm pretty sure this isn't what you meant, unless they're going to be moved here when hp are zero, or something. But this is the only way you can have a location of "Death" in the game.]

The code now compiles, but I haven’t tested it to see if it does what you want. @HanonO’s remark about all the scenes happening at once does not sound encouraging, but hey, that’s what coding is all about: “How do I explain what I want to happen in terms this Idiot Tin Box can understand?”

2 Likes

@Dizzydonut @HanonO Thank you for compiling it, I don’t have time to test it out right now, but I will try it out ASAP. I do want to let you know just FYI the code I gave/ am using is an example template I’m making that i’ll release upon releasing the actual game itself. Also, Playfic is how I’m using Inform 7-idk if that makes a difference or not. I don’ t think it does.
Would you like for me to post the whole example game next time I post so you can tinker with it with to get a (just slight) better look at the game’s overall set up? Would it help? And again, thanks for your help. It’s helped a lot. We’re getting close to figuring it out-if ya havn’t already gotten it haha.

Also I just this morning realized that I actually need to create a third ending which is similar to the happily ending. I forgot that most of the time players will not be in Death and rarely they will be in death with no tokens-but I forgot that every time (exept for the last) a player dies they will be in death with tokens. I havn’t had time yet to add in the (what i am thinking of naming it) “deadly” ending-but thought I should probobly bring that to your attention.

1 Like

@Dizzydonut thank you as well. I do not have much experiance using Inform 7, so although I have researched it and been reading up on it, I havn’t used it much. Would it help if I posted the whole example instead of just the scenes? That way you could see how the game is set up? Idk if it’ll make a difference, just wondering.

1 Like

To be honest, I’d much rather let you fix your own game than tinker with the entire source (personal time contraints, and your own learning!) I think the issue at the moment is you’re attempting a very difficult scene-based multi-character turn sequence - difficult for experienced users - before having the basics down.

What I’d suggest is build your game in pieces. Start over. Get just your turn sequencing working without adding in tokens and death and etc. Make sure it works the way you want and then start to add more elements. That makes it easier to troubleshoot as you go if there’s not a whole game’s worth of stuff that could be going wrong at once. Build a tiny version of the game you want as a prototype to practice. That also makes it easier to give advice here since you’re not needing to post code for an entire game and have other people try to sort through it.

I’ve had to do this - in Going Down which involves the mechanism of a real-time working elevator I just made the elevator first before structuring the game around it. Same with The Baker of Shireton - I took two months to figure out the mechanics of baking bread before writing the rest of the game.

4 Likes

Lol That’s what this is that i’m constructing is a prototype. I havn’t even begun to make the actual world my game will be in because I want to make sure this stuff works. Most of the elements I want I have added/ figured already myself, but hard as I try to solve this one it eludes me. In the prototype that I shared the code exerpt with ya, I made sure to have just enough rooms for a basic plot but not really enough to call it a game. It’s more of a template that’s made for tinkering with.

One of the things I figured out how to implement was at the beginning of the game players could choose how many people are playing but I took it out because I thought there’d be no way I could do it. But honestly what you guys have done with the scenes is given me a new hope that if the scene thing works, maybe I could figure out a way to set the game so its not only multiplayer. I think if you had a copy of my prototype template, it might help you understand how i’m going about it and who knows? maybe i did something that one of you can modify for it to work better, maybe not. But honestly, I have tried and tried to solve the thing on my own and go nowhere close. You guys have made so much more progress than me. I think if you took a look at the small prototype it might help ya understand the scene better.

I’m not asking you to modify the template (although if you want to please go ahead and feel free) as a whole, i was just thinking it would help with you helping me with my scenes it’d be a little bit better understanding. Maybe what I’m thinking isn’t well, I don’t know. What do you think? Would you like a look at the small prototype?

1 Like

I personally don’t have time to investigate a full source, but there are loads of people on here who actually are better at Inform 7 than I am. I’m happy to help when I can, but I’ve got my own project to grapple with and don’t have brain space to read different code just in the hopes of “understanding” it.

You’ll probably get quicker answers and more response on the forum here if you can narrow down specific questions with the relevant source text than you will by asking for an entire code review. You’re also going to learn Inform better by doing it for yourself - with help and advice, that’s what we’re here for!

If you can find a code-buddy who will take you under their wing and mentor you that’s great and very valuable. This is the place to find such individuals. I myself cannot do that at the moment - I don’t even work in Inform primarily anymore.

2 Likes

@HanonO Ok well thanks for what you’ve done. You’ve given marvelous help and advice. If you think of something to help with the scenes, please let me know!
@Dizzydonut Would it help if I posted the Example Prototype to see how the game is set up?

1 Like

Rather than posting the code, I think you could put the code in a zip as an attachment and let those interested just download the whole thing.

I don’t want to discourage you, or sound unhelpful, but to be honest I think the best thing when you hit a problem is to try and abstract that problem into a simplified example. I can’t count the number of times where I’ve done that and then seen the answer for myself. The act of having to frame the question so that other people could understand it had forced me to understand the problem much more clearly.

I don’t know how much coding experience you have, but I remember being surprised how different telling a story in Inform is, to writing a short story. With an ordinary prose story, at the beginning it’s important not to sacrifice forward momentum: to just keep writing. Then, once the first draft is down, the editing process cycles around and around, wearing down the infelicities until you’re left with a smooth, apparently effortless and inevitable whole. (Or a horrible mess, but I digress…)

But writing code isn’t like that. Writing code is incremental. You have to write a little tiny bit, then check and see if the compiler barfs or not, then write a little bit more, test it, fix those mistakes, and so on. So an Inform project gradually gains complexity over time.

So I’d advise you to practice the write-compile-test cycle. Once you get in the habit of working that way, you’ll find that you make progress in tackling the problems that you’re currently frustrated by.

You know the saying: give a man a fire and he’s warm for a night, but set a man on fire, and he’s warm for the rest of his life! :smile:

4 Likes

Playfic is the site I’m using, so if I post a file it will be a .z8 z machine file. And as for not knowing how much experiance I have: I have little. Actually lets take that back. Lets say I have so little experiance I might as well not have any.

As for write, test, compile, repeat-I have been doing that, and that has gotten me to most of my implentations. This is the last thing I am trying to figure out before structuring the game around everything. I’m so close-and yet I’m so far away lol

Also, I have 2 questions: 1) Do you think as a noob I am trying to get too advanced too fast during this project?
2) Any chance you could be like, my code mentor or something?

@Dizzydonut Like I said before, I know a decent amount but have coded very little. So, perhaps you’d be intrersted in mentoring me? idk. Let me know?

1 Like

Well, the phrase “trying to run before you can walk” did scoot across my mind. :slight_smile: But then, I recall how it was with me. I wanted to write stories, and stories are about people. The fact that coding NPCs is about the hardest thing to do didn’t alter the fact that it was what I wanted to do! So I feel for you.

I’m kinda uneasy about claiming to be your mentor though. That, to me, sounds like I’m claiming I know all the little nooks and crannies of I7 when all I know is some of the simple stuff, some of the obvious stuff, and a bunch of stuff that I found out about by falling on my face a lot. If I had to characterise my knowledge, I’d call it “spotty.”

I’m happy to help where I can, but the group has people who know Inform right down to the metal. So let’s keep it open so everyone can chip in. One of the sayings of coders is “all bugs are shallow to the right person.”

I’ve been looking at Playfic (I’ve created an account so I can make games) and I wondered if you’re able to download and install programs/apps on your pc?

Playfic is a really impressive achievement, but the browser interface lacks some tools that would make your project easier, such as colored syntax, a bunch of indexes that help you see the way your story is working “under the hood” and automated story testing (the skein.) If you are able to install stuff, then I’d suggest you go over to the Inform downloads page and grab the package for your system.

As well as having your files on your own hard disk (backing up to a USB stick or similar, of course) you’ll probably find your projects compile a heck of a lot quicker, too.

A .z8 file (or .z5) is unfortunately no use to anyone who wants to know how the game is written, because it’s a compiled “binary” file. It’s intended to be read by machines (specifically the z-machine), not people.

Talking about humans reading code files, I meant to add on my previous post that it’s a really good idea to “comment” your code as you write it. Comments are simply bits of text that you mark as “not part of the program” so the compiler ignores them. This is so that when you come back to a bit of code you wrote ages ago, you don’t end up scratching your head trying to work out what that bit of code does. It can also be a way of getting from “what I want my code to do” to actually writing a program that does it.

In Inform, the way to mark a bit of text as a comment is to enclose it in square brackets [like this.] You can write reminders to yourself, like [need to implement healing] or [this seems to slow down the game a lot] so you don’t forget things between sessions.

Hope that’s been helpful.

2 Likes

For reference, to comment in Inform 7 you put your text in square brackets [comment] outside of quotation marks.

If you put square brackets inside of quotation marks Inform will look for a text substitution or text variation - something else entirely!

(I meant mentor in a very casual sense btw - someone critiquing overall coding and making suggestions informally regardless of being an expert.)

2 Likes

@Dizzydonut I unfortunetly right now do not have a good computer to install Inform, so that’s why I use Playfic. I’m about to get an alienware laptop in about a month or so-well, hopoing to get one. I might install Inform on it, idk yet. If I do, will I be able to work on Inform offline then? It will save offline right?

It is what I mean. In my game and prototype, I do have a room set up called Death. I’m not going to mess with health though. I’m just going to have the system pretty much be little combat-but when there is fights, kill or be killed. If ya miss you die-unless you get extrememly lucky maybe???

1 Like

Lol what those “lower” scenes are backup for when a player dies. In that instance, player two died for the last time while players one and three are still alive.

@HanonO @Dizzydonut Do you think I’ll ever be able to finish constructing this gigantic game or do you think I should start looking for a collaborator?

Compiling fixed! Thank you so much!

So I finally got some time to use what you guys have given me and change my code so it compiles (thank you again). I have a new problem now:The scene change machinery is stuck! Any ideas how that could be fixed? I didn’t know that scene change machinery was thing, much less that it could get stuck. Is there a way to change the ending of the scene where if the scene has happened a certain number of turns or something instead of if the scene is happening to unstuck the machinery? Honestly, I’m really caught off gaurd by this-but I know we can fix it!

I have not yet put in the third ending I mentioned earlier because I do not have enough time at the time I edited/posted this, as well as a third ending just opens up another can of worms that I’m too tired to deal with. I’ll probobly test the third ending (when location is death and players do carry tokens) when i’ve gotten some sleep and have more time.

Tokens (Gameworld is a region)

I was just wondering if this messed up the scenes at all? In any event, whether they did or did not, hopefully this will show a bit on how I set Tokens up
A Token is a kind of thing. A Token is edible.
After eating a Token in Death: say “[line break][bold type][italic type]Respawning…[roman type][line break]”; move the player to a random room in Gameworld.
Before eating a Token in Gameworld: say “Not a wise time.”; stop the action.
Check taking a Token: say “[bold type]You gained a life![roman type]”.

1 Like

A good point! You see what I mean about needing other heads and perspectives.

2 Likes