playMaker

Author Topic: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]  (Read 3079 times)

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • my twitter @andrewlukasik
updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
« on: October 17, 2011, 07: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.



^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?
« Last Edit: November 05, 2011, 02:15:26 PM by alexchouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3627
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: updating to 1.2.1 __ problem with SendEventToFSM
« Reply #1 on: October 17, 2011, 08: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).

vonchor

  • Guest
Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
« Reply #2 on: November 11, 2011, 10:04:46 AM »
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...

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3627
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
« Reply #3 on: November 11, 2011, 11:08:23 AM »
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14337
  • Official Playmaker Support
    • View Profile
Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
« Reply #4 on: December 01, 2011, 12: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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3627
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: updating to 1.2.1 __ problem with SendEventToFSM [SOLVED]
« Reply #5 on: December 13, 2011, 10:38:01 AM »
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.
« Last Edit: December 13, 2011, 10:40:57 AM by alexchouls »