The game I'm working on has an option to switch between characters. On the Interaction GUI there is a button reserved for 'special' actions. I want each character to be able to do something different when the player clicks on it but I can't get my head around the script :(
Example:
When controlling Joe, the player clicks on the Action button and Joe starts to swim.
When controlling Bob, the player clicks on the Action button and Bob starts to fly.
I can't get the GUI script to work on this at all. I'm using the latest version of AGS. Can someone please help me?
I did try the idea of having individual GUIs for each character, but that didn't work either, and it seemed pretty stupid for the sake of one button. I know what I need is a command along the lines of "if playercharacter=Joe then do this, else if playercharacter=Bob do this" but it doesn't seem to be working. Please help :)
one solution (put this in the script for the button press):
if(player.ID==0) //joe
{
//swim
}
else //bob
{
//fly
}
That seems to have fixed it. Thanks :D
In AGS v2.7, you could also do
if (player == cJoe)