User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Need help with Arrays (Basic question I guess ^^)

  1. #1
    Clicker Multimedia Fusion 2XNA Export Module
    Gogeta's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with Arrays (Basic question I guess ^^)

    Hello everyone.

    My Name is Marcio and I'm from germany. As of now I dont have any Clickteam products but in the end of this week I'll get my hands on MMF2 and the XNA converter.

    I was toying with the Demo Version for quit some time and Johnny (thanks man) would let me toy 2 days with his developer Version so I could test out some of the Extension you can't use with the Demo (Advanced Platformer etc...) and I really got the hang out of it. I was even able to do a "grab on ledge" example that I'm willing to share as soon as I can get my hands on MMF2.

    Well I was toying around with some ideas for my first project and I need some RPG like Stats (STR,DEX,VIT, Level and maybe LUCK). I want some quests too and of course an inventoryscreen, so I guess it would be good to store them in an Array, too. I read almost every article I could find around arrays but I miss something and that is the key for being able to understand the arrays 100%...

    I cant figure out if I need one more thing like spread value to give the Items an ID and then let the array write it in the x table (where maybe the Y table is the description of the item). How do I know when, I retrieve the X and Y data that X1 = Knife and Y=1 is the right description? I clearly miss a thing about arrays entirely!

    Can someone clarify this for me or has good examples and/or tutorials? I have read the save/load from Marvins HP (but this was a bit too much for me for geting out the basics xD) and I read the save/load from the clickteam Helpfile.

    Thanks in advance

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Check my array tutorial out, it's fairly well documented.

    http://puddinghatgames.com/category/...n-2-tutorials/

    4th one down I think

  3. #3
    Clicker Multimedia Fusion 2XNA Export Module
    Gogeta's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really don't get it. *lol*
    I think I'm too stupid. <.<°

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The easiest way for me to get my head around them, is to simply visualize them for what they technically represent. Spreadsheets. Like in Excel.

  5. #5
    Clicker Multimedia Fusion 2XNA Export Module
    Gogeta's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This I allready have.
    What i don't get is how I write for example, Items in the X Value. Do I have to use Spread Value first and then write it to the X Value? When I have done that, how do I know which Item is in which colum for later (for example if I want to do a custom Inventory)?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, I actually make a spreadsheet and use that to hold names of what is in each x,y,z coordinate.

    You can also use the Associative array to associate names to them, I think.

  7. #7
    Clicker Multimedia Fusion 2XNA Export Module
    Gogeta's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any other Array examples out there, which are for beginners? ^^;
    Or can someone make a simple example file?

    Maybe your example is good and I'm just too stupid. *lol*

  8. #8
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The best way is to think of an array as a big box with little compartments inside.

    The X value is how many boxes west to east, the Y value is how many boxes north and south, and if you want to get funky the Z value is how many boxes up and down.

    Example, if you wanted to read a value at Array(5,8) that's 5 boxes east and 8 boxes south.

    You can even have a one-dimensional array which just holds the X value for a simple inventory. So say the first 10 spots on that array are going to be used for your player's stuff. You'd make active objects called... InventoryItemPicture! or something and have them have 32 directions. Then say direction 0 would be a "blank" box, direction 1 could be a sword, direction 2 could be armor or whatever, etc.

    If you wanted to draw a picture of what that object was, you could do something using a loop like:

    Start Loop "INV" 10 times

    On Loop "INV"
    -> Set Direction of InventoryItemPicture to Value at X(Array(LoopIndex"INV"))


    I believe that could work, I might be missing something but it's not that hard you just need to practice. I've found arrays to be very very useful for games.

  9. #9
    Clicker Multimedia Fusion 2XNA Export Module
    Gogeta's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So basically I could make an Array with just x and write to X_Array1 = Knife and make a loop that takes all itemclasses (made with groupinventar or something like this) and put it in X_Array + 1 so I dont need to write ever item manualy?

    To writing one simple Value I dont need a array. How about writing dozens of stuff? I think loop is the only way, right?

  10. #10
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I have an open source example of the Associative Array and a Tutorial aimed at beginners on my website. You will not be able to use the Associative Array if you are using the Demo.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Basic randomizing question
    By Macaw in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 15th August 2013, 12:40 PM
  2. Question about Arrays
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 23rd October 2011, 08:10 PM
  3. Basic question about HWA
    By teddyq in forum Hardware Accelerated Runtime
    Replies: 6
    Last Post: 1st March 2008, 06:38 PM
  4. Basic Question - Vista compatible
    By txventure in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 23rd December 2007, 03:40 PM
  5. Very basic Moogame/Mooclick question
    By Taofeld in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th September 2007, 11:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •