MikeTaylor / scottkit

Scott Adams adventure toolkit: compile, decompile and play 80s-style adventure games
30 stars 10 forks source link

Order of occur differs for first room #35

Closed drewish closed 6 years ago

drewish commented 6 years ago

The order of events is for occurrences and looking is different when the game starts up from subsequent turns. I was hoping I could use an occur to print some initial help messages but it appears below the room description, items and exits when the game starts up. Frustratingly, subsequent entrances to the room give a different order:

Example game:

occur when at one
  print "I print a message when in room one."
room one "first room"
  exit up two
item junk "some junk"

occur when at two
  print "I print a message when in room two."
room two "second room"
  exit down one

Transcript:

ScottKit, a Scott Adams game toolkit in Ruby.
(C) 2010-2017 Mike Taylor <mike@miketaylor.org.uk>
Distributed under the GNU GPL version 2 license,

I'm in a first room
Obvious exits: Up.
I can also see: some junk

I print a message when in room one.
Tell me what to do ? u
I print a message when in room two.

I'm in a second room
Obvious exits: Down.

Tell me what to do ? d
I print a message when in room one.

I'm in a first room
Obvious exits: Up.
I can also see: some junk

Tell me what to do ? 

It seems like this should be handled consistently. We could do this easily by removing the actually_look call from prepare_to_play.

MikeTaylor commented 6 years ago

Thanks for your patience. Your analysis is correct. I'll make the change you suggest.