Inform 7 coding simple

I have a stadium “scene” in a game I’m working on and I can’t remember any ways to do this efficiently.

After the “disposal” of an enemy from battle, I want a new one to appear or walk over, several turns later.

One way to do this would to make your second enemy enter with a scene under the conditions that enemy1 is dead and that you are still in the stadium for X turns.


"StadiumTest" by Jizaboz

Football Stadium is a room.
Limbo is a room.

BadDudeDead is a truth state that varies. BadDudeDead is usually false.

BadDude2 is a man in Limbo.

Enter BadDude2 is a scene. Enter BadDude2 begins when the player is in the Football Stadium and BadDudeDead is true for 3 turns.

When Enter BadDude2 begins:
	move BadDude2 to Football Stadium;

Note that I did not include your first enemy because I’m not sure what method you are using for calling him “dead”. Just load a “Now BadDudeDead is true;” into wherever that occurs. You can plug in however many of turns you want. You’ll probably want to try a couple of things until the timing feels right to you.

Actually, I want to this without scenes (I’m working on an RPG so this will be far too much clutter).

I’m using this piece of code:

Definition: A person is alive if its health is 1 or more. Definition: A person is killed if its health is 0 or less.

Aren’t all text adventure games essentially RPGs?

It appears as though maybe we’re misunderstanding your question. Jizaboz’s suggestion will work just fine with what you’re proposing. It wouldn’t add any additional clutter. In fact, it’s probably the cleanest way that I can think of for it to be done. This is presuming that there are no other conditionals that need to be checked. Are you alive? Is the other guy not so alive? Have you been in the arena for five turns? Bang, start the next scene and move in the next NPC.

Your question is “How do I introduce another NPC after the first one is dead?” Yet your response to the solution seems to indicate that you aren’t explaining the entirety of your problem. What mechanic of your game is hindered by the inclusion of scenes?

Holy tangent grenade. Only in a teensy, technical, highly limited, never-usable-in-practical-conversation way. RPGs as commonly understood require progressive ability enhancement among many other systems.

On main topic: I concur. I would expect there must be some unstated requirement precluding the use of scenes, which otherwise would seem to me to be the tidiest way to handle a combat situation distinct from exploration, conversation, and other encounters typical to an RPG. You’ll probably have specific actions and behaviors which hold true in one set of circumstances but are inappropriate in another, and scenes would actually help make tracking that simpler. OTOH, we’re all speaking out of ignorance. =P

If you really don’t want to use scenes for whatever reason, I think you could do this just by using time. Wherever your code is that checks whether BadDude1 is killed and disposes of him, add something like:

if BadDude1 is killed: [or however you’re doing this part]
a new challenger appears in 3 turns from now;

At the time when a new challenger appears:
move BadDude2 to Football Stadium;[/code]