playMaker

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14048
  • Official Playmaker Support
    • View Profile
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, 12:09:03 AM by alexchouls »

Alex Chouls

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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3572
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Populate events data before sending an event using scripting
« Reply #2 on: April 13, 2011, 01: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: 14048
  • Official Playmaker Support
    • View Profile
Re: Populate events data before sending an event using scripting
« Reply #3 on: April 14, 2011, 11:55:42 PM »
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