Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Andrew.Lukasik on October 17, 2011, 10:57:05 AM

Title: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
Post by: Andrew.Lukasik on October 17, 2011, 10:57:05 AM
Hi
I have this problem updating my project to Playmaker1.2.1 that action SendEventToFSM is notified as obsolete and in the same time SendEvent (as seen below) has no text-field in "Send Event" space anymore.

(http://img405.imageshack.us/img405/2341/playmaker43wy3aqw4yhq23.jpg)

^As you can see problem is that target Game Object is virtually unknown before runtime


Anyone know how to fix this? Maybe adding some code to SendEvent.cs?
Title: Re: updating to 1.2.1 __ problem with SendEventToFSM
Post by: Alex Chouls on October 17, 2011, 11:19:53 AM
Events sent between FSMs now need to be marked as global in the Events tab. Then they will appear in the Send Event dropdown. This makes it a lot easier to refactor event names (vs a text field that had to be manually edited).
Title: Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
Post by: vonchor on November 11, 2011, 12:04:46 PM
yes but: what if you WANT to be able to use a string for the event name because you don't know it until runtime?  IMO this is still a problem...
Title: Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
Post by: Alex Chouls on November 11, 2011, 01:08:23 PM
That's true... I'll add a variable toggle to the Send Event field so you can use a string variable.

For now you could remove the obsolete attribute from SendEventToFSM and use that.
Title: Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
Post by: jeanfabre on December 01, 2011, 02:37:54 AM
Hi,

 When I have to deal with redirecting different events at runtime, I don't rely on the event itself, but rather store this in a variable somehow and make a switch based on that variable.

Odd like we go back and forth with this isn't it :) using string as reference to events was seen as dangerous and error prone ( because if the event doesn't exists or the string is wrong, you are in for a long debugging session, I've been there... not mentionning refactoring...), but still it's very convenient in some cases.

Variable toggle will be very a very good addition indeed.

Bye,

 Jean
Title: Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
Post by: Alex Chouls on December 13, 2011, 12:38:01 PM
I've posted Send Event By Name here:
http://hutonggames.com/playmakerforum/index.php?topic=917.0

NOTE: Event names in this action will not be refactored when you rename the event in the editor! You will have to manually rename the events sent by this action.