I am very new to Inform and am finally giving writing IF a go. I've been tearing through tons of examples online, but I'm not sure what the recommended methods are for my three basic questions.
When I drill down into detail about a room, should I just constantly create a new item with "Is scenery" for each detail the player may want to look at. Putting aside my OCD attention to detail
, I have a room, which has a table, which when looked at has some odds and ends like "scattered plates", and the plates are stained from last nights meal. None of this is there for game play purposes or are usable items. I don't want the table to support objects or plates to be picked up. It's all just dressing if a player wanted to dig deep into details just for the fun of it.
Way I see it, there are two schools on this. The first is the most straightforward: model each of these as a scenery object and provide innocuous error messages whenever the player tries to interact beyond superficial examination (i.e "The [x] is unimportant." or "You try to push [y]). The second school employs shorthand. Here, you group the objects together so that the table, dishes, tablecloth etc actually refer to the same object, thus logically grouping related items together. For an example of this technique in action, check out The Dreamhold
by zarf (specifically, the glass-fronted cabinet and its contents).
Which technique is best is a matter of taste. Some players are fine with different objects being represented by a single one, others feel it's cheap and/or boring. Your mileage may vary.
Will that create issues having so many objects or lines of code? Should I write is as some sort of command: Instead of "x table" say "The table has four legs..."?
No. God no. Bearing in mind I'm no I7 maven, I still can't see how command substitution could possibly end well. Scenery objects are barely significant in terms of size, so you won't really gain anything by overriding the object tree model in this way.
Or is creating a multitude of scenery objects simply the price to pay for going nuts with details?
It depends. Realistically, there's always going to be a cutoff point somewhere; for me it's when there are so many similarly named objects in the same room that the parser picks the wrong one. Barring that, you're free to go wild.
Second question, if I write a new action such as "scrub floor", how does Inform know it applies only to a specific room where scrubbing is important to the story versus a command of scrubbing that I want available no matter where the player goes?
Generally, when you want to restrict actions, you add a check rule or an instead rule to block undesired actions, as below (I used a check rule):
A room can be dirty or clean. A room is usually clean.
Floor-scrubbing is an action applying to nothing.
Understand "scrub floor" as floor-scrubbing.
Check floor-scrubbing when the location is not dirty: say "The floor here doesn't need scrubbing." instead.
Carry out floor-scrubbing: now the location is clean.
Report floor-scrubbing: say "You scrub the floor until you can see your own reflection."
The Parlor is a room. The Porch is west of the parlor. The porch is dirty.
Third question, if I want to help guide a player away from actions that I don't want, must I define the action first, then create another line of what to say in place of "That's not a verb I recognise." Two separate lines? Or is there an easier way to write one line that accomplishes 'instead of doing an action you dont understand, just say this'?
You can use the technique of "understanding mistakes
Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.").
in such cases.