Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jfarwyke on Wed 13/05/2009 13:04:28

Title: Error message when trying to disable IdleView on Region (SOLVED)
Post by: jfarwyke on Wed 13/05/2009 13:04:28
I get this error message when trying to run the following code...
function region1_Standing()
{
cPup.SpeechView = -1;
cPup.IdleView = -1;
}

Error (line 31): property 'Character::IdleView' is read-only

Just what does it mean by 'read-only'? And is there a different way to disable the IdleView on a region?
Thanks!
Title: Re: Error message when trying to disable IdleView on Region
Post by: Hudders on Wed 13/05/2009 13:28:42
Readonly means you can only use that property to get the status of IdleView, you can't set it using that command.

To disable it in a region, it would probably be easiest to create a new view and use SetIdleView to set it when in that region.
Title: Re: Error message when trying to disable IdleView on Region
Post by: Khris on Wed 13/05/2009 14:30:39
I'd use the other two region events:

function region1_WalksOnto() {
  cPup.SetIdleView(-1, 0);   // disable idle view
}

function region1_WalksOff() {
  cPup.SetIdleView(2, 10);
}
Title: Re: Error message when trying to disable IdleView on Region
Post by: jfarwyke on Wed 13/05/2009 14:46:38
The SetIdleView works perfectly, thanks! And yes, I ended up using the walks onto/off events. I have the region on a walkable area that has a specific view and with the standing event, if I move the cursor to the GUI toolbar, my character switches the normal view for some reason. In fact, I never have much luck with the standing event. But now it works perfect, so thanks guys.