playMaker

Author Topic: Question about FsmVar  (Read 222 times)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Question about FsmVar
« on: February 04, 2019, 12:11:25 PM »
Hi guys,

I have an issue, but i need to know how some things work to know how to solve it.

I'm using get array list random to get a random GameObject from array list. Now, when  i instantiate that object with Create Object Advanced it's ok, but when i use Core Game Kit and set the GameObject to spawn it spawns the wrong thing.

I suppose FsmVar is changeable variable that sets its type depending on the type of variable in the action by using PlayMakerUtils.ApplyValueToFsmVar, but why doesn't it work in things like Core Game Kit?

I'll dig up the code to the action of CGK to see how it's handled there, but isn't FsmVar automatically converted to GameObject variable in the Get Array List Random action?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: Question about FsmVar
« Reply #1 on: February 04, 2019, 11:55:54 PM »
Hi,

 you'll need to debug what's being read when you use CoreGameKit, maybe the value is not what you expected because of a logical issue within your fsm? else, what if you wait one frame?

if you have some code sample, it will help, I am not sure how you work with playmaker and coregamekit and where fsmvar are involved ( never used it)

Bye,

 Jean

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #2 on: February 05, 2019, 05:45:28 AM »
Waiting for a frame does not solve it unfortunately.

CGK action for spawning uses FsmGameObject as a reference.

Code: [Select]
prefabToSpawn = new FsmGameObject();
So, what should i do with FsmVar to use it as an FsmGameObject?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: Question about FsmVar
« Reply #3 on: February 06, 2019, 12:08:58 AM »
Hi,

 Sorry, I am not sure I follow, can you give a concrete example with code that I can run so that I see what you are trying to achieve?

why do you want an fsmvar here?

Bye,

 Jean

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #4 on: February 06, 2019, 12:36:05 AM »
Hi Jean,

check pm.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #5 on: February 09, 2019, 05:04:36 PM »
Any news on this one? I'll try modifying the action to get random gameobject from array list.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: Question about FsmVar
« Reply #6 on: February 10, 2019, 10:58:52 PM »
Hi,

 Did not get any pm :)

Bye,

 Jean

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #7 on: February 11, 2019, 01:48:03 AM »
Ok, i've sent it again.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 884
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar [SOLVED]
« Reply #8 on: February 16, 2019, 10:51:58 AM »
Works when i use setgameobject then use that variable. Thanks Jean!