Labels and variables (Solved)

Started by Volcan, Fri 30/11/2012 00:33:33

Previous topic - Next topic

Volcan

I use this code to show the floor number in the elevator.

Code: AGS
if (Etages==99) Label26.Text = "Floor: 99";
  if (Etages==98) Label26.Text = "Floor: 98";
  if (Etages==97) Label26.Text = "Floor: 97";


Is it an easier way to use Variables with Labels?



LOL. I just discovered the number of buttons I can put in the guis.

Khris

Not sure what you meant by that last sentence but here's how to do it:

Code: ags
  Label26.Text = String.Format("Floor: %d", Etages);

Volcan

Thank you. The code works.

QuoteNot sure what you meant by that last sentence

I mean I got this message when creating this GUI."You already have the maximum number of controls of the GUI and cannot add any more."  It's supposed to have more buttons.

Crimson Wizard

#3
Quote from: Volcan on Fri 30/11/2012 13:48:09
I mean I got this message when creating this GUI."You already have the maximum number of controls of the GUI and cannot add any more."  It's supposed to have more buttons.
Since your buttons are strictly aligned in rows and columns, you may emulate them by manually drawing on gui surface, and calculate pressed "button" by mouse coordinates.

Also, for the reference, AGS limits: http://www.adventuregamestudio.co.uk/wiki/?title=Reference_(manual)#System_limits

Volcan

Quote from: Crimson Wizard on Fri 30/11/2012 13:53:52
Quote from: Volcan on Fri 30/11/2012 13:48:09
I mean I got this message when creating this GUI."You already have the maximum number of controls of the GUI and cannot add any more."  It's supposed to have more buttons.
Since your buttons are strictly aligned in rows and columns, you may emulate them by manually drawing on gui surface, and calculate pressed "button" by mouse coordinates.

30 controls would be enough. But if my game become complex, I'll start a new thread about it.

Quote from: Crimson Wizard on Fri 30/11/2012 13:53:52
Also, for the reference, AGS limits: http://www.adventuregamestudio.co.uk/wiki/?title=Reference_(manual)#System_limits

There is no word about how many rooms AGS supports. Since AGS supports infinite GUis, variables, why not infinite rooms as well.

Slasher

QuoteThere is no word about how many rooms AGS supports.

Room numbers below 300 save the room state; numbers above 300 do not.

Volcan

#6
Quote from: slasher on Fri 30/11/2012 17:25:45
QuoteThere is no word about how many rooms AGS supports.

Room numbers below 300 save the room state; numbers above 300 do not.

I created the room 414. AGS turns to 300. After I renamed it to 414, the game accepts it.

I played the game. I saved the game at the room 414 and later I restored the game. I have no problem with that.

Khris

Yes, but the ROOM's STATE isn't saved.
If you turn an object invisible, save the game, then restore it, the object won't be invisible any longer.
The same is true for any room variables you might have declared.

Crimson Wizard

Quote from: Volcan on Sat 01/12/2012 00:57:17
I created the room 414. AGS turns to 300. After I renamed it to 414, the game accepts it.
Unless you enable checkbox "Do not save state in this room" when create a new room, Editor automatically changes room number to some below 301.

Volcan

#9
Quote from: Khris on Sat 01/12/2012 15:15:40
Yes, but the ROOM's STATE isn't saved.
If you turn an object invisible, save the game, then restore it, the object won't be invisible any longer.
The same is true for any room variables you might have declared.

Thank you for the tip. I didn't know about save state until now.

But for the original question, how many rooms AGS supports. I guess it's unlimited rooms like I said.

Crimson Wizard

#10
Quote from: Volcan on Sat 01/12/2012 17:13:09
But for the original question, how many rooms AGS supports. I guess it's unlimited rooms like I said.
Yes, that's true.
Slasher did a small mistake above, he said rooms below 300 save their states, but actually room 300 save the state too, so it's rooms 1 - 300.
Rooms >= 301 usually are used for menus, cutscenes and various puzzle rooms that do not need to save the state (making player start puzzle over every time). Also, you may use them for rooms which player can visit only once, according to story design.

Volcan

I just discovered the room limit is 999. I got "The new room number must be between 0 and 999."

I would be silly making an 1000 rooms game. Even 250 rooms would be enough.

SMF spam blocked by CleanTalk