Error when using item.

I'm using the off-line editor.

I have an item: a fountain, which you can 'use' or 'drink'.

There are three possible results. The code is as follows:

  <drink type="script">
    do (this, "use")
  </drink>
  <use type="script"><![CDATA[
    if (fountain.drank = 0) {
      player.Courage = min (10, player.Courage + 3)
      fountain.drank = 1
      if (Got(wood)) {
        msg ("The water is fresh, clear and cold. You feel much better...until you realize that you have no idea how you came here. You look at the piece of wood you are carrying. The name <i>Amity</i> seems familiar. You recognize it as the name of your ship. Then, all of a sudden, it all comes back to you.")
      }
      else {
        MoveObject (player, fountain)
      }
    }
    else {
      msg ("The water is still refreshing. Its effect on your memory seems to only work once.")
    }

However, this is generating an error, and crashing the game.

Error running script: Error evaluating expression 'DictionaryItem(coordinates, coordinate)': The given key was not present in the dictionary.
Error running script: Error evaluating expression 'DictionaryItem(coordinates, coordinate)': The given key was not present in the dictionary.
Error running script: Error evaluating expression 'DictionaryItem(coordinates, coordinate)': The given key was not present in the dictionary.

(not a mistake--it prints the same message three times).


depopulate your code. Does the first part, just the drink part, work?


I don't think quest has a 'min' Function... did you create one?

HK edit: nvm, quest does have a 'min' Function

maybe, you can't do VARIABLE + concatenation for its Arguments/Parameters ??


I think it is a problem with the grid map system. I know it struggles if the player is teleported, and I see your code has the player move to the fountain. If there are no actual exits to the fountain, that would be like teleporting, and could be the cause. I have not used maps myself, but I seem to remember that turning the map off, then moving the player, and then turning it back on was the solution.


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

Support

Forums