Procedural descriptions and initial appearances

Hello guys

I’d like to do something like that :

[code]A street is a kind of room.

When play begins :
repeat with S through streets begin ;
now the description of S is “You are [one of]in a dirty slum[or]in a street[or]in a beautiful and blablabla street[sticky random]” ;
end repeat.[/code]

Of course it doesn’t work : the sticky random thing gives the same description to all the streets.

I tried with “procedural randomness” by aaron reed but it doesn’t seem to change anything - maybe I’m misusing it.

Any idea ?

I think a way to do this with Procedural Randomness would be:

When play begins : repeat with S running through streets begin ; set seed to S; now the description of S is "You are [one of]in a dirty slum[or]in a street[or]in a beautiful and blablabla street[with procedural randomness]." ; end repeat.

I also wonder if you could use substituted forms of texts to do this? Don’t have time to check it now.

This trick should do it:

When play begins:
    repeat with S running through streets begin;
        now the description of S is "You are [one of]in a dirty slum[or]in a street[or]in a beautiful and blablabla street[at random]";
        now the description of S is "[description of S]";
    end repeat.

Setting the description to itself in a text substitution makes it evaluate the one of…at random and assign the result back to the description. Why it works that way is discussed in the “Changes to Inform” book.

Doesn’t work, sorry. But thanks for taking the time to answer :slight_smile:

That’s where you can use the substituted form, I think:

[code]A street is a kind of room.

First Avenue is a street. Second Avenue is a street, west of First Avenue. Third avenue is a street, west of Second Avenue. Lexington Avenue is a street, west of Third Avenue.

When play begins:
repeat with S running through streets begin;
now the description of S is the substituted form of “You are [one of]in a dirty slum[or]in a street[or]in a beautiful and blablabla street[at random].”;
end repeat.[/code]

Are you still on 6G60? Because that works only on 6L02.

Yep, I’m still on 6G60 - my game’s in French and the french library isn’t available yet. But thanks again :slight_smile:

Oh. Well, Procedural Randomness works in 6G60. Or you could try this:

[code]A street is a kind of room.

First Avenue is a street. Second Avenue is a street, west of First Avenue. Third avenue is a street, west of Second Avenue. Lexington Avenue is a street, west of Third Avenue.
A street has some indexed text called the indexed description.

When play begins:
repeat with S running through streets begin;
now the indexed description of S is “You are [one of]in a dirty slum[or]in a street[or]in a beautiful and blablabla street[at random].”;
now the description of S is “[indexed description of the item described]”;
end repeat.[/code]

Trying to make this work really made me value the changes in 6L02! (In 6G60 you can’t use any of those temporary variables in text substitutions, which makes things more difficult.)

Yeah, that’s kind of important information to tell when asking a question because the differences are sometimes quite radical.

Ok, in the end I mixed all your exemples of code and finished with that

[code]World is a room.

Jo is a man in World.
Jack is a man in World.
John is a man in World.
Jonatan is a man in World.

A man has an indexed text called blabla.

When play begins:
repeat with S running through men begin ;
now the blabla of S is “[the printed name of S] is [one of]waiting for his man[or]has twenty-six dollars in his hand[or]is up to Lexington[at random]” ;
now the initial appearance of S is “[blabla of the item described]”;
end repeat.[/code]

Which works perfectly well for the EG60.

That’s incredibly cool.

And as usual the solution what so simple that I’m ashamed to have asked the question. Thanks to all of you :slight_smile: