Noob trying to make scenery that follows the player

So in this game I’m making, I have a river in a canyon.
Many locations are in the canyon along the river, so I of course made that a region, as such: (EDIT: The Canyon_Proper is also a region, but doesn’t always have the river in it. It always has the “cliffs” backdrop, however)

The Canyon_River is a region in the Canyon_Proper. High Falls Bottom, River Bend, Genteel Falls River, Genteel Falls Top, Genteel Falls Bottom, River Near Camp, Calamity Falls River, Calamity Falls Top, Calamity Falls Bottom, and Lower River are in the Canyon_River.

So I figured that THEN I could just make a piece of scenery that can move to the player’s location if the player is in the Canyon_River region, as such:

[b][i]A riverway is a kind of enterable scenery container. The description is “Wide, rocky, and with a strong current. In some places it is rather deep, but in other places barely ankle deep. Surely it can be quite dangerous.” Understand “river” as the riverway.

The River-Here is a riverway.

Before going anywhere:
If the location is in the Canyon_River:
Now the River-Here is in the location.[/i][/b]

(for some reason, that “before” rule isn’t keeping my white-space in the post. It IS properly indented tho in the source code. I tried using the [code] tag, but then the text doesn’t wrap around and that makes it hard to read. Sorry. Is there a better way to do this?)

It’s not working. The river never shows up anywhere. What am I doing wrong here?
I’ve tried and tried to find relevant info in the documentation, with no luck so far. I’ve not yet FINISHED reading the full manual. It’s kind of a slog to get through. However, I have fully read “The Inform 7 Handbook.” Which is pretty basic, sure. But a good starting primer.
I’m sure I’m just making some idiotic noob mistake. Sorry.

EDIT NOTE: I made “riverway” a kind because, at first, I was going to simply put a separate riverway in every river location. But then I thought I’d be clever and try to just move the scenery as the player moved. … I ALSO tried just making the “riverway” an object in and of itself, but that didn’t work either.

EDIT EDIT: I also tried changing that “Before” rule to an “After” rule. Still didn’t work.
I also want to change the description of the river depending on which location the player is in. I figured it’d be wise to get THIS part working before moving on to that part tho. :wink:

I think you can just say:

The River-Here is a backdrop in the Canyon_River.

With the before rule, you are moving the scenery object to the room the player is moving out of, so it will indeed never be in the location he moves into! What happens when you turn it into an after rule, or a last carry out rule?

There might be (probably are) more elegant ways to do this, but here’s what I put together. It uses a backdrop for the river in Canyon_River region and an enterable container “the water” which is moved into the location of the player when the player tries to get into the river, then the player is moved into that container (the water). When the player leaves “the water,” the player exits and the container is taken back out of the location.

The Canyon_Proper is a region.

The water is an enterable container.

The Canyon_River is a region in the Canyon_Proper. 

High Falls Bottom, The River Bend, Genteel Falls River, Genteel Falls Top, Genteel Falls Bottom, River Near Camp, Calamity Falls River, Calamity Falls Top, Calamity Falls Bottom, and Lower River are in The Canyon_River.

The River Bend is north of High Falls Bottom.

The river-here is a backdrop. The printed name is "river". It is not scenery. The description is "Wide, rocky, and with a strong current. In some places it is rather deep, but in other places barely ankle deep. Surely it can be quite dangerous.". Understand "river" as river-here.

The river-here is in the Canyon_River.

Before entering the river-here:
	move the water to the location;
	move the player to the water;
	say "Woo! Cold. Wet. And full of snakes!!!".

After exiting from the water:
	say "You hop back out of the river.";
	now the water is nowhere.

Sample Output:

High Falls Bottom
You can see a river here.

>get in river
High Falls Bottom (in the water)
You can see a river here.

Woo! Cold. Wet. And full of snakes!!!

>n
You would have to get out of the water first.

>get out
You hop back out of the river.

>n

The River Bend
You can see a river here.

>get in river
The River Bend (in the water)
You can see a river here.

Woo! Cold. Wet. And full of snakes!!!

>get out
You hop back out of the river.

>look
The River Bend
You can see a river here.

>

That’s how I had it at first, but backdrops can’t be made enterable.

OH! Interesting. Hmmm. So I’d need to get the location being moved TO in order for that to work. I’ve now tried several ways of determining what room is in the direction the player is moving, but with no success. How would one do that? I’ve searched the manual, but not found anything (yet) that shows how to do this.
Making it an after rule, it still doesn’t show up … I don’t know what a “last carry out” rule is (yet)

The phrase you’re looking for is room gone to.

AHA!!! Thanks for the kickstart there! Got it working, I think. Now just gotta figure out how to change the river’s description in certain locations.

Here’s how I got it to work. Much simpler than what I was trying:

[code]Section - The River

The river_proper is a backdrop in the Canyon_River. The description is “Wide, rocky, and with a strong current. In some places it is rather deep, but in other places barely ankle deep. Surely it can be quite dangerous.” Understand “river” as the river_proper.

The riverway is an enterable scenery container. The printed name is “Canyon Falls River.”

Instead of entering the river_proper:
Move the riverway to the location;
Move the player to the riverway;
Say “You can’t swim, but you’re in the river. Not good.”

After exiting from the riverway:
Say “You’re out of the river, thankfully.”;
Now the riverway is nowhere.[/code]

Also, because I find it intuitive to say things like “Exit the river” or “Get out of the river” I also added a new action for this, as such:

[code]Chapter - Exiting something expansion

Exiting from is an action applying to one thing. Understand “exit [something]”, “exit from [something]”, “exit the [something]”, “get out of the [something]”, and “get out of [something]” as exiting from.
Instead of exiting from, try exiting.[/code]

And a sample transcript from the actual game, showing it all working as expected:

[code]River Near Camp
You’ve been prospecting here for what seems like forever, with very little to show for your efforts. Just enough to maintain camp, and keep you and Clementine fed.
The river here is gentler than it is north or south, which is partly why you chose this location for panning. Your camp is a short walk to the east.

You can see a rattlesnake, a shovel, a bucket, and some gold flakes here.

x river
Wide, rocky, and with a strong current. In some places it is rather deep, but in other places barely ankle deep. Surely it can be quite dangerous.

enter the river
River Near Camp (in the Canyon Falls River.)
You’ve been prospecting here for what seems like forever, with very little to show for your efforts. Just enough to maintain camp, and keep you and Clementine fed.
The river here is gentler than it is north or south, which is partly why you chose this location for panning. Your camp is a short walk to the east.

You can see a rattlesnake, a shovel, a bucket, and some gold flakes here.

You can’t swim, but you’re in the river. Not good.

x river
Wide, rocky, and with a strong current. In some places it is rather deep, but in other places barely ankle deep. Surely it can be quite dangerous.

get out of the river
You get out of the Canyon Falls River…

River Near Camp
You’ve been prospecting here for what seems like forever, with very little to show for your efforts. Just enough to maintain camp, and keep you and Clementine fed.
The river here is gentler than it is north or south, which is partly why you chose this location for panning. Your camp is a short walk to the east.

You can see a rattlesnake, a shovel, a bucket, and some gold flakes here.
[/code]

SWEET! Thanks.

I was trying:

After going anywhere: Let D be the direction; Let the new-location be the room D from the location; If the new-location is in the Canyon_River: Now the River-Here is in the new-location.

Actually, I think you can make one that’s enterable. This seems to be working for me.

A bodyofwater is a kind of backdrop. A bodyofwater can be enterable or unenterable. It is usually enterable.

The River-Here is a bodyofwater in Canyon_River.

AH! Interesting. Hadn’t thought of using properties to do that, just saying the background was enterable. The compiler didn’t like that at all. :wink:

And I just found a way to crack it out. It’s not letting me put something in it, but if I enter it then drop something, the thing I dropped ends up in the backdrop. After that, going to another location makes that item vanish forever. Although, given that this is a river, that’s not all that different from real life behavior. Just ask my fiance about the time I rammed our canoe into a bank, dumped him in the water, and lost his glasses.

OH CRIMINEY!!! :open_mouth:
I hadn’t even CONSIDERED the possibility that the player would put/drop stuff when in the river.
Well … their loss I guess. The river is fast and strong. Their stuff gets washed away downriver. (Just like “precious darlin’ Clementine” – from which the game is inspired :wink: ) LOL
I’ll just have to intercept the “dropping” action to warn them of that tho, I guess. So thanks for the heads up on THAT one. :wink:
EDIT: There IS a general store in the town where the player can buy new stuff if they lose it in the river. :wink:

Problem solved (I hope):

Instead of dropping something when the River-Here encloses the player, say “Not here! It could be lost forever.”

Yeah, I’ll give the player a warning, but still let them do it if they insist. Their loss :wink:

I’m gonna stick with the other method of “moving” the river about tho. Doing it that way seems a bit simpler than doing it as a background. :smiley:

Another thing you can try if you want to do something unusual with backdrops is make something part of the backdrop. So if you make the river an enterable container that is part of the backdrop, then the container will move around with the player as the backdrop does… though then you’d need to use your rule to prevent the player from putting things in the river etc., or anything they put in the river (or drop when in the river) will magically reappear in the river with them.

Anyway, if you’ve got something working no need to mess with it, but it might be another approach.

I finally got a chance to poke at this some more. After I made it transparent, I realized what matt w is talking about. The thing I dropped in there didn’t vanish. It went everywhere, at the same time. I broke the laws of physics. Cool.

Matt W – OH WOW! That’s a really cool idea. I’ll have to play around with that and see how it works. Things that get dropped in the river can simply be removed from play.
Harkness – Nice job breaking the laws of physics there :wink:

I realized another issue just as I was going about my wake-up routines: What if the player tries to go in any direction whilst in the river. D’OH! … and OF COURSE the player will want to do that.
Shouldn’t be too hard to deal with tho, as the player cannot swim and the river is exceedingly strong and dangerous. The player will likely be knocked over by the current, bang his head on a rock, go unconscious, and drown. :wink:
Heck! Simply being IN the river will cause a potential for that to happen, which the player will be warned about every turn.

Backdrops are indeed not enterable, however, you can make an enterable container that is “part of” a backdrop and it will move with it.

Then it’s an easy matter to redirect entering the backdrop to entering the correct attached container.