Non-main character but still playable character interactions

Started by Mats Berglinn, Wed 14/12/2005 15:43:13

Previous topic - Next topic

Mats Berglinn

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.

Ashen

Either make the interactions dependant on the hamster not being the player character, e.g.:
Code: ags

//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.
I know what you're thinking ... Don't think that.

Mats Berglinn

Thanks, you never seem to fail to help me (which is a very good thing  :P ).

SMF spam blocked by CleanTalk