very green.. question about a spin the bottle game

hello all, started to try messing around a bit with I7 and what im trying to do is make a spin the bottle game that is random…I have no idea though after the initial part…heres some code .

spinning is an action applying to one touchable thing and requiring light.
Understand “spin [something]” or “spins [something]” as spinning.

persuasion rule for asking people to try spinning:
persuasion succeeds.

after the actor spinning the empty wine bottle:
say “[the actor] spins the bottle and it lands on [a random person in game room ]”;
let N be the actor;
let P be the random person;
say “now you two have to kiss…make it a good one”.

/ now after the [a random person in game room] I just threw the let N be the actor and P the random person out of nowhere…what im trying to do is have the spinner and the random person who is chosen kiss but it is beyond me at the moment. Thank you

That’s close, the structure just needs to be reworked a bit, and fleshed out a little.

A minimally tested example:

Game Room is a room. 

A NPC is a kind of person. Alice, Bob, Joe, Marlene, and Susie are NPCs in the Game Room.  

The wine bottle is in the Game Room. A thing can be spinnable. The bottle is spinnable. 

Spinning it is an action applying to one visible thing and requiring light. 
Understand "spin [something]" as spinning it. 

Persuasion rule for asking a NPC to try spinning: 
	if the noun is not spinnable:
		say "It's called spin THE BOTTLE.";
	else:
		persuasion succeeds. 

Check spinning:
	if the noun is not spinnable:
		say "It's called spin THE BOTTLE.";
		rule fails.

Report someone spinning:
	let L be the list of people in the location;
	sort L in random order;
	remove the person asked from L;
	let P be entry 1 in L;
	say "[the person asked] spins the bottle and it points to [P]!";
	say "Now [the person asked] and [P] must kiss. Make it a good one!"

Report spinning:
	let P be a random NPC in the location;
	say "You spin the bottle and it points to [P]!";
	say "Now you and [P] must kiss. Make it a good one!"

test me with "alice, spin the bottle / spin bob / spin the bottle / marlene, spin susie"

Some explanation:

  1. Making the people NPCs just makes it easier to handle them for this action

  2. Making the bottle ‘spinnable’ makes it easier to write failure messages

  3. Checking for a spinnable thing in the persuasion rule (rather than in a check rule) makes the failure message cleaner for NPCs

  4. Inform does consider yourself a person in the location (who could be chosen randomly) so we can use the NPC kind to trap this when the player spins the bottle

Hope that helps some.

Thank you very much for the quick response.

not to be a nudge but i have another question regarding scenes. Just want to key a action to be the catalyst to start a new scene…used this as a simple exercise to do so but it didnt work-

game room is a room.

jack is a man in the game room.
jill is a woman in the game room.

first off is a scene.
first off begins when play begins.
first off ends when second act begins.

second act is a scene.
second act begins when the big red button is pushed.

Box is in game room. Big red button is part of box. The description of box is " A large box with a red button that says push me on it." The description of big red button is “It is red and says push me on it.”

persuasion rule for asking someone to try pushing something:
persuasion succeeds.

the error-

Problem. In the sentence ‘second act begins when the big red button is pushed’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘the big red button is pushed’.

Problem. You wrote ‘second act begins when the big red button is pushed’ : but ‘begins when’ and ‘ends when’ must be followed by a condition, which this does not seem to be.

I know this is bound to be something most likely obvious but at the moment I cant really figure out what that is.

You just need to change

second act begins when the big red button is pushed.

to

second act begins when we have pushed the big red button.

“when we have …” means “when anyone has …”, so it doesn’t matter whether it’s Jack, Jill, or the player who pushes the button; the second act will start as soon as anyone pushes the button.

excellent thank you so much.

…and I just caught an error in the Programmer’s Manual. Thanks Emily.

another quick question, the word yourself seems kind of clunky. How would I go about having the bottle point to “you” instead of to yourself? I know this is going to most likely be something very obvious.

Probably the most straightforward would be an if check in the say phrase, like “[if P is yourself]you[else][P][end if]”.

much thanks.