Passage Issues?

Kimblee88
First of all, I should say that I new to this. REALLY new to this. If most Newbies are preschoolers, I'm still in the NICU.

I'm trying to make the player able to examine things, using passages for the examined objects/people. So far so good.

One of my passages is the person accompanying the player and I want the player to be able to 'examine' the companion on any screen. At first the passage wouldn't work at all, so I moved it down several lines so it would be below the two "screens" that allowed examination.

But only one would work. The other just comes up blank.

I have it working by having the same passage (same name, same text) repeated in two places. But am I going to have to do that every time I want them to be able to look at their companion? I think the other game I tried making I think could use the same passage twice without having to input it twice. But that might have been a section that could be accessed from two different 'screens'.

Any help? Or a push towards a site or wiki that can explain some of this? I have very, VERY minimal experience with html and as far as I know, none with coding. I'm doing this because a friend of mine was talking about how much fun she had playing text adventures so I'm making this for her. But I am having trouble with this and hoping I won't have to repeat the passage every single time I need it. (Other passages really need to be reusable too for that matter.)

Dennis Carlyle
Kimblee88 wrote:First of all, I should say that I new to this. REALLY new to this. If most Newbies are preschoolers, I'm still in the NICU.

I'm trying to make the player able to examine things, using passages for the examined objects/people. So far so good.



It's hard to know exactly what you're trying to do without seeing your code. But maybe this will be some help. The following uses the {label}/(@replace) function (see the docs here:)
http://docs.textadventures.co.uk/squiffy/replace.html

If you want links in different sections to go to the same block of text, then this method will only work by having the text you want repeated in its own section.

Note: You can have a {label:labelName=} without any content after the "=" if you want, so the description can appear where there was no text to start with.


@start start

[[SkippyDesc]]:
Skippy is about 6 ft. tall, and is dressed in blue and green.

[[start]]:

Your companion, [Skippy](@replace Skip=SkippyDesc), is here.

{label:Skip=He's observing the painting.}

[[continue . . . ]](Sec2)

[[Sec2]]:
[Skippy](@replace Skip2=SkippyDesc) agrees you should exit the building.

{label:Skip2=He's looking afraid.}

[[continue . . . ]](Sec3)

[[Sec3]]:
End it.


TyCamden
Dennis Carlyle wrote:It's hard to know exactly what you're trying to do without seeing your code. But maybe this will be some help. The following uses the {label}/(@replace) function (see the docs here:)
http://docs.textadventures.co.uk/squiffy/replace.html

If you want links in different sections to go to the same block of text, then this method will only work by having the text you want repeated in its own section.

Note: You can have a {label:labelName=} without any content after the "=" if you want, so the description can appear where there was no text to start with.

(CODE)


How would you make it so that if you click on Skippy in any section, it would no longer give you the choice in any following section (but if you did not, it still would) ?

Dennis Carlyle
TyCamden wrote:
How would you make it so that if you click on Skippy in any section, it would no longer give you the choice in any following section (but if you did not, it still would) ?


In this case, using the [[SkippyDesc]] section to try and set a variable won't work, because the script never directly goes to the section; it just "embeds" the section's text somewhere else.

You can set an attribute from a link, so one way would be like this:

1) add ", SkipSeen = 1" to every [Skippy] link that describes him:
Your companion, [Skippy](@replace Skip=SkippyDesc, SkipSeen = 1), is here.

2) Check "SkipSeen" whenever you might want to show the link if it's still un-clicked.

(You can try cramming more into the {if ...} statement, but I think just using different passages is easier to set up and follow. The "label" part here can have some text, or not.)


[[Sec3]]:

{if SkipSeen= 1:{NoSkipLink}}{else:{SkipLink}}

[NoSkipLink]:
Skippy is standing by the fountain.

[SkipLink]:
[Skippy](@replace Skip3=SkippyDesc) is standing by the fountain.

{label:Skip3=}

Kimblee88
Dennis Carlyle wrote:

"Kimblee88"

First of all, I should say that I new to this. REALLY new to this. If most Newbies are preschoolers, I'm still in the NICU.

I'm trying to make the player able to examine things, using passages for the examined objects/people. So far so good.



It's hard to know exactly what you're trying to do without seeing your code. But maybe this will be some help. The following uses the {label}/(@replace) function (see the docs here:)
http://docs.textadventures.co.uk/squiffy/replace.html

If you want links in different sections to go to the same block of text, then this method will only work by having the text you want repeated in its own section.

Note: You can have a {label:labelName=} without any content after the "=" if you want, so the description can appear where there was no text to start with.


@start start

[[SkippyDesc]]:
Skippy is about 6 ft. tall, and is dressed in blue and green.

[[start]]:

Your companion, [Skippy](@replace Skip=SkippyDesc), is here.

{label:Skip=He's observing the painting.}

[[continue . . . ]](Sec2)

[[Sec2]]:
[Skippy](@replace Skip2=SkippyDesc) agrees you should exit the building.

{label:Skip2=He's looking afraid.}

[[continue . . . ]](Sec3)

[[Sec3]]:
End it.




(I'm gonna try to put the code in, I'm not sure how to use this forum yet. But thank you so much for replying! I appreciate it.



But its a perfect plan. No way it could go badly. At least you got the door open.

[[Enter]](Begin Enter)

Take a better look:

[Sora] x [House](Slade house)

[Sora]:

In a long ivory duster coat, black tank top, and pleated gray skirt, Sora is not dressed for an adventure. Her handbag may contain something useful, but maybe not useful to anyone besides her. Her lips are a dark wine red and her blue eyes rimmed with a thick line of black liner, which makes her colorless skin almost glow in its sheer whiteness.



That's the first time Sora appears. Then as they enter the house I've got



The door pops open with a creak. You probably should have thought about oiling the hinges, yeah? Sora follows behind you, her hands shoved up into her sleeves. Her breathing is occasionally inturrupted by a snort at your 'plan' to take on a known mercenary in his own home. But she is your family, so she won't say she told you so.

She did tell you so though.

The front door opens into a small foyer, to your left is a flight of stairs with soft speaking voices audible above your head. Ahead of you is a living room with cream colored carpet and a beige leather sectional set. A bookcase with many hardback and paperback books, as well as small souvineers from the owner's travels is beside a sliding glass door with a closed set of blinds. Through a small gap, a group is visible outside.

On the other side of the glass door is an archway into a kitchen. A powder room is set under the stairs.

Look at:

[Sora] x [Stairs] x [Living Room] x [Bookcase]

Action:

[[Go outside]](end)



and then



[Sora]:

In a long ivory duster coat, black tank top, and pleated gray skirt, Sora is not dressed for an adventure. Her handbag may contain something useful, but maybe not useful to anyone besides her. Her lips are a dark wine red and her blue eyes rimmed with a thick line of black liner, which makes her colorless skin almost glow in its sheer whiteness.

Being an albino, she is functionally blind, although she sees well enough to mock almost everything around her. She thinks you might be an idiot. You haven't proved her wrong yet.



repeated. (Sorry if formatting is off, I would have had to include all the stuff between otherwise.)

I don't mind if the game will let you repeatedly look at Sora, its all good. I'm just not wanting to have to type it up or paste it every time.

If I do end up having to do that, I may start changing the description to fit where ever the player is looking at her. I mean, if I'm gonna have to keep pasting anyway, I might as well add more snark to it.

I'll see if I can figure out your code. Its all Greek to me right now but slowly things are starting to look like a language to me.

Dennis Carlyle
Hi. Take a look at the @replace example . . . but here's probably an easier way to re-use text without entering it every time, using the first part of what you've just posted. In a passage, just put the section name you want in curly brackets. Text from that section will be copied/displayed. You can make different sections for different blocks of text to be displayed whenever needed.


But its a perfect plan. No way it could go badly. At least you got the door open.

[[Enter]](Begin Enter)

Take a better look:

[Sora] x [House](Slade house)

[Sora]:
{SoraDesc_1}
{SoraDesc_2}

[[SoraDesc_1]]:
In a long ivory duster coat, black tank top, and pleated gray skirt, Sora is not dressed for an adventure. Her handbag may contain something useful, but maybe not useful to anyone besides her. Her lips are a dark wine red and her blue eyes rimmed with a thick line of black liner, which makes her colorless skin almost glow in its sheer whiteness.

[[SoraDesc_2]]:
Being an albino, she is functionally blind, although she sees well enough to mock almost everything around her. She thinks you might be an idiot. You haven't proved her wrong yet.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums