playMaker

Author Topic: Sending information from a script to PM FSM  (Read 974 times)

Peeter1978

  • Playmaker Newbie
  • *
  • Posts: 23
Sending information from a script to PM FSM
« on: June 18, 2021, 08:34:08 AM »
I have a question regarding this First Person Exploration Kit: I have attached an 'FPE Interactable Pickup Script' to a GameObject. And I want the counter to recognize that when I use this script, the object should be counted for. At the moment the Playmaker FSM let's me pick up an object using this script but it does not count the object. To do that, I have to let the object go and click on it again. How can I tell playmaker, that using this 'FPE Interactable Pickup Script' should be treated so, that when using it, the object is also counted for?
Or, to put it in a bit more simpler terms: At the moment the Int Add takes place as a result of a simple Mouse Pick Event. Yet I want Int Add to take place as a result of this FPE Interactable Pickup Script...
I presume there should be a fairly easy way to get information from a script attached to a GameObject and pass it on to Playmaker FSM. I just can't seem to find it.  :-\

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Available for Playmaker work

Peeter1978

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Sending information from a script to PM FSM
« Reply #2 on: June 19, 2021, 04:15:27 AM »
Thank You! Is scripting the only way though? I'm myself pretty sure there has to be a way to do this via a Playmaker action? Perhaps there's something in the Ecosystem? Of course I can write couple of small scripts, but just because of the principle - there should be a way to do this in Playmaker?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sending information from a script to PM FSM
« Reply #3 on: June 19, 2021, 06:14:45 AM »
Hi.
you can try using Get/Set Properties actions but its still better to make custom actions or send the data from the script to a fsm/variable

Peeter1978

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Sending information from a script to PM FSM
« Reply #4 on: June 19, 2021, 07:08:55 AM »
I believe You and I will try it out. But I also tried using Get and Set Property yet I couldn't figure it out how to get or set this particular property I needed... :(

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Sending information from a script to PM FSM
« Reply #5 on: June 20, 2021, 06:02:23 AM »
Is it a private or a public field?
Available for Playmaker work

Peeter1978

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Sending information from a script to PM FSM
« Reply #6 on: June 20, 2021, 07:30:52 AM »
I have tried to do this in Playmaker. But I had a look at the script where I'm trying to get information from and although it's a long script, I'd say - almost everything there seemed to be public. But I'm not 100% sure...

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Sending information from a script to PM FSM
« Reply #7 on: June 20, 2021, 03:08:45 PM »
Can you attach the script and tell what property do you want to access?
Available for Playmaker work

Peeter1978

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Sending information from a script to PM FSM
« Reply #8 on: June 21, 2021, 02:22:52 PM »
I tried but I couldn't get it to make any sense. Yes, I can use Get Proprety but the information I find in the list is confusing and I couldn't identify any of the fields as something that would reference to a pickup. Maybe it really is too complicated. Or impossible. Anyhow, I'm already working on a different and easier solution.