I’m not sure where to put this, but anyway. I’m trying to get it so that I can group a kind in my extension.
A hostile is a kind of person.
If the location of the player is the location of a hostile:
But it gives me an error. Is there a way I can do this, rather than getting people to edit the extension every time they want another hostile to shoot them? Without just making them all called “Hostile”?
Thanks for any help.
In general, questions about how to code something go in the board for the system or language you’re using to write IF. So, for instance, this question would go in the Inform 6 and 7 Development board (and I’ve now moved it there).
“If a hostile is in the location”.
I think that “a hostile is in the location” won’t trigger if the hostile is in container or on a supporter–you might or might not want that to happen. If you want to include containers and supporters “If the location encloses a hostile should work.”
If you want to do something more complicated–like, you want to include a hostile that’s on a platform but you don’t want to include a hostile that’s in a closed wardrobe–well, it gets more complicated.
You can also use “if a hostile is visible” to check whether the player can see an enemy (which might be standing on a table, or inside a transparent glass case, but not inside a packing crate), or “if a hostile is touchable” to check whether the player can physically reach it (so the enemy could be on a table, but not in the glass case). There are lots of variations on this depending exactly what you want to do.