trying to disable a character

Started by jesternario, Mon 05/04/2010 23:43:52

Previous topic - Next topic

jesternario

I'm trying to make it so a character appears after a ceartain event, so I made him completely transparent until said event happens. The problem is that he's still clickable, even when he's "not there."

Am i missing somthing? Help would be much obliged.

tzachs


Crimson Wizard

You can also make him start into non-existing Room 0 and teleport to current room when needed using cCharacter.ChangeRoom() function. In this case you won't need to set Clickable property on/off.

monkey0506

Or..I have one too! You could set his coordinates to some off-screen location and then just manually change his x and y properties when you need him to appear. :D

Within the script there's a slew of ways to accomplish things like this. If you're planning on having the character slowly fade in and you've already set his Transparency, I'd say the simplest thing to do would be:

Code: ags
function room_RepExec() {
  cFrank.Clickable = (cFrank.Transparency == 0);
}


If you just want him to appear without a fade then the other solutions work just as well.

jesternario

the first idea worked well enough for me. thanks for the suggestions

SMF spam blocked by CleanTalk