playMaker

Author Topic: Array to UI Elements  (Read 4974 times)

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Array to UI Elements
« on: December 31, 2016, 12:04:33 AM »
Hello!

I hope everyone is doing well! A loaded question, if you will entertain me.

So, I am using ORK Framework as my RPG backend and have ORK Playmaker actions. I am attempting to completely use a custom UI. My problem at the moment is populating lists of items, I guess either from an array or hashtable, to UI elements such as individual buttons per item or just a plain list. What's the most straightforward way of accomplishing this? Right now I have ORK items from it's database being dumped to a string, which is then converted to an array, which will display the correct count (for testing purposes) when using array length. Now I'm a little stuck as to where to go from here. The ultimate goal is to have these lists/buttons and have them interact-able with ORK in regards to equipping, dropping, etc. Any help or guidance is appreciated!
« Last Edit: December 31, 2016, 12:08:32 AM by jrock84 »

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #1 on: January 02, 2017, 12:14:50 PM »
Anyone have an idea on this? I'm a little stumped.

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Array to UI Elements
« Reply #2 on: January 02, 2017, 12:46:49 PM »
Hi, I don’t have the ORK Framework, but maybe this can help.
There is an example for lists for Unity UI+Playmaker. There are no arrays, but when an UI item is spawned Add it to a list. Or on it’s creation put values in title and other text objects.

On Ecosystem search “list” and look for “u Gui Dynamic List” sample.
Maybe there are more examples with you can combine, or tutorials.

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #3 on: January 02, 2017, 07:06:11 PM »
Ah, I had not seen that one! Thank you! I'll check it out and report back.

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #4 on: January 03, 2017, 05:05:08 PM »
Ok, I had success implementing the example into my UI, but feeding my array data into the events is proving a bit more difficult.

I'm still using the add button for testing, but I'm calling my FSM that has an array for each action calling the ListItem FSM as a template. My ORKUIBridge FSM is gathering the data for the items. Please see screenshots. Thanks!





Array for each:


List Controller:






List Controller GameObject:


List Item Prefab:






ORK UI Bridge:


« Last Edit: January 03, 2017, 05:14:49 PM by jrock84 »

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #5 on: January 05, 2017, 05:46:36 PM »
Still haven't made any headway on this.

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #6 on: January 09, 2017, 08:58:02 AM »
Shameless bump. Haha

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array to UI Elements
« Reply #7 on: January 10, 2017, 02:23:25 AM »
Hi,

Can you try not to use ArrayForEach? and do this manually, do that work?

Bye,

 Jean

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #8 on: January 10, 2017, 08:10:16 PM »
Hey Jean,

Right now I'm just testing the feasibility of using Playmaker for this purpose so I'm trying to see if this can be done using Playmaker. There's really nothing else to do manually right now.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array to UI Elements
« Reply #9 on: January 11, 2017, 04:20:39 AM »
Hi,

 I mean not using ArrayforEach. Maybe this is the issue here.

There is a sample on the Ecosystem showing how to work with UI listing, have you checked it?

Bye,

 Jean

jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #10 on: January 11, 2017, 10:23:41 AM »
Yeah, that's what I started with. If you're talking about the UGUI Dynamic List sample. I had success using it manually, but trying to feed data to it was a no go. How else would I dynamically add the buttons from array data if not by array for each? Maybe I'm just using the wrong logic here. Thanks Jean!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array to UI Elements
« Reply #11 on: January 12, 2017, 01:13:42 AM »
Hi,

 there are many options, you can manually iterate ( using iterate action from the ecosystem).

Can you give a sample of the array content?

 Bye,

 Jean


jrock84

  • Playmaker Newbie
  • *
  • Posts: 23
    • Divergent Worlds Interactive
Re: Array to UI Elements
« Reply #12 on: January 12, 2017, 10:06:50 PM »
Hi Jean,

Let me check that out and I'll report back. I had not considered that yet. Thanks!