playMaker

Author Topic: Arraymaker - creating tabbed inventory  (Read 2169 times)

kyoung

  • Playmaker Newbie
  • *
  • Posts: 3
Arraymaker - creating tabbed inventory
« on: August 09, 2013, 05:54:39 PM »
Please forgive me, I'm relatively new to Playmaker, Arraymaker, and game development in general. But I am very thankful that these tools are available for someone with little-to-no knowledge of coding like me.

So I am using Arraymaker, and attempting to build a tabbed inventory. Specifically, I've got five tabs that can each be selected, and should only display items in that specific category when selected. Right now, I've got one array that is pre-loaded with all the available items, and I've got an FSM on each tab that pulls each item from the array, gives them a GameObject variable, checks the tag of that GameObject, then if the item has the correct tag, it activates the item, and if it does not, moves on to the next item. Right now I've only got a total of five items, so it's not a big problem, but I'm concerned that when I've got upwards of 200 items to cycle through, this will become a difficult and time-consuming process.

Is there' any way I can have different arrays for each tab with only the items that belong in that tab, and just have Arraymaker pull and activate each item in the array when each tab is clicked? Is this something that sounds like a possibility? Or is my method right now going to be effective and not memory-consuming enough to worry about?

Thank you everyone!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker - creating tabbed inventory
« Reply #1 on: August 14, 2013, 06:00:15 AM »
Hi,

 yes you can have individual arrays for each tab.

Looping through 200 should be ok.

what 2d framework are you using?


Jean

kyoung

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Arraymaker - creating tabbed inventory
« Reply #2 on: August 16, 2013, 07:46:42 PM »
Thank you for your response, Jean!

We are using NGUI. The game we're creating is a 2D game for iOS. The problem I may run into with having one array from which to draw items is we need to know which items the player has acquired in order to place them into an array, which means we'd need to draw this information from player data elsewhere. I am running into some confusion with how I can access this type of information with Arraymaker. For instance, if my player has 100 items, and it's all saved within the player data on the server, is there a way through Arraymaker that I can create an array using only the items the player owns if the data of what items have been acquired is saved in an external location?

I hope this is making sense. Like I said, I am very new to all of this, so I'm still learning. Thanks again for your help, I really appreciate it.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arraymaker - creating tabbed inventory
« Reply #3 on: August 19, 2013, 04:05:38 AM »
Hi,

 You may want to look into using a database here. ArrayMaker is only about storing during editing and within your game. It' won't save and retrieve data automatically. For this you will have to have a mean of saving your data and then injecting it within ArrayMaker (using ArrayListAdd action for example)

bye,

Jean