TutorialsBinary Search

Appendix B — Message Map

Crack the Safe is built on messages (Custom Events): one piece of the game announces something, and the pieces that care listen. This map shows every message in the game: who sends it, who it goes to, and who hears it. A message must be spelled exactly the same where it is sent and where it is heard; this is the place to check.

Two ways to send. Trigger Custom Event goes to everyone who listens (a broadcast). Trigger Custom Event on Object goes to one Object only; in this game a button’s message to Safe Rules: each button holds Safe Rules in a Variable (@self.safeRules) and its Custom Event in another (self.clickEvent).

B.1 Chains to Follow

Read each line left to right: a message, the Logic (in bold) that hears it and sends the next message, and at the end the Logic that hears the last one.

B.2 All Messages, in the Order the Build Adds Them

Message Sent by Goes to Heard by Chapter
backClicked Safe Button (on Back Key) Safe Rules only Button Clicks (on Safe Rules) 1
newSafeClicked Safe Button (on New Safe Button) Safe Rules only Button Clicks (on Safe Rules) 2
scanClicked Safe Button (on Scan Button) Safe Rules only Button Clicks (on Safe Rules) 2
changeCodeClicked Safe Button (on Change Code Button) Safe Rules only Button Clicks (on Safe Rules) 4
computerTabClicked Safe Button (on Role Tab) Safe Rules only Button Clicks (on Safe Rules) 4
humanTabClicked Safe Button (on Role Tab) Safe Rules only Button Clicks (on Safe Rules) 4
lockCodeClicked Safe Button (on Lock Code Button) Safe Rules only Button Clicks (on Safe Rules) 4
roleChosen Choose Human Role; Choose Computer Role; Watch Computer everyone who listens Show In Situation (on Entry Caption, Digit Key, Back Key, Scan Button, New Safe Button, Human Goal, Computer Goal, Search Readout, Code Caption, Last Guess Caption, Found Code Caption, Search Title, Midpoint Formula, Lock Code Button, Change Code Button, Step Button, Run Button, Pause Button, Watch Computer Button); Show Selected Role (on Role Tab); Run Search (on Safe Rules); Show Human Result (on Human Result) 4
stepClicked Safe Button (on Step Button) Safe Rules only Button Clicks (on Safe Rules) 4
closeLessonClicked Safe Button (on Close Lesson Button) Safe Rules only Button Clicks (on Safe Rules) 5
lessonChanged Open Myth Lesson; Close Myth Lesson everyone who listens Run Search (on Safe Rules); Show With Lesson (on Myth Lesson Panel, Lesson Line, Close Lesson Button) 5
mythLessonClicked Safe Button (on Myth Lesson Button) Safe Rules only Button Clicks (on Safe Rules) 5
pauseClicked Safe Button (on Pause Button) Safe Rules only Button Clicks (on Safe Rules) 5
runChanged Run Search (on Safe Rules) everyone who listens Show In Situation (on Entry Caption, Digit Key, Back Key, Scan Button, New Safe Button, Human Goal, Computer Goal, Search Readout, Code Caption, Last Guess Caption, Found Code Caption, Search Title, Midpoint Formula, Lock Code Button, Change Code Button, Step Button, Run Button, Pause Button, Watch Computer Button) 5
runClicked Safe Button (on Run Button) Safe Rules only Button Clicks (on Safe Rules) 5
watchComputerClicked Safe Button (on Watch Computer Button) Safe Rules only Button Clicks (on Safe Rules) 5

From here on, each message has a list of its own, under the chapter that adds it. The name in quotes is the Mode that sends or hears it. An Event with only one Mode has it under its Logic Component’s name, and a Function sends “when called”.

B.3 Chapter 1: Safe Room

B.3.1 backClicked

  • Sent by Safe Button (on Back Key), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Erase”.

B.4 Chapter 2: Human Scan

B.4.1 newSafeClicked

  • Sent by Safe Button (on New Safe Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Start Another Safe”.

B.4.2 scanClicked

  • Sent by Safe Button (on Scan Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Scan”.

B.6 Chapter 5: Run and Compare

B.6.1 closeLessonClicked

  • Sent by Safe Button (on Close Lesson Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Close the Lesson”.

B.6.2 lessonChanged

  • Sent by Open Myth Lesson, in “when called”, to everyone who listens.
  • Sent by Close Myth Lesson, in “when called”, to everyone who listens.
  • Heard by Run Search (on Safe Rules): “Stop for the Lesson”.
  • Heard by Show With Lesson (on Myth Lesson Panel, Lesson Line, Close Lesson Button): “Follow the Lesson”.

B.6.3 mythLessonClicked

  • Sent by Safe Button (on Myth Lesson Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Open or Close the Lesson”.

B.6.4 pauseClicked

  • Sent by Safe Button (on Pause Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Pause”.

B.6.5 runChanged

  • Sent by Run Search (on Safe Rules), in “Start the Timer”, to everyone who listens.
  • Sent by Run Search (on Safe Rules), in “Stop the Timer”, to everyone who listens.
  • Heard by Show In Situation (on Entry Caption, Digit Key, Back Key, Scan Button, New Safe Button, Human Goal, Computer Goal, Search Readout, Code Caption, Last Guess Caption, Found Code Caption, Search Title, Midpoint Formula, Lock Code Button, Change Code Button, Step Button, Run Button, Pause Button, Watch Computer Button): “Follow Run”.

B.6.6 runClicked

  • Sent by Safe Button (on Run Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Run”.

B.6.7 watchComputerClicked

  • Sent by Safe Button (on Watch Computer Button), in “Press”, to Safe Rules only.
  • Heard by Button Clicks (on Safe Rules): “Watch”.

B.7 Game State Changes (Sent by the Engine)

Set Game State makes the engine send Game State Changed to everyone who listens.

  • Follow the Clue sets Unlocked in “when called”.
  • Follow the Clue sets Exhausted in “when called”.
  • Start New Safe sets Locked in “when called”.
  • Start Code Setup sets Setup in “when called”.
  • Lock Code sets Locked in “when called”.
  • Watch Computer sets Locked in “when called”.
  • Heard by: Show Safe Door, Show In Situation, Show Search Readout, Run Search, Show Human Result.