Because, with INI, you can quit the game and come back to where you left off and everything will be the same. Globals clear out when you quit the program. Plus it's much easier to store/retrieve stuff from an INI than a global.
INI
--------------
[Monster1]
Health = 100
Weapon = 1
Smarts = 2
[Monster2]
Health = 75
Weapon = 2
Smarts = 4
Globals
Monster1.health = Global 1
Monster1.weapons = Global 2
Monster1.smarts = Global 3
Monster2.health = Global 4
Monster2.weapon = Global 5
Monster2.smarts = Global 6
=============================
You'd go cross eyed with globals if you had, say, 30 monsters per level. Ini makes it much easier.
That's a bit overkill. Save monsters' health and everything. In most games all monsters are reset when you quit the game anyway.
But globals can get messy, yes, and they're pretty unpractical when there are only 16 different ones to use. I'd rather go for some sort of array object, if there is one for TGF.
Hmmm... But Im going to use these monsters in several SEVERAL other frames will they be considered as new other objects, or will they be removed as well?
My old system worked out in one way.
I had a counter that was global that said how many monsters that was allowed on the frame. If lets say the counter had the number 5, in the start of the frame there was created 5 monsters. and for each monster I killed the counter was decreased.
Sure it wasnt the most perfect one but it kinda worked except for one minor thing.
sometimes there was like 2 or 3 monsters created at the same time on the same place
and that made the game very unstable.
Example:
#Monster amount counter=1
+Start of level Create Monster in X Y position.
set value A on monster to 10
#Monster amount counter=0
+Start of level Nothing happens
But now I also wanna have abit mor professional look on the game so I need something new. I have big plans for this game so I really need to get this to work.
I simply want to be able to save the games info so that I can quit the game and pick it up later, I also want to be able to kill these monsters and they'll die forever (atleast for this playerscenario)
I know what you were trying to say, Shab, but why INI? There are lots of other data storage objects that work as well, but don't create... Annoying INI files?
Besides, INI files can easily be hacked while playing, unless you encrypt them. Is there even a blowfish object for TGF?
But, well. If you want the monsters to be dead "forever", Pontus, then I guess you should be using INI. I wouldn't be bothered, but it's your game.
The frames isnt levels. they are more of rooms. Which the player can enter and exit as many time he/she wants. and if the player has killed a monster the monster should be dead. in that save anyway or atleast until the player decides to exit the game.