Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: BlueAngel on Sun 06/02/2011 12:39:10

Title: How to make a character unseen (SOLVED)
Post by: BlueAngel on Sun 06/02/2011 12:39:10
Hi
I have a character (cboar2) behind a rock and I don’t want the player to know it’s there before he finds it. But if you have the mouse over the rock the action label tells you it’s there.
What to do?
This is my code:


function room_RepExec()
{
bool found;
int x, y;
 if(BoarOut==0)
 {
   cBoar2.Transparency=100;
 }
 else if(BoarOut==1)
 {
   cBoar2.Transparency=0;
 }
 if(!cBoar2.Moving){
 while(!found){
   x=Random(Room.Width);
   y=Random(Room.Height);
   if(Region.GetAtRoomXY(x,y)==region[2])found=true;

 }
 cBoar2.Walk(x, y, eNoBlock, eAnywhere);
}
}
Title: Re: How to make a character unseen
Post by: Wyz on Sun 06/02/2011 13:35:13
What you could do is set the 'Clickable' property of the boar initially to false.
As soon as theplayer has found it you'd set it to true:


// ...
cBoar2.Clickable = true;
// ...
Title: Re: How to make a character unseen
Post by: BlueAngel on Sun 06/02/2011 13:40:13
 :D
Thanks!
That did the trick!