toggle object visibility in character script (solved)

Started by Sparky, Thu 23/11/2006 07:40:40

Previous topic - Next topic

Sparky

Hello, and good day to you all. I'm wondering if it is possible to toggle an object's visibility from within a character's script. My first effort was this:
// script for Character 2 (man): Talk to character
   oThing.Visible = false;
When I try to test the game, I receive the following error:
"Error (line 408): Undefined token 'oThing'"
I presume this is because the object in question isn't local to the character script. Perhaps there's a way to call a room function from within this character's script, and then change the object's visibility from the room script?

SSH

If the character is only ever in one room, you can just use object[WHATEVERNUMBER].Visible
12

Khris


Sparky

Great, that works perfectly. The script now uses a player.Room check, then sets object[number].Visible = false. I'm going to mess with CallRoomScript() as well, I'm sure that will come in handy in a lot of situations. Thanks for the help, I wasn't having any luck finding answers to that question via the usual means.

SMF spam blocked by CleanTalk