list = GetDirectChildren(playerparent)
flag = false
foreach (obj, list) {
if (DoesInherit (obj, "monster")) {
flag = true
}
}
sgreig wrote:You could put the check in a turnscript so it will do the check every time the player takes an action. That's probably the best bet.
As for your other question, Quest doesn't have built-in support for that kind of thing. Parent objects in Quest are essentially containers. i.e. if you place an object in your inventory, you become that objects parent. The room you're in is the player's parent, etc.
There is the option of using types in Quest, which allows you to pass common attributes to objects. There was another thread about this recently in the forum and some people (Pertex I think) gave some code samples on how to do checks for an object's type.
The Pixie wrote:To expand on that, i would set up a new type "monster", and then have the monsters all inherit from that (on the attributes tab).
Then you can check for the room in a turnscript, get a list of objects, go though the list, and see if any inherit the monster type. In code, something like this:list = GetDirectChildren(playerparent)
flag = false
foreach (obj, list) {
if (DoesInherit (obj, "monster")) {
flag = true
}
}