Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: HandsFree on Sun 29/12/2013 18:53:54

Title: check if ShowPlayerCharacter is true/false
Post by: HandsFree on Sun 29/12/2013 18:53:54
How can I check in the global script if ShowPlayerCharacter is set to false or true in the current room?
thanks
Title: Re: check if ShowPlayerCharacter is true/false
Post by: Crimson Wizard on Sun 29/12/2013 20:50:35
I don't think it is possible to do directly (which is unfortunate).

You may turn off "Enforce object-based scripting" and check "player.on" (should be = 0).
Another option is to make a room's custom property which would duplicate the setting for informational purposes.
Title: Re: check if ShowPlayerCharacter is true/false
Post by: Dualnames on Sun 29/12/2013 21:05:41
I believe ShowPlayerCharacter affects the transparency of the player, thus I believe, by a simple check
Code (AGS) Select

if (player.Transparency==100)
{
//player not visible
}
else
{
//player visible
}
Title: Re: check if ShowPlayerCharacter is true/false
Post by: Crimson Wizard on Sun 29/12/2013 21:31:45
Quote from: Dualnames on Sun 29/12/2013 21:05:41
I believe ShowPlayerCharacter affects the transparency of the player
No, it does not; it affects "character.on" variable.
Title: Re: check if ShowPlayerCharacter is true/false
Post by: monkey0506 on Mon 30/12/2013 05:18:22
Just checked to be sure, but player.on isn't dependent on old-style scripting. It was never part of the user interface, so STRICT ignores it completely and just lets it through. It's essentially the same as a proper Character.Visible property, except CJ said he had never fully taken the time to ensure that it was safe for the user to rely on it. AFAICT, it's perfectly safe for this type of usage though.
Title: Re: check if ShowPlayerCharacter is true/false
Post by: HandsFree on Mon 30/12/2013 15:35:51
Ok, I'll use player.on then.
thanks