playMaker

Author Topic: Restarting a FSM from another object [SOLVED]  (Read 1418 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Restarting a FSM from another object [SOLVED]
« on: February 19, 2017, 06:19:16 PM »
Hi guys, this is some simple stuff, but i'm not sure what should i use. I have a weapon object which detects whether is it equipped on ship or a pickup drifting in space and based on that the state machine branches further. However, when it is replaced by another weapon, it needs to get back to start state so it can do the weapon/pickup check again.

I can't use reset on exit since i will be activating it from another object. I tried sending an event but it didn't work out, i don't know if i'm doing it right.





The event is global of course.

I tried some debugging, but obviously event has not been received.



Any ideas?
« Last Edit: February 20, 2017, 02:11:30 AM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Restarting a FSM from another object
« Reply #1 on: February 19, 2017, 07:00:37 PM »
Hmm, here's a small update. In the final state of the pickup object fsm that should replace an active weapon i'm storing an active weapon from the array as an "active weapon" variable and use it as a reference for detaching from parent (gunpoint on ship), re-enabling the animated pickup indicator by activating child object, even disabling another fsm used for shooting that's attached to it. So that works, the reference is valid.

But when i try to disable an fsm in question (Pickup FSM as seen on image) so it should restart when it's reactivated by resetting on exit when the pickup object is destroyed that doesn't happen, it doesn't get turned off at all.
« Last Edit: February 19, 2017, 07:15:21 PM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Restarting a FSM from another object [SOLVED]
« Reply #2 on: February 20, 2017, 02:12:16 AM »
Well, that's what you get when you work in 1:30 AM. I was trying to fire an event from a wrong prefab. Everything works fine  ;D
Available for Playmaker work