playMaker

Author Topic: Question about FsmVar  (Read 587 times)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 987
    • 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?
« Last Edit: March 07, 2019, 06:28:02 AM by krmko »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14316
  • 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: 987
    • 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: 14316
  • 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: 987
    • 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: 987
    • 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: 14316
  • 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: 987
    • 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: 987
    • 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!

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 987
    • View Profile
    • Fat Pug Studio
Re: Question about FsmVar[SOLVED]
« Reply #9 on: March 07, 2019, 05: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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4360
    • View Profile
    • jinxtergames
Re: Question about FsmVar
« Reply #10 on: March 07, 2019, 09: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.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

krmko

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