Checking for Specific Flag...[UNSOLVED]

Is there a check if any objects in a room carry a particular flag? Liquidsource is the flag.

Like (GetScopeSurroundings.liquidsource=True) {
}

Or something like that? I might make it a command or something. Any ideas?

Anonynn.


Any object? objects in container, too? Or objects in the inventory when the player is in that room?


here are built-in objectlist get'ers (pick the one you want, I myself am still confused as to the difference between some of them and/or in what they mean, laughs, so good luck):

http://docs.textadventures.co.uk/quest/scopes.html

and an example of using them:

foreach (object_variable, YOUR_CHOSEN_SCOPE (POSSIBLE_PARAMETER_REQUIRED_FOR_IT)) {
  if (HasAttribute (object_variable, "liquidsource")) {
    // scripting
  }
}

// or:

foreach (object_variable, YOUR_CHOSEN_SCOPE (POSSIBLE_PARAMETER_REQUIRED_FOR_IT)) {
  if (GetAttribute (object_variable, "liquidsource") = DESIRED_VALUE) { // the ' = DESIRED_VALUE' isn't needed if it's a Boolean Attribute, as it'll automatically check if it's 'true' or if you have 'not' in front of the 'GetAttribute', it'll check if it's 'false (not true)'
    // scripting
  }
}

foreach (object, GetAllChildObjects (room))  {
  if (HasAttribute(object, "liquidsource"))  {
    msg (object)
  }
}

Or something similar to that.


Yes. On one particular object the player carries with them, when a certain verb on the item is clicked, I would like it to check all objects in that room for the "liquidsource" flag. ^_^ Thank you for all the responses!

Anonynn.


Log in to post a reply.

Support

Forums