Explorus Development Issues

Hi everyone. How are you? You can call me Taco, and this topic is for helping me please create and finish my WIP by helping me to troubleshoot and fix problems that I have attempted to fix myself and have failed to do so.

I am having some problems creating my game Explorus using Inform 7. The first couple problems I am having is creating some room properties to give XP to players or to remove some health from players (the Warpzone) and telaport players.

Giving XP

A room can be prized or notprized. A room is usually notprized. 
Castle is a prized room.
Check entering a prized room: increase the XP of the player by 70; say "[bold type]+70 Experience[roman type]"; now the room is notprized.

Creating the Warpzone: Part 1

"Warpzone" by Tyler Campbell. use no scoring.
Earth Prime is a room. "[first time][bold type][line break]Hint[line break][line break][italic type]Go South to get started[roman type][only]". Dimensional Jumper is south of Earth Prime.
Earth 2 is north of Dimensional Jumper. Earth 3 is south of Dimensional Jumper. Earth 4 is east of Dimensional Jumper. Earth 5 is west of Dimensional Jumper.

A room can be zoned or unzoned. A room is usually unzoned. 
Check entering a room: [if room is zoned] now the printed name of the location is "Warpzone";
now the description of the location is "A swirling mass of time and energy.";[end if].
Earth 4 is zoned.

This seems to work-except for some reason Inform acts like Earth 4 is unzoned. I’m not sure why this is.

What other steps are needed to create the Warpzone?

  1. Make the Warpzone slowly spread after a certain event is triggered (i.e. the final boss fight)
  2. Players who find themselves in the Warpzone (or choose to foolishly walk in) have a chance of getting telaported
  3. Players who are in the Warpzone get damaged. Each turn they are in the Warpzone will diminish thier health by a specific amount.

I will post all the problems that I am unable to solve by myself here on this topic, so if you are interested in helping me troubleshoot, be sure to keep an eye on here. And thank you so much, even if all you do is read this and never post anything.

Check entering a room: [if room is zoned] now the printed name of the location is "Warpzone";

You’ve commented out the part of the line that tests if the room is zoned. It’s not being compiled at all.

1 Like

Hmm ok. Thanx, I didn’t notice. Upon trying to change that, I found an example of in 5.1 of writing with inform that helped change the name and description. I have added players sometimes getting teleported and losing health, but am still have trouble with the warpzone spreading, though. I am not sure why this is not working. The Warpzone just keeps refusing to spread or even let me add properties to it. I’m trying to make it so that (if you don’t want to know what happens at end, don’t read the summary. I need help creating a character that turns rooms into warpzones.)

Summary

When Chronicle has been in a room, the turn after that the room becomes a warpzone.

Here’s what I have now so far: Anybody have any ideas or suggestions?

"Example" by Tyler Campbell. use no scoring.
Every person has a number called Health. The Health of a person is usually 100.
When play begins:
now the left hand status line is "Health: [the Health of the player]".
Earth Prime is a room. "[first time][bold type][line break]Hint[line break][line break][italic type]Go South to get started[roman type][only]". Dimensional Jumper is south of Earth Prime.
Earth 2 is north of Dimensional Jumper. Earth 3 is south of Dimensional Jumper. Earth 4 is east of Dimensional Jumper. Earth 5 is west of Dimensional Jumper.
Chronicle is a person. Chronicle is in Earth 5.
A warpzone is a kind of room with printed name "Warpzone" and description "A swirling mass of time and energy.".
Earth 4 is a warpzone. Earth 2 is a warpzone.
Every turn when the location is a warpzone: if a random chance of 75 in 100 succeeds begin; say "[italic type]Swooooosh![roman type] You feel a surge of electricity in your body as you are ejected out."; now the player is in a random room; decrease the health of the player by 5;
otherwise; decrease the health of the player by 10; end if.
A room can be infected or healthy. A room is usually healthy. 
Definition: a room is healthy if it is not a warpzone.
Definition: a room is infected if it is a warpzone.
Check entering a room: if room is infected begin; say "Oh no! It's been destroyed!"; otherwise; end if.

It’s not possible to change the kind of an object at runtime. So your problem is that “a warpzone is a kind of room”. This in turn means that non-warpzone rooms can never become warpzones during play, and vice versa.

You can, however, define a property on the regular room kind that specifies whether it is currently a warpzone or not (“A room can be a warpzone”), and get rid of your current kind. That will allow you to add and remove the property during play.

3 Likes

Thank you!. Never in a million years would I have figured this out lol

Will this allow me to have a room turn into a room a turn (or more) after a certain character shows up? or when a scene begins?

EDIT

I am having trouble getting Inform to use this. Am I going about it the wrong way?

A warpzone is a room with printed name "Warpzone" and description "A swirling mass of time and energy.".
A room can be a warpzone.

It keeps saying " Problem. In ‘A room can be a warpzone’ , you proposed the new either/or property ‘a warpzone’: but this already has a meaning.".

Yes, you’ll be able to change it from any event you can write a rule about.

As for your second issue, as I said you’ll have to remove that part. Your first line is now interpreted as creating a single room called “warpzone”, which conflicts with the property declared in the second line.

You should be able to accomplish something similar to the name changes you want (but better, since it won’t trash the “real” names and descriptions of the rooms), using something like this:

A room can be a warpzone.
Rule for printing the name of a warpzone:
	say "Warpzone" instead.
Rule for printing the locale description of a warpzone:
	say "A swirling mass of time and energy." instead.

Edit: hmm, actually that’s not quite right. locale description should be a different rule to actually replace the description output, though exactly which one escapes me at the moment.

Edit2: this works. Not sure if there’s a tidier way to do it (and it overrules some things, like darkness, which might be good or bad for your case):

This is the warpzone description rule:
	say "A swirling mass of time and energy." instead.
The warpzone description rule substitutes for the room description body text rule when the location is a warpzone.

You’ll also probably want to get rid of this line; it shouldn’t be necessary given the other definitions:

A room can be infected or healthy. A room is usually healthy. 
2 Likes

[Ha, Gavin posted the entire first half of my comment while I was typing.]

The way Gavin’s options work is to leave the initial properties for the printed name and description of a room but work around them so they don’t get printed. Another option would be to set them when you change a room to warpzone. A good way to do this would be to write a phrase (basically a routine) to take care of everything at once, setting the room to warpzone and changing the names; then all you have to do is call the phrase when you need to, and you don’t have to worry about remembering to do all three things at once. Here’s what I mean:

w1 is a room. w2 is west of w1. w3 is east of w1. w4 is west of w2. w5 is west of w4.

A room can be warpzone. A room is usually not warpzone. 

When play begins: warp w1.

Every turn: 
	say "Spreading to ";
	let L be the list of not warpzone rooms that are adjacent to a warpzone room;
	say L;
	repeat with new warp running through L:
		warp new warp.
	
To warp (place - a room):
	now the printed name of place is "Warpzone";
	now the description of place is "A swirling mass of time and energy.";
	now the place is warpzone.

The “warp” phrase does everything we need to do when making a room warpzone. When we want to make a room warpzone, we just put “warp [whatever the room is]” in our code. Note that instead of setting w1 to warpzone in the initial code, I had a rule when play begins to warp w1, so everything would be taken care of at once!

There are two reasons to make a list L of the rooms that are adjacent to warpzone rooms but aren’t warpzone themselves yet. One is to print a list of the rooms it’s spreading to. (If I weren’t being sloppy, I would check to see whether there were any new warpzone rooms before printing the “spreading” message at all.) The other thing is that we want to fix the list all at once instead of changing the warpzone status of rooms while we’re checking it, or we might wind up with a situation where w1 starts warpzone, and then we check w2 and make it warpzone because of w1, and then we check w4 and now w2 is warpzone so we make w4 warpzone, so the warpzone spreads too fast. (That is to say, that’s exactly what happened the first time I tried this.)

But as Gavin said, this trashes the old printed names and descriptions of the rooms. If a room can stop being warpzone and you want to get the old printed name and description back, it’s probably better to use Gavin’s ideas!

Anyway, maybe this code can help you with the warpzone spread even if you decide not to use the custom phrase.

2 Likes

@mirality @matt_weiner I have not yet had time to use your suggestions, but they look great. I do want to apoligize on not giving a clear description on how I want the Warpzone to spread for Explorus: Totally my bad and I am really sorry for that. Please forgive me.

Warpzone spread (do not read if you don’t want the end of the game spoiled for you)

Spoiler

My plan is that at the end of the game, the players find out that Sunburn is actually a good guy (similar to Pariah if you’ve read DC’s Crisis on Infinite Earths comics) who accidently released Chronicle from his prison and has been attempting to delay the inevitable. Players will then have a little bit of time to prepare for this fight (or to make thier way to the warpzone) and then Chronicle will appear in the (first) Warpzone room and the Final Boss Battle begins. Once he appears, every turn just as players move around, so does he. His goal is to destroy everything, so the Warpzone is what’s left after that. Once he enters a room, he might do any of a number of things at random: leave and go to a different room(of which obsiously since it’s now a new turn the room previous has been destroyed into a warpzone), dodge an attack, (very extremely rarely)laugh or say something, or launch an attack(of which i feel like he should have several different types).

No the Warpzone does not spread after a location gets turned into one. But since Chronicle is moving around and causing it, this creates the feel that the Warpzone is spreading.

Does this clear things up? Again, I’m really sorry that I didn’t mention that before. I should’ve and that miscommunication was totally on my part.

Does the Warpzone idea seem like a good concept?

  • Great Idea
  • Stupid Idea
  • Needs Work
  • Maybe could be better used for something else

0 voters