problem with invMain.ItemHeight (Solved)

Started by Volcan, Sat 22/12/2012 18:01:19

Previous topic - Next topic

Volcan

I got this error: room301.asc(17): Error (line 17): Expected ',' or ';', not '.'

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


Room 301 is the first room where the game starts.

Gilbert

Remove the 'int' before the inventory object.

Volcan

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

Khris

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.

Volcan

I got it.

Code: AGS
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.

Khris

While that works fine and is the place to set other stuff, like I explained, you can set this value here:


Volcan

#6
I know it already by clicking on the box with white border like I said. I mean the box in the inventory gui.


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.

SMF spam blocked by CleanTalk