playMaker

Author Topic: Reading Variables from another FSM  (Read 1410 times)

PET

  • Full Member
  • ***
  • Posts: 139
    • GamerPET
Reading Variables from another FSM
« on: May 05, 2017, 03:34:43 AM »
Hello there,

I'm trying to make something "the right way". So I will create an Game Object with a FSM where I want to add some variables. Then I will clone that Game Object, change the variables, etc.

A variable for example might be:
- Name [String]

Another more complicated variable... where I think I need to use an array is or a LIST or something...

I want to have a field where I nput let's say ... 3. Then I want it automatically to show me 3 fields as a STRING.

Then I would like my Main FSM to do a "FOR EACH" ... game object I have and check those values. Go to the first one, do something, GET the Variable that has the String "Name"...

... GET to this array where I check if that number is < than 1, do a for each where I take each of those fields... and do something else.

Basically I will have multiple game objects that have the "Name" of that Game Object and an Array String that will have from 1 to X strings that will create a HTTP address.

I will use those addresses later to download that particular file.

Any idea how to approach this?
Technical Game Designer
www.GamerPET.com

PET

  • Full Member
  • ***
  • Posts: 139
    • GamerPET
Re: Reading Variables from another FSM
« Reply #1 on: May 05, 2017, 07:19:13 AM »
I made some progress. I see that I can use "Get FSM XXX" where XXX is the type of variable you want.

I still think it's a bit messy to do what I want to do with PlayMaker.

What I would like to do is just have 1 game object with some variables then the FSM will do the rest.

The rest would be:

- Instatiate an UI Button
- Set up the TEXT of the UI Button to the "Variable Name"
- Detect if an Array has more than 1 items, because if it does I will have to go on another path...
- Place the Button on the Scene... but know the old position, so when you plkace a new button add 2 units on the Y axis...

Stuff like this. It seems that I have many small elements and somehow it seems pretty strange to do with PlayMaker.
Technical Game Designer
www.GamerPET.com