Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ALPHATT on Thu 28/06/2007 19:32:32

Title: String Formating-I don't get it
Post by: ALPHATT on Thu 28/06/2007 19:32:32
Well I don't really get whats the point of string formating I've read the manual several times but I couldn't really figure out whats the whole point can somebody give a clue ???

I would be very grateful if you could help.
Title: Re: String Formating-I don't get it
Post by: Ashen on Thu 28/06/2007 19:43:32
I guess you're talking about the String Formatting (http://www.adventuregamestudio.co.uk/manual/StringFormats.htm) page in the manual, but I don't understand the question. The 'point' seems pretty clear on that page - you can insert variables (String like character names, ints like Inventory amounts, etc) into a String. Admittedly, the examples it gives are a little useless, but they should be clear enough.

If I've missed the point of the question, or if you're asking about using Formatting in some specific case, please correct me.
Title: Re: String Formating-I don't get it
Post by: ALPHATT on Thu 28/06/2007 19:50:02
Yeah i get it but i would like to know why is this good for us how can we use it
Title: Re: String Formating-I don't get it
Post by: GarageGothic on Thu 28/06/2007 20:11:31
Well, pretty much anytime (with the internal score being an exception) you want to display the value of an int to the player, you need to convert it to a String first. Then you can assign that String as the text on a GUI label for instance.
Title: Re: String Formating-I don't get it
Post by: Ashen on Thu 28/06/2007 20:16:10
Really, if you never come across a reason to use it, you're probably doing something wrong... Try browsing the forums some more, and you'll probably find plenty of examples (such as adding date/tiem to a Savegame name (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=31257.0), creating numbered screenshots (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=30666.0), displaying variables on a GUI (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=30729.0) as GG mentioned, etc).