playMaker

Author Topic: [solved] Populate events data before sending an event using scripting  (Read 4151 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Can't find my way around this one.

 Following the SetEventData.cs I want to send an event from a c# script and populate events data very much like on that action.

problem, I don't have access to myFsmComp.fsm.EventData it only seems to be available from an Action script.

 How can I achieve this. Currently, I have to get the variable directly and set it. This is very wrong from a practice point of view cause I have to hard code variables names and it breaks encapsulation. Hopefully, this is available, and I missed it.

 Bye,

 Jean
« Last Edit: April 15, 2011, 03:09:03 AM by alexchouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Populate events data before sending an event using scripting
« Reply #1 on: April 08, 2011, 04:46:31 PM »
EvenData is a static variable - just set it with Fsm.EventData... before sending an event.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Populate events data before sending an event using scripting
« Reply #2 on: April 13, 2011, 04:47:04 PM »
Hi Jean, did you have a chance to try this? Would like to confirm that setting event data works as expected from external scripts...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Populate events data before sending an event using scripting
« Reply #3 on: April 15, 2011, 02:55:42 AM »
Hi Alex,

 Yes, Finally got the time to run that simple test and it works  very well.

So yes, using Fsm.EventData.xxxData within your script get's properly caught by the GetEventInfo action : https://hutonggames.fogbugz.com/default.asp?W530

Bye,

 Jean