playMaker

Author Topic: Array Maker-(How do you set it up?)  (Read 2146 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Array Maker-(How do you set it up?)
« on: February 05, 2015, 03:47:07 PM »
So I downloaded array maker and the samples and am trying to figure it out.

What I am trying to do is have the text of a variable not be the same as the text of another variable.  I am mapping keys (UDLR and 4 fire buttons) times 4 players.  So that's 32 variables.  Each variable has a text in it such as 'a' or 's' or 'd' or 'w'.  So when a player wants to change the UP from 'w' to something else, I'd like to compare the new letter input (like 'p') to every other variable to make sure it it not being used.

So the player choose to change the UP (text 'w') to 'p', I want to search all of the variables for the letter 'p'.  If none are there, then allow the change.

So how do I set this up.  I can do everything except the array stuff.  I need to put the variables into the array and then do a search.  I have the inputs set like 'Player1-Up' with a string as 'Player1-Up'.  then I have the actual Cinput key string as 'W'.

Really I have 32 variables to put in a list (no more or less).  The I want to check to see if the current vararible is one of them.  if not, then change the array list variable to the current one.  pretty easy but without instructions, it's a bit hard.

« Last Edit: February 05, 2015, 09:11:42 PM by wheretheidivides »

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Array Maker-(How do you set it up?)
« Reply #1 on: February 06, 2015, 03:33:57 AM »
So I figured out how to set up a hash table array and put variables strings in it.  I even know the difference between a array and hash.  Now my issue is that In the bootstrapper scene I set up the hash table but in another scene it doesn't recognize the info.  I tried a don't destroy, but still got errors.  So how do you reference them in other scenes?

Geez: Cinput looked so easy to do, but after 5 days I am still trying to remap keys.  geez.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array Maker-(How do you set it up?)
« Reply #2 on: February 06, 2015, 08:21:07 AM »
Hi,

 It could be that when you load the scene the array component is on a gameobject that is destroyed? and so it's not there anymore?

what errors do you get?

Bye,

 Jean

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Array Maker-(How do you set it up?)
« Reply #3 on: February 06, 2015, 12:20:07 PM »
So in the bootstrapper scene I set up the hash table but in the set input mapper scene I am trying to access the hash table.  So looking at the picture when I try to do a search, it will give the error that the table isn't there.  of course it's not as it's in another scene.

Pic1: Shows the 2nd scene with me trying to look for the hash table (which is in another scene). Gives error as there is no hash table in that scene.
Pic2: Shows the vales with game NOT running.
Pic3: Game running showing that the values are there.

So how do I access it?
« Last Edit: February 06, 2015, 12:26:09 PM by wheretheidivides »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array Maker-(How do you set it up?)
« Reply #4 on: February 16, 2015, 07:13:14 AM »
Hi,

 Then you need to store the GameObject in that other scene with the arrayLists into an FsmGameObject and in the arrayList action, instead of "owner" you select that GameObject variable.

 Bye,

 Jean