Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Volcan on Sat 22/12/2012 18:01:19

Title: problem with invMain.ItemHeight (Solved)
Post by: Volcan on Sat 22/12/2012 18:01:19
I got this error: room301.asc(17): Error (line 17): Expected ',' or ';', not '.'

Code (AGS) Select
function room_Load()
{
gIconbar.Visible = false;
//int InvWindow.ItemHeight;
int invMain.ItemHeight = 27;
}


Room 301 is the first room where the game starts.
Title: Re: problem with invMain.ItemHeight
Post by: Gilbert on Sat 22/12/2012 18:40:36
Remove the 'int' before the inventory object.
Title: Re: problem with invMain.ItemHeight
Post by: Volcan on Sat 22/12/2012 19:06:49
With invMain.ItemHeight = 27;
I got: room301.asc(18): Error (line 18): Undefined token 'invMain'

With InvWindow.ItemHeight = 27;
I got: room301.asc(18): Error (line 18): must have an instance of the struct to access a non-static member
Title: Re: problem with invMain.ItemHeight
Post by: Khris on Sat 22/12/2012 19:21:54
You need the InvWindow's full script name, as it is displayed in its properties in the GUI editor.
If you're getting an 'undefined token' error, you are referencing something that doesn't exist.

Note that the auto-complete window will pop up after you have typed the first three letters, and if the thing you're trying to reference isn't listed in there, then it'll never work. (And frankly, to me it's a mystery why people don't use this feature properly.)

Also, why are you setting .ItemHeight in room_load? Is it going to change during the game? Because if it isn't, just set it in the InvWindow's properties.
Title: Re: problem with invMain.ItemHeight
Post by: Volcan on Sat 22/12/2012 19:45:50
I got it.

Code (AGS) Select
function game_start() {   
  // Put the code all in a function and then just call the function.
  // It saves cluttering up places like game_start.
  initialize_control_panel();
  invCustomInv.ItemHeight = 30;
  // Use the KeyboardMovement module to, per default, replicate the standard
  // keyboard movement of most Sierra games. See KeyboardMovement.txt for more info
  KeyboardMovement.SetMode(eKeyboardMovement_Tapping);
}


Also I clicked on the box with white border in Inventory gui. How did I miss it?

If I used the command in the room script, that's because I don't know how to use it untill now.

Thank you guys.
Title: Re: problem with invMain.ItemHeight (Solved)
Post by: Khris on Sun 23/12/2012 19:01:56
While that works fine and is the place to set other stuff, like I explained, you can set this value here:

(http://i.imgur.com/erCXl.png)
Title: Re: problem with invMain.ItemHeight (Solved)
Post by: Volcan on Sun 23/12/2012 20:51:40
I know it already by clicking on the box with white border like I said. I mean the box in the inventory gui.
(http://www.atariage.com/forums/gallery_ips/gallery/album_185/gallery_1196_185_11253.png)

Thanks for extra tips anyway.

QuoteAnd frankly, to me it's a mystery why people don't use this feature properly

People like me don't use auto-complete window feature but just copy and past commands from the manual.