Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: .M.M. on Sat 13/10/2007 17:16:56

Title: GraphicalVariable [SOLVED]
Post by: .M.M. on Sat 13/10/2007 17:16:56
Where's problem in script

  if (keycode==377) && (SetGraphicalVariable ("Up",0)) cBall.Walk (258, 86, eNoBlock, eAnywhere);
Title: Re: GraphicalVariable
Post by: Gilbert on Sat 13/10/2007 17:38:17
You need to enclose the conditions with ():
  if ((keycode==377) && (SetGraphicalVariable ("Up",0))) cBall.Walk (258, 86, eNoBlock, eAnywhere);

Or, simply:
if (keycode==377 && SetGraphicalVariable ("Up",0)) cBall.Walk (258, 86, eNoBlock, eAnywhere);

However, What're you going to archive by setting the Graphical Variable to 0 in the condition?

Or, you're trying to check if the variable is 0?

In that case:
if (keycode==377 && GetGraphicalVariable ("Up")==0) cBall.Walk (258, 86, eNoBlock, eAnywhere);
Title: Re: GraphicalVariable
Post by: Dualnames on Sat 20/10/2007 00:05:58
So is this problem solved? Please post something I'm getting bored checking this out.
Title: Re: GraphicalVariable
Post by: .M.M. on Mon 22/10/2007 14:14:58
Yes, this is solved- thanks!