check if ShowPlayerCharacter is true/false

Started by HandsFree, Sun 29/12/2013 18:53:54

Previous topic - Next topic

HandsFree

How can I check in the global script if ShowPlayerCharacter is set to false or true in the current room?
thanks

Crimson Wizard

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.

Dualnames

I believe ShowPlayerCharacter affects the transparency of the player, thus I believe, by a simple check
Code: AGS

if (player.Transparency==100)
{
//player not visible
}
else 
{
//player visible
}
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Crimson Wizard

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.

monkey0506

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.


SMF spam blocked by CleanTalk