playMaker

Author Topic: Can someone please tell me what I've done wrong here?  (Read 715 times)

eros

  • Playmaker Newbie
  • *
  • Posts: 9
Can someone please tell me what I've done wrong here?
« on: May 16, 2022, 12:40:05 AM »
The Add Event is firing properly from targetArrayHostile, and it also appears to be sending the event data as expected, but I can't figure out how to store it in my GOaddedToHostile variable. Feels bad man.

Any advice?

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Can someone please tell me what I've done wrong here?
« Reply #1 on: May 16, 2022, 02:01:07 AM »
So as far I can tell you haven't used Set Event Data in your "combatManager." That would be the reason you would get no data. You need to place that and assign the variables you want to send. And obviously you'd do this one action ABOVE where you would do an array change action which would start the event. Then it will transfer the info you put with Get Event Info.
« Last Edit: May 16, 2022, 02:16:33 AM by Twood »

eros

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Can someone please tell me what I've done wrong here?
« Reply #2 on: May 16, 2022, 03:25:42 AM »
Hm, I was under the impression that Add Event automagically sent the data responsible for firing the event (Enemy001), and it appears to have done that in the Get Info state. The array proxy is actually on the combatManager GO and the "Sent By" data field is correctly populated with Enemy001. Or am I totally reading that wrong?

It looks like the data I need from the array has been sent, I just can't store it into a variable. My brain hurts.

edit: Ok, it makes more sense that the "Sent By" should actually be the GO that sent the data, not the data itself. Derp. Brain hurts less now. I got rid of the rogue event, so _CombatManager value shows up properly on runtime. Still no joy with storing the data from the array list event though.

My Google Fu turned this up:

https://hutonggames.com/playmakerforum/index.php?topic=6530.0

Am I doing something wrong or does this issue persist? Using PM v1.9.4.f2

edit2: Tested, Set Event sets proper index value as int, accessible via Get Info... Add Event/Remove Event is not attaching event data it seems. All my transitions are set to global...  :(
« Last Edit: May 16, 2022, 05:31:24 AM by eros »

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Can someone please tell me what I've done wrong here?
« Reply #3 on: May 16, 2022, 11:51:52 AM »
Does it work fine if you separate it from the proxy list thing? Just try sending a global event from pm to control it instead of the list? If so it's just that part of arraymaker is bugged. But set event data, or set fsm game object or whatever using usual methods are certainly working.

eros

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Can someone please tell me what I've done wrong here?
« Reply #4 on: May 16, 2022, 02:02:48 PM »
Yeah, I've implemented a workaround solution for now with Set/Get but I'd still like to know if the data set functionality in ArrayMaker events is borked or if I'm just doing it wrong, which is nearly always the case.  ;D

Attached a new screen with the correct GO referenced as global FSM variable. I've tried referencing the GO directly too, neither method works.

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Can someone please tell me what I've done wrong here?
« Reply #5 on: May 16, 2022, 05:13:44 PM »
Can you post a screenshot of one of the sending FSMs for when you are starting this sequence by adding or remove on the array?

I'll give you my example, I have no bugs doing it this way and can get whatever info I want to be passed during an add event.

« Last Edit: May 16, 2022, 05:28:27 PM by Twood »

eros

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Can someone please tell me what I've done wrong here?
« Reply #6 on: May 16, 2022, 06:50:44 PM »
The FSM is on a prefab and runs on instantiation. Storing a reference to the prefab and then setting that value via Set Event Data right before Array List Add indeed works! Whether or not that's the intended behavior, it only took three clicks to fix. It's always something simple I miss, always.

Based on the (admittedly vague) documentation and jeanfabre's explanation in the thread I linked, I was thinking the Array List Proxy script handled the setting of the event data based on the value received, but apparently that's not the case.

Thanks for your patience Twood!

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Can someone please tell me what I've done wrong here?
« Reply #7 on: May 16, 2022, 07:47:21 PM »
Thanks for your patience Twood!

Sure! It was an interesting thing to look at because I had never tried using the events feature of the proxy list myself. ;D GL making games.