the POWER of the ini (management games)
|
The standard TGF ini is in fact a great deal more powerful than many people perceive. There have been far too many good articles on how to use them at a basic level for me to focus on that (or even go over it, so sorry if you don't have a clue what I'm saying). But of late I have discovered something… something that one may believe to be but a small and insignificant feature…Can you guess what it is yet? When choosing group or item or even file you can click that little "edit" box. Have you ever stopped to think what that could mean? You can create groups dynamically mid game. Why? I hear you ask. Well first allow me to detail a particular problem. You cannot set the group/item/file to the value of a counter. Getting around this is tricky, but possible. All you do is create a text object (it's default name will be "0…") and set paragraph 1 to "0", 2 to "1" all the way up to 10 being "9". Then you take create an edit object (this will display the number in text form). You will also need the counter that you need to convert into text (call it "number"). Now, here comes the scary part: Set the edit objects text to:
paragraph$( "0...", ( ( value( "number" ) / 100 ) mod 10 ) ) + paragraph$( "0...", ( ( value( "number" ) / 10 ) mod 10 ) ) + paragraph$( "0...", ( ( value( "number" ) ) mod 10 ) )
No! Don't go! It's not as bad as it looks! All it does is split the number into it's component parts and translate that, via the digit text object (be selecting appropriate paragraphs) into text, but the good news is you don't have to understand it. It's a tried and tested formula and can be copied and pasted into TGF. Once you've done that you can get creative. You see now you can set the group to that number, set the items to strength, and set the value to random(21), and then add 1 to number. Look in your C:\windows directory for whatever file you used to do this and you'll find that once you've left this program running for a few seconds, you'll have a whole list of numbers, each with a corresponding strength value. Can you see where this is going? It's possible to randomly generate a database of as many characters as you want for a game. Why would you want to do this? Another example: One of my many, many current projects is a game called world domination manager. When you run it for the first time it generates 400 different characters, each with a randomly generated name (just bolting together randomly chosen segments, this can work surprisingly well, I rarely get 2 with the same name) and whole reams of statistics based on their previously chosen character level (1-5). They each have a completely unique appearance based on eight randomly selected components (eyes, noses, mouths) that vary according to whether their good, bad, skilled, pathetic, black, white, man, woman, attractive or unattractive. (and that works amazingly well, no 2 people out of 400 look the same!).
So how do you then display this? Easy, you have the number counting up and for each value it loads the group of the text number (edit object) and sets item to name, before adding that as a line in a list object (you'll need the standard Clickteam extension pack for this). When selection of the list changes (eg you click on a new name) it set the counter running through the numbers again until it reaches one where the item: "name" matches that of the selected name and then displays that groups statistics and image. Obviously, this would take a while, but if you use fastloop it takes only an unnoticeable pause to do this.
And there you have it, the basis for a detailed management game on TGF, where every single players experience is unique, every character is different, games are saved as you play them and the game will take up little space for downloads because it generates all the statistics after downloading. All because of that happy little ini.
|
|
|