playMaker

Author Topic: Question about FsmVar  (Read 2306 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Question about FsmVar
« on: February 04, 2019, 02: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?
« Last Edit: March 07, 2019, 08:28:02 AM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Question about FsmVar
« Reply #1 on: February 05, 2019, 01:55:54 AM »
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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #2 on: February 05, 2019, 07: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?

Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Question about FsmVar
« Reply #3 on: February 06, 2019, 02: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

Fat Pug Studio

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

check pm.
Available for Playmaker work

Fat Pug Studio

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Question about FsmVar
« Reply #6 on: February 11, 2019, 12:58:52 AM »
Hi,

 Did not get any pm :)

Bye,

 Jean

Fat Pug Studio

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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Question about FsmVar [SOLVED]
« Reply #8 on: February 16, 2019, 12:51:58 PM »
Works when i use setgameobject then use that variable. Thanks Jean!
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Question about FsmVar[SOLVED]
« Reply #9 on: March 07, 2019, 07:56:24 AM »
Ok, i have to bump this, there's something fishy going on.

I have an arraylist



I get a random item from the array



I set the game object since it saves the item as fsmvar



It saves it nice and dandy into variable



Then i spawn it



But as you can see it spawns an object that is not even in the arraylist! But the worst thing is that it sometimes does the job properly and spawns the selected game object, and sometimes it spawns this. Worst thing part 2: wrong prefab is always the same.
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Question about FsmVar
« Reply #10 on: March 07, 2019, 11:07:52 AM »
Hi.
From the 1st look of it, it think the core game kit has to do something with it.

try enabling debug (bottom/left on the state window/tab)
and set a few breakpoints.

so you can see as the selected random is correct, if so go next step.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Question about FsmVar
« Reply #11 on: March 12, 2019, 02:14:31 PM »
Yeah, probably Core Game Kit has something to do, though the code looks clean. I'll check out with Brian anyway.
Available for Playmaker work