intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Jul 22, 2018 7:52 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Jul 11, 2018 10:48 am 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
I want to introduce ambience to my rooms. For this I want to have a rule that basically looks like this:

Code:
Every turn when the player is in a room:
   if a random chance of 1 in 4 succeeds:
      choose a random row in the Table of #room# ambience;
      say "[italic type][ambience entry][roman type][paragraph break]"


#room# should be the name of the room. How is this done?
Thanks for your help. :)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Jul 11, 2018 11:26 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2634
Location: The Midwest
You'll need to associate your rooms with tables somehow.

Code:
Every room has a table name called the ambiance. The ambiance of the Beach is the Table of Outdoor Ambiance.

…choose a random row in the ambiance of the location;


This also lets you use the same table for multiple rooms if you like.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jul 14, 2018 6:13 am 
Offline

Joined: Sat Oct 17, 2015 5:48 am
Posts: 61
Perhaps better:

Code:
Every room in [ambiance region] has a table name called the ambiance. The ambiance of the Beach is the Table of Outdoor Ambiance.

…choose a random row in the ambiance of the location;


that is, regionalising the ambiance, avoiding adding empty tables to non-ambianced rooms (empty properties and/or tables are potential source of obscure and/or hard to hunt bugs)

Best regards from Italy,
dott. Piergiorgio.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jul 14, 2018 12:50 pm 
Offline

Joined: Wed Nov 12, 2008 5:33 am
Posts: 65
this is all very helpful. however, can I also write "can have a table" so I'm not forced to have empty tables?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jul 14, 2018 1:23 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5311
Location: Burlington, VT
I don't think so. But you could make a kind of room and make sure those are the only ones with tables:

Code:
An ambience-room is a kind of room. Every ambience-room has a table name called the ambiance. The ambiance of the Beach is the Table of Outdoor Ambiance.

…choose a random row in the ambiance of the location;


You can also give lots of rooms the same ambience, like this:

Code:
An ambience-room is a kind of room. Every ambience-room has a table name called the ambiance. The ambience of an ambience-room is usually the table of Nothing Interesting Happening. The ambiance of the Beach is the Table of Outdoor Ambiance.

Table 1 -- Table of Nothing Interesting Happening
ambience
""


(I may not have formatted the table correctly.)


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group