Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Danruto on Fri 29/02/2008 16:34:29

Title: Undefined Token 'SetPlayerCharacter' - SOLVED
Post by: Danruto on Fri 29/02/2008 16:34:29
Hi there,

I'm very new to AGS and am using it to learn base scripting. I've been trying to use the 'SetPlayerCharacter' command to allow a switch between two onscreen chars I have got after choosing to interact with a hotspot. The room code is as follows:

function hPrestswitch_Interact()
{
SetPlayerCharacter() (cChan.SetAsPlayer()
}

function hChanswitch_Interact()
{
SetPlayerCharacter() (cPrest.SetAsPlayer()
}

However wen trying to run the game and error occurs stating: 'Undefined token 'SetPlayerCharacter'

I understand this is more than likely a simple issue pertaining to my complete lack of experience with coding, if someone could point me in the right direction I would really appreciate it.

I have searched the forums and read the BFAQ but get the feeling I'm missing something very straight forward.

Thank you for your time.
Title: Re: Undefined Token 'SetPlayerCharacter'
Post by: Akatosh on Fri 29/02/2008 17:28:15
Yes you are. Actually, it would just be


cChan.SetAsPlayer();


and


cPrest.SetAsPlayer();


respectively. I'm pretty sure it's explained in the manual, though. Also, welcome to the forums!  ;)
Title: Re: Undefined Token 'SetPlayerCharacter' - SOLVED
Post by: Danruto on Fri 29/02/2008 17:57:06
I serached the manual for SetPlayerCharacter (referenced in the BFAQ) not SetAsPlayer, this is where I got lost I guess.

anyway..

Awesome THX!!!!!