Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jesternario on Mon 05/04/2010 23:43:52

Title: trying to disable a character
Post by: jesternario on Mon 05/04/2010 23:43:52
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.
Title: Re: trying to disable a character
Post by: tzachs on Mon 05/04/2010 23:48:02
cEgo.Clickable = false;
Title: Re: trying to disable a character
Post by: Crimson Wizard on Tue 06/04/2010 00:53:12
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.
Title: Re: trying to disable a character
Post by: monkey0506 on Tue 06/04/2010 01:01:36
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:

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.
Title: Re: trying to disable a character
Post by: jesternario on Tue 06/04/2010 01:51:07
the first idea worked well enough for me. thanks for the suggestions