Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jeanfabre on April 08, 2011, 07:58:55 AM

Title: [solved] Populate events data before sending an event using scripting
Post by: jeanfabre on April 08, 2011, 07:58:55 AM
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
Title: Re: Populate events data before sending an event using scripting
Post by: Alex Chouls on April 08, 2011, 04:46:31 PM
EvenData is a static variable - just set it with Fsm.EventData... before sending an event.
Title: Re: Populate events data before sending an event using scripting
Post by: Alex Chouls 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...
Title: Re: Populate events data before sending an event using scripting
Post by: jeanfabre 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