I want to be able to manipulate a room object in the current room from the global script.
Currently I'm using on_call() and CallRoomScript(), as follows:
In my global script (note the diagnostic messages)
Display("About to call on_call()");
CallRoomScript(1);
Display("Returned from on_call()");
In the script for the room that is current when CallRoomScript() is called:
function on_call(int value)
{
Display("In on_call(); value == %d", value);
//blah
}
When I run my script, the messages displayed are:
About to call on_call()
Returned from on_call()
which shows that the function wasn't called.
What am I doing wrong? Incidentally, I wrote on_call at the end of my room script just by opening the whole room script in the editor (rather than just a section of it). Is it meant to be in a section (with grey start and end lines)? There doesn't seem to be a menu option for on_call anywhere.
Alternatively, is there a way of directly accessing and manipulating room objects from the global script? Something like the following:
room[n].objects[m].SetPosition(x, y);
Thanks.
Currently I'm using on_call() and CallRoomScript(), as follows:
In my global script (note the diagnostic messages)
Display("About to call on_call()");
CallRoomScript(1);
Display("Returned from on_call()");
In the script for the room that is current when CallRoomScript() is called:
function on_call(int value)
{
Display("In on_call(); value == %d", value);
//blah
}
When I run my script, the messages displayed are:
About to call on_call()
Returned from on_call()
which shows that the function wasn't called.
What am I doing wrong? Incidentally, I wrote on_call at the end of my room script just by opening the whole room script in the editor (rather than just a section of it). Is it meant to be in a section (with grey start and end lines)? There doesn't seem to be a menu option for on_call anywhere.
Alternatively, is there a way of directly accessing and manipulating room objects from the global script? Something like the following:
room[n].objects[m].SetPosition(x, y);
Thanks.