Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Blano on Sun 25/08/2024 16:44:56

Title: [solved] setasplayer
Post by: Blano on Sun 25/08/2024 16:44:56
Hello guys,

i'm trying to test my "player change" but i cannot see the error:


i want change player character everytime i click on another  npc is this feasible?
something like this:




function cKubik_AnyClick(Character *theCharacter, CursorMode mode)
{
cKubik.SetAsPlayer();
}



Thank you friends!
Title: Re: setasplayer
Post by: eri0o on Sun 25/08/2024 17:10:44
I don't understand, are getting an error message? Can you tell what is it?
Title: Re: setasplayer
Post by: Blano on Sun 25/08/2024 18:37:33
I'm trying to code a script that by clicking on character2, it becomes the player...
I set character2 to be clickable and set the script to anyclick (for now) and it doesn't seem to do anything, so the player is always character1
Title: Re: setasplayer
Post by: Snarky on Sun 25/08/2024 20:50:55
This is generally because you haven't linked the function to the event (in the Character event pane).
Title: Re: setasplayer
Post by: Blano on Mon 26/08/2024 13:55:01
i solved the issue:

i forgot to change mouse.mode hovering the character..

Thank you all guys
Title: Re: [solved] setasplayer
Post by: Khris on Tue 27/08/2024 10:40:24
Did you click the character with the walk cursor? IIRC that's the only one that doesn't trigger "any click on"