Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mats Berglinn on Wed 14/12/2005 15:43:13

Title: Non-main character but still playable character interactions
Post by: Mats Berglinn on Wed 14/12/2005 15:43:13
I've stumbled across a problem in my current project. The game will have a hamster that you will be able to play as. When I tested the game, I noticed that you could interact (use, give, talk to etc.) when you play as the hamster. The main-character is non interactive character and that's not a problem but when it comes to the hamster I don't know how to make the character uninteractivble when it's in play and make it interactivable when it's not in play.

How do I solve this problem? In case you guys have forgot I'm using the 2.62 version of AGS.
Title: Re: Non-main character but still playable character interactions
Post by: Ashen on Wed 14/12/2005 15:49:20
Either make the interactions dependant on the hamster not being the player character, e.g.:

//Script for character1: Look at character
if (GetPlayerCharacter() != HAMSTER) Display("Yup, that's my hamster.");

(if (GetPlayerCharacter == EGO) ... would work, too.)
Or, when you change player character, use SetCharacterClickable (CHARID, is_clickable) to enable/disable clicks on the hamster character.


And obviously, you could do something similar to make the main character interactable, when you're playing as the hamster.
Title: Re: Non-main character but still playable character interactions
Post by: Mats Berglinn on Wed 14/12/2005 20:39:19
Thanks, you never seem to fail to help me (which is a very good thing  :P ).