Creating a to do list that updates when missions are completed

Hi,

I'd like to have an object in the game which is a to-do list, that has the main quest missions of my game written down, e.g.

  1. Find fuel
  2. Scare the gamekeeper

etc.

But I'd like to update the list with either strikethrough text or a tick next to the mission item (if an object flag = X), and perhaps add an item to this list later in the game.


So...
How many things are on the To Do list?


Four


For the general case, I'd make this a stringdictionary.

Off the top of my head:

<object name="todolist">
  <alias>To-do list</alias>
  <look type="script">
    result = "<u>To-do list</u><ul>"
    foreach (item, this.items) {
      test = DictionaryItem (this.items, item)
      if (Eval (test)) {
        result = result + "<li><s>"+item+"</s></li>"
      }
      else {
        result = result + "<li>"+item+"</li>"
      }
      msg (result + "</ul>")
    }
  </look>
  <attr name="items" type="stringlist">
    <item>
      <key>Find fuel</key>
      <value>GetBoolean (fuel tank, "hasbeenmoved")</value>
    </item>
    <item>
      <key>Scare the groundskeeper</key>
      <value>groundskeeper.is_scared</value>
    </item>
    <item>
      <key>Take damage</key>
      <value>not game.pov.health = 100</value>
    </item>
  </attr>
</object>

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums