TutorialsDijkstra’s Algorithm

Appendix B — Message Map

Weighted Maze 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, the Object the sender just created or the sender’s own Object.

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.

  • stepRequested → Step Trial → searchChanged → Slide Marker, Show Search Outline, Show Route Cost, Show Route Line
  • stepRequested → Step Trial → markerMoved → Slide Marker
  • findRequested → Find Route → findStarted → Show Find Caption

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

Message Sent by Goes to Heard by Chapter
placedOnMap Lay Out Map (on Map); Lay Out Route Lines (on Map) the Object it just created Paint Map Cell (on Map Cell); Show Search Outline (on Search Outline); Show Route Line (on Route Line, Route Line Backing) 1
paintRequested Paint Map Cell (on Map Cell) everyone who listens Change Terrain (on Maze Rules) 2
terrainChanged Paint Selected Cell; Restore Defaults (on Maze Rules) everyone who listens Paint Map Cell (on Map Cell); Reset Trial (on Maze Rules) 2
cellSettled Settle Cheapest Cell everyone who listens Show Settled Cell (on Status) 3
resetRequested Request Reset (on Reset Button) everyone who listens Reset Trial (on Maze Rules) 3
searchChanged Step Trial (on Maze Rules); Clear Trial everyone who listens Slide Marker (on Marker); Show Search Outline (on Search Outline); Show Route Cost (on Route Cost); Show Route Line (on Route Line, Route Line Backing) 3
stepRequested Ask For One Step; Find Route (on Maze Rules) everyone who listens; its own Object only Step Trial (on Maze Rules) 3
trialCleared Clear Trial its own Object only Step Trial (on Maze Rules); Find Route (on Maze Rules) 3
markerLanded Slide Marker (on Marker) everyone who listens Step Trial (on Maze Rules) 4
markerMoved Step Trial (on Maze Rules) everyone who listens Slide Marker (on Marker) 4
findRequested Request Find (on Find Route Button) everyone who listens Find Route (on Maze Rules) 5
findStarted Find Route (on Maze Rules) everyone who listens Show Find Caption (on Find Route Button) 5
findStopped Stop Finding everyone who listens Find Route (on Maze Rules); Show Find Caption (on Find Route Button) 5
pauseRequested Ask For One Step; Request Find (on Find Route Button) everyone who listens Find Route (on Maze Rules) 5
trialEnded End Trial its own Object only Find Route (on Maze 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: The Map and the Sidebar

B.3.1 placedOnMap

  • Sent by Lay Out Map (on Map), in “Lay Out Map”, to the Object it just created.
  • Sent by Lay Out Route Lines (on Map), in “Lay Out Route Lines”, to the Object it just created.
  • Heard by Paint Map Cell (on Map Cell): “Paint Map Cell”.
  • Heard by Show Search Outline (on Search Outline): “Show Search Outline”.
  • Heard by Show Route Line (on Route Line, Route Line Backing): “Show Route Line”.

B.4 Chapter 2: Paint the Maze

B.4.1 paintRequested

  • Sent by Paint Map Cell (on Map Cell), in “Paint Map Cell”, to everyone who listens.
  • Heard by Change Terrain (on Maze Rules): “Change Terrain”.

B.4.2 terrainChanged

  • Sent by Paint Selected Cell, in “when called”, to everyone who listens.
  • Sent by Restore Defaults (on Maze Rules), in “Restore Defaults”, to everyone who listens.
  • Heard by Paint Map Cell (on Map Cell): “Paint Map Cell”.
  • Heard by Reset Trial (on Maze Rules): “Reset Trial”.

B.5 Chapter 3: Settle One Cheapest Cell

B.5.1 cellSettled

  • Sent by Settle Cheapest Cell, in “when called”, to everyone who listens.
  • Heard by Show Settled Cell (on Status): “Show Settled Cell”.

B.5.2 resetRequested

  • Sent by Request Reset (on Reset Button), in “Request Reset”, to everyone who listens.
  • Heard by Reset Trial (on Maze Rules): “Reset Trial”.

B.5.3 searchChanged

  • Sent by Step Trial (on Maze Rules), in “Ready”, to everyone who listens.
  • Sent by Step Trial (on Maze Rules), in “Searching”, to everyone who listens.
  • Sent by Step Trial (on Maze Rules), in “Tracing”, to everyone who listens.
  • Sent by Clear Trial, in “when called”, to everyone who listens.
  • Heard by Slide Marker (on Marker): “Slide Marker”.
  • Heard by Show Search Outline (on Search Outline): “Show Search Outline”.
  • Heard by Show Route Cost (on Route Cost): “Show Route Cost”.
  • Heard by Show Route Line (on Route Line, Route Line Backing): “Show Route Line”.

B.5.4 stepRequested

  • Sent by Ask For One Step, in “when called”, to everyone who listens.
  • Sent by Find Route (on Maze Rules), in “Find Route”, to its own Object only.
  • Heard by Step Trial (on Maze Rules): “Ready”.
  • Heard by Step Trial (on Maze Rules): “Searching”.
  • Heard by Step Trial (on Maze Rules): “Tracing”.
  • Heard by Step Trial (on Maze Rules): “Replaying”.
  • Heard by Step Trial (on Maze Rules): “Waiting For Marker”.
  • Heard by Step Trial (on Maze Rules): “Finished”.

B.5.5 trialCleared

  • Sent by Clear Trial, in “when called”, to its own Object only.
  • Heard by Step Trial (on Maze Rules): “Step Trial”.
  • Heard by Find Route (on Maze Rules): “Find Route”.

B.6 Chapter 4: Finish a Route

B.6.1 markerLanded

  • Sent by Slide Marker (on Marker), in “Slide Marker”, to everyone who listens.
  • Heard by Step Trial (on Maze Rules): “Step Trial”.

B.6.2 markerMoved

  • Sent by Step Trial (on Maze Rules), in “Replaying”, to everyone who listens.
  • Heard by Slide Marker (on Marker): “Slide Marker”.

B.7 Chapter 5: Find and Pause

B.7.1 findRequested

  • Sent by Request Find (on Find Route Button), in “Request Find”, to everyone who listens.
  • Heard by Find Route (on Maze Rules): “Start Over”.
  • Heard by Find Route (on Maze Rules): “Start”.
  • Heard by Find Route (on Maze Rules): “Pause”.

B.7.2 findStarted

  • Sent by Find Route (on Maze Rules), in “Start”, to everyone who listens.
  • Heard by Show Find Caption (on Find Route Button): “Show Find Caption”.

B.7.3 findStopped

  • Sent by Stop Finding, in “when called”, to everyone who listens.
  • Heard by Find Route (on Maze Rules): “Find Route”.
  • Heard by Show Find Caption (on Find Route Button): “Show Find Caption”.

B.7.4 pauseRequested

  • Sent by Ask For One Step, in “when called”, to everyone who listens.
  • Sent by Request Find (on Find Route Button), in “Request Find”, to everyone who listens.
  • Heard by Find Route (on Maze Rules): “Find Route”.

B.7.5 trialEnded

  • Sent by End Trial, in “when called”, to its own Object only.
  • Heard by Find Route (on Maze Rules): “Find Route”.