Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Melee Island Resident on Thu 16/06/2011 22:03:01

Title: I am trying to make a full throttle style control GUI
Post by: Melee Island Resident on Thu 16/06/2011 22:03:01
on this line a get an error message

if (mouse.IsButtonDown (eMouseLeft)  gIconbar.Visible = true == 0)

GlobalScript.asc(74): Error (line 74): Parse error in expr near 'gIconbar'

could someone please explain to me what is wrong with this in a way that a four year old could understand?
it's just I'm having a really hard time when I get error messages like these
Title: Re: I am trying to make a full throttle style control GUI
Post by: barefoot on Thu 16/06/2011 22:12:04
Do you want the gIconBar to be visible when mouse button down?

I think the last bit in your code is wrong

gIconbar.Visible = true == 0  (doesn't make sense)





Title: Re: I am trying to make a full throttle style control GUI
Post by: Matti on Thu 16/06/2011 22:13:50
You forgot a parenthesis and I don't know what the end of your line is supposed to do:

if (mouse.IsButtonDown (eMouseLeft))  gIconbar.Visible = true;
Title: Re: I am trying to make a full throttle style control GUI
Post by: Melee Island Resident on Thu 16/06/2011 22:29:40
I'd like it to be when the mouse button is held down the GUI becomes visible
Title: Re: I am trying to make a full throttle style control GUI
Post by: Melee Island Resident on Thu 16/06/2011 22:30:38
thank you matti
Title: Re: I am trying to make a full throttle style control GUI
Post by: Melee Island Resident on Thu 16/06/2011 22:38:14
i got the script from a very old thread, so some things are obsolete

   holddown ++;
   if (holddown >= 40) {
        holddown = 0;
       gIconbar.Visible = true;

GlobalScript.asc(75): Error (line 75): Undefined token 'holddown'

what is the newer equivalent of this script?
Title: Re: I am trying to make a full throttle style control GUI
Post by: Hernald on Thu 16/06/2011 22:49:06
You need to define holddown as an integer and put a curly bracket at the end, other than that the code looks workable.
Oh yes, and it's part of a while loop or in execute repeatedly, and when you define holddown give it an initial value of 0.
Title: Re: I am trying to make a full throttle style control GUI
Post by: Khris on Thu 16/06/2011 22:53:37
You need to get the syntax and other programming conventions straight.
This is a good starting point:
http://www.adventuregamestudio.co.uk/actutor.htm