Mirage Source
Better Method - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Better Method (/showthread.php?tid=307)



Better Method - halla - 14-09-2006

Ok im setting it where it reads variables to set the damage, monster so on fo the battle.

Whats better...

to have all the monsters in 1 ini file and it searches for the monster name and gets the data.. OR

have each monster have its on ini file.

about the first I was thinking that but is there a way to have it read the first category and then set that as a variable? the format is

[name]
name=value

im talking about the [name] is it possible to set that to a variable? if so im not sure how... or is just making all their own ini file easier. I would just do that but it seems more sloppy... even though thats how ms and so on does it.

THanks


- funkynut - 14-09-2006

speed wise, each monster own ini, since when searching inis it searches everything until it finds what its looking for, if each is in its own ini, then It can go directly to it


- Obsidian - 14-09-2006

Just out of curiousity why are you even using INIs?


- halla - 14-09-2006

Yeah I figured out to use the first method I could do say...

[MONSTER1]
Name= Monster

then I could have it get the name that way.

If it does slow it down then I will change it not hard to do so.


Why am I using INIs?
Im using it to store monsters info and stuff like that... prob player info too.

Im doing that so so I wanted to have monster 1 and monster 2 randomly be in fights on a map I just pull their info from the INI file. And for player of course could just take all their info from the file.

I know for players it could just all be in the game but say you save the game or whatever it saves to ini file so it can load it up when you continue the game.

Do you hvae a better method to do this? Im open to all suggestions.


- Van - 14-09-2006

Binary Smile
Dave posted a nice tut about it on the old forums.


- halla - 14-09-2006

Van Wrote:Binary Smile
Dave posted a nice tut about it on the old forums.

this isnt online though... unless that doesnt amtter (I dont know)


- Spodi - 14-09-2006

It would be best if you had a variable-sized array with pointers to the index of the array that is used for the NPC, then just load the NPCs as they are needed.


- halla - 14-09-2006

it does only load npcs when they are needed. when the battle is opened it loads up the npc that is set for it.

what do you mean set an array... 1 value for each npc and then have it load the info based on what array is selected?

like Monster(2) would load the second monster?


- Spodi - 14-09-2006

I am talking about a variable length array, and what position NPCs are in the array is when they are loaded:

Monster(1) = first loaded monster
Monster(2) = second
etc...

Sizing your array to fit all the monsters but just not setting them is just a waste of RAM. :wink:


- halla - 14-09-2006

my way doesnt waste ram

I have variables for everythin on the battle screen and it just sets everything based on what those variables are... and they just read from the monsters info... I dont see how that wastes ram


- Spodi - 15-09-2006

Well you are grabbing information from a file constantly, which will reduce speed quickly since file I/O, especially with Get/SetPrivateProfileString, is very slow.