Playmaker Forum
Bug Reporting => PlayMaker Bug Reporting => Topic started 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?
-
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).
-
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...
-
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.
-
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
-
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.