Undefined token 'SetCharacterView'

Started by Bryan_abos, Fri 08/09/2017 06:54:38

Previous topic - Next topic

Bryan_abos

I want to "hide" my main character, and only show it if a hotspot is clicked.
The idea is to change the character's view  by clicking that hotspot.

I did THIS but a message says "Undefined token 'SetCharacterView'":
       
Code: ags

function room_Load()
{
  gMaingui.Visible = false;
  gAction.Visible = false;
  SetCharacterView(cEgo, 19);
}

function cPito_AnyClick()
{
  RestoreWalkableArea(1);
  SetCharacterView(cEgo, 20);
}


Kitty Trouble

From the help pages:

QuoteLockView
(Formerly known as SetCharacterView, which is now obsolete)

Code: ags
Character.LockView(int view)


Sets the character's view to VIEW. This can be used to perform animations with characters, for example bending down to pick something up, which don't use the default view.
NOTE: This function locks the character's view to the specified view, so that it can only be changed by other script commands (ie. it won't automatically be changed by AGS on walkable areas, screen changes, etc). When you are done with the animation, call UnlockView to allow AGS to take control back.

Example:

Code: ags
cEgo.LockView(12);
cEgo.Animate(0, 0, eOnce, eBlock, eForwards);
cEgo.UnlockView();


will change the character's EGO view to view 12, perform an animation using loop 0, wait until the animation finishes and then return the character to his normal view.

Khris

The AGS language went through a significant change from 2.62 to 2.7; I don't know where you got that command from, but when you search for stuff on the forums, you should be wary of code from 2005 and earlier.

eri0o

You can use player.Transparency and set to 100 to hide and back to 0 to show again.

SMF spam blocked by CleanTalk