playMaker

Author Topic: How do I get access to values inside a custom action?  (Read 2064 times)

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 28
How do I get access to values inside a custom action?
« on: August 29, 2015, 12:49:38 PM »
Hello -

I'm using a 3rd party library to read Tweets. It has this custom action which I'm calling:



When it completes, the 'Loaded Tweets' contains the actual Tweets. 'Loaded Tweets' is defined in the action as:

public FsmString[] loadedTweets;

So, when I then go to the next state in my FSM, how do I actually reference the Loaded Tweets? I need to iterate through them to do what I need to do, but I don't know how to refer to loadedTweets in the next state.

Thanks for you help!
Chris

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How do I get access to values inside a custom action?
« Reply #1 on: August 29, 2015, 01:24:00 PM »
Hi,
if the custom action is written correctly you should add a string variable to the Elements.
then you can the use strings variables

the way i can see it on the picture, the "Loaded Tweets" gives the amount of Tweets that should be loaded.

and the Element will give the variable.

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 28
Re: How do I get access to values inside a custom action?
« Reply #2 on: August 29, 2015, 01:38:06 PM »
@djaydino thanks for the reply.

Load Tweets does have strings. It is defined in the action as:

Code: [Select]
public FsmString[] loadedTweets;

So as you said, Element(s) contain the string values.

However, I still don't know how to "get" at them in my next action. How do I refer to those elements in a subsequent action so that I can iterate through them?

Thanks again

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How do I get access to values inside a custom action?
« Reply #3 on: August 29, 2015, 02:07:06 PM »
Hi,
make a string variable, then press on the = sign and that variable should be shown

if you want them into a list you can use ArrayMaker