Okay...
Here's what I (think) I've got figured out:
Here's what I'd very much like to figure out:
AllObjects()
. I tried it as a script, a string, a list, a dictionary... I couldn't figure it out.My wish is to interact with any given NPC in any given room via two-way radio.
NPC, COME IN
That's the command I'm after. I'm trying not to clone or move anything around and only work with the ask attribute on each NPC.
OVER AND OUT would 'disconnect', placing the NPC back out of scope.
Is this possible?
I believe that Commands, with an '#object#' Parameter, it is just/only searching the parent room that you're in. So, you got to use the '#text#' Parameter instead, to handle it:
(you may be able to use the '#object#' Parameter, but I think the built-in stuff for it, will do the Command's 'default' String Attribute, upon not finding the Object within the parent Room Object of the Player Object, so you might have to change the built-in scripting for it... but maybe not too... not tested if your Command's scripting will over-ride the built-in scripting of it)
(this is also going to include extra coding, credit to Pertex as it's his coding, for handling the person entering in the 'alias', as usually this is what the person playing the game is knowing about, and not the Object's name, which is often hidden, used for the game maker's organization and structure)
<command name="example_command">
<pattern>example #text_parameter#</pattern>
<script>
input_object_variable = GetObject (text_parameter)
if (input_object_parameter = null) {
foreach (object_variable, AllObjects ()) {
if (object_variable.alias = text_parameter) {
input_object_variable = object_variable
}
}
}
if (input_object_variable = null) {
msg ("Your inputted Object doesn't exist in the game, wrong input, try again")
} else {
// your scripting for whatever you want to do with the inputted Object
}
</script>
</command>