Problems with GUIs (SOLVED)

Started by JudasFm, Fri 28/10/2005 14:49:21

Previous topic - Next topic

JudasFm

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 :)

Shane 'ProgZmax' Stevens

one solution (put this in the script for the button press):

if(player.ID==0) //joe
{
//swim
}
else //bob
{
//fly
}


JudasFm

That seems to have fixed it.  Thanks :D

strazer

In AGS v2.7, you could also do

  if (player == cJoe)

SMF spam blocked by CleanTalk