Skip to content

What would be the easiest way to create a "before taking" script? #1282

Discussion options

You must be logged in to vote

I think the easiest way to do this would be including it in TestTakeGlobal.

Something like…

  <function name="TestTakeGlobal" parameters="object, prefix" type="boolean">
    // Existing behaviour of TestTakeGlobal, used to prevent player taking anything:
    if (HasString(game.pov, "notallowedtotake")) {
      msg (game.pov.notallowedtotake)
      return (false)
    }

    // Back up value of object.cannotbetaken, so that if beforetrytaking or before taking changes it
    //    we can revert to its original value later
    connotbetaken = object.cannotbetaken
    if (HasString (object, "beforetryingtaking")) {
      msg (prefix + object.beforetryingtaking)
      prefix = ""
    }
    else…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@KVonGit
Comment options

KVonGit Dec 11, 2024
Collaborator Author

@KVonGit
Comment options

KVonGit Dec 11, 2024
Collaborator Author

Answer selected by KVonGit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants