So i have it so when you pick up a gun it randomizes the prefix and the title. i want to know what would be the easiest way to save those so that i can hold up to 4 guns. i was thinking making an active object that stored the texts in its alterable strings, and when you select the according gun slot it would load those texts, i would also do the same in the alterable values for the damage and fire rate of the gun. would this work? i havnt bothered to try it yet because im wondering if anyone else has a better idea.
[Game design makes my brain feel like its gonna explode.]
Why does it randomize the prefix and the title? Do you mean when you pick up a gun object, it randomly picks out of 4 guns to give you?
Your method for loading text will work fine. MMF is so versatile. There are so many ways to do anything. I say just go for it and if it doesn't work, usually its pretty easy to see why and you learn something. I swear everyday I realise something about MMF I didn't know the day before. OMGGGGGGGGGGGGG CLICKTEAM I LOVE YOU!!!!!!
the game has a random gun generator. theres approximately 30 or so Prefix's a gun can have, and about 10 for each of the 8 different weapon classes, this randomization makes it easy to make many different guns, with differing stats, and differing elemental damage, firerate etc. (pretty much borderlands but sidescroller ) guess i should have given a better description
[Game design makes my brain feel like its gonna explode.]
Note the space between the "". Prefix, Name and Suffix are those strings found in the generator.
Actually, if they are already strings I don't believe you need the str$().
Anyway that would save a string as; "Prefix Name Suffix", or "Mystic Detonator of Firearch"!
Something like that.
Save the values in an appropriate place. You really could save everything in a single array by converting between numerical values and strings or vice versa.
that all make sense up until the array thing. ive never done anything with an array, and i have very minimal experience with Ini files. any good articles i could read?
[Game design makes my brain feel like its gonna explode.]
In my current project (coincidentally also about Zombies haha) the player can pick up many different items. Each item has a name and a description stored as a string in an array and called upon when necessary. I made a separate program for editing these strings. The program saves the item list as a file called Items.arr which is then read by my game during runtime.
I'm not sure if it will be helpful but here's the link: http://www.create-games.com/download.asp?id=8530 It doesn't show how to pull the strings from the array in your game though. Maybe that is an example worth me making.
I didn't understand Arrays either and would always opt for a ridiculous alternative like the List Object. Until a few weeks ago I started messing around with them. Testing all the conditions an actions. It was pretty confusing at first but I'm so glad I did.
Originally Posted by siven that all make sense up until the array thing. ive never done anything with an array, and i have very minimal experience with Ini files. any good articles i could read?
Array or ini, both are great for the task. The minimal pros of the array is that it's encrypted automatically while you have to encrypt an ini *manually*, also, I believe the array to be the easier method in this case.
So what's an array?
Basically, it's a grid structured information file.
Think of it as an Excel spreadsheet, you've got a bunch of small pockets for storing numbers or text and retrieving them at a later point.
The array has three main parameters; X dimension, Y dimension and Z dimension.
Their different sizes make up the *shape* of your array.
Example;
An array of the dimension X 10, Y 1 and Z 1 would in reality be a row of 10 small memory boxes.
The X is how many columns to have in the array.
The Y is how many rows.
The Z is kind of special, it's the depth of the array. Like if you put a bunch of Excel sheets in a stack, you'd get a number of sheets, a Z value. So Z 1 means just one sheet of the specified X and Y dimension.
To illustrate this in ASCII art;
The example array of X 10, Y 1, Z 1 would look something like this.
OOOOOOOOOO
(imagine the O's are really boxes)
An array of the dimension X 7, Y 13, Z 1 would thus be:
What's great about arrays is that each individual box can be accessed by it's position in *the grid*.
The box(or cell) at X 1, Y 3, Z 1 would be [prefix] on line three.
X 3, Y 1, Z 1 would be [suffix] on the first line.
So in your case you could save the generator info to the appropriate cell on the appropriate line, and when displaying info about the weapon in question bundle a string with the X1+X2+X3 of the appropriate Y.
There's a bunch more to say about arrays, especially about 1 or 0 based indexes(basically, start counting from 0 or 1? A total dimension of 10 would be 0-9 in 0 based and 1-10 in 1 based).
Though I have to run to the store right now!
Search the articles, read the MMF2 manual or browse the clickteam site, thereäs information abundant!
thanks a ton guys! ill have to check out those chris
great explanation eternal man, i had a feeling it was something like that but the x y z thing threw me off and i was just confused. i think an arraw will work very well for what i need. thanks guys
[Game design makes my brain feel like its gonna explode.]
I would personally use an ini since it's compatible with all of the runtimes.
If you someday decide to "port" the game to iOS or something it'll be an easy conversion.
Also I wouldn't worry about encrypting stuff unless it's an online game, and honestly leaving things unencrypted adds more fun for the players since if they figure out they can change the values they can feel like 1337 hackers.
Plus it's just a cool easter egg, and easier to debug if necessary.
well that would be ok because i only need 8, 4 prefix's and 4 title's to be stored. those will be ONLY for the currently equipped weapons, the rest of them will be stored in an ini or an array, whichever i decide to figure out lol. thanks for the input though, ill keep that in mind
[Game design makes my brain feel like its gonna explode.]
@GamesterXIII
You may only have 10 alterable strings per active object, but how many active objects do you have? Usually quite a lot. What do you use instead?
Originally Posted by Chris Burrows @Siven
Not sure if you still need help with this but I just made a new Array based inventory example which might be helpful.
http://www.create-games.com/download.asp?id=8549
@GamesterXIII
You may only have 10 alterable strings per active object, but how many active objects do you have? Usually quite a lot. What do you use instead?
I started out using active objects, but if you want a flexible system you can't have 345345345 actives housing strings. I didn't know about the 10 string limit myself until recently.
The array system sounds the best as you and others have mentioned, though I'm not well-versed in arrays at all. If you want an alternative, multiple list objects technically could get the job done.
True......... but the statement "WHATEVER YOU DO!!! don't use alterable strings in an active object" is a bit extreme. There are times for arrays and times for alterable strings.
Say you have multiple instances of the same object, a door for example.
It has 4 separate states: "open", "opening", "closed" and "closing".
If you have multiple doors, having the object state stored inside its "self" using in Alterable String is definitely better than using an array.
To use an array, you would need to spread a unique object ID over all Door objects and then test the match the ID for the current door to a door in the array. Way too complicated for such a simple task.
Alterable Strings (aka ULTIMATE STRINGS) until the day I FUCKING die!