playMaker

Author Topic: Send Event  (Read 5670 times)

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Send Event
« on: October 24, 2011, 10:45:18 PM »
I dont quite get how the Send event is supposed to work.. And what i mean is how the Global and Local Events are supposed to be separated etc..

I was trying to create a generic set of actions for Highlighting objects.. Some were groups so i used Broadcast all and selected a Global Event.. not a problem.. But some are just one object so i wanted to use generic event names so that i was customizing the code less... but i can not access the events from another FSM without making them Global.. But i dont want them to interfere with other global events on other FSMs.... I find it strange that even if i select FSM component on the Send Event Action the Event has to be marked as Global.. why not Local events when you are specifying the actual FSM... Same when you specify the Game Object or Game Object FSM..

Maybe it is ok if i generalize the Global Events..... i guess if i set it to Game Object and send a global event it will only trigger the Global Events on that Game object so maybe that is ok.... i will have to try it for a bit like that.

It just seems that the line between Global Events and Local Events has been blurred. I have to mark so many Events to Global it is loosing it meaning. For me Global Events would only be used for Broadcast all.. But maybe i am crazy ???

Q

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Send Event
« Reply #1 on: October 24, 2011, 11:18:14 PM »
And when you have Game object selected You get the entire Global Event list instead of just what is available on that Game object..

Q

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Send Event
« Reply #2 on: October 25, 2011, 07:33:49 AM »
I've had the same issue too recently... the send event, however, can target a specific game object if you wish to either drag the object directly to it (what i'd call "hard wiring") or you can create a variable and have the object you wish to send the event to be declared either in a previous state or an action that preceeds the send event action. the "game object" section which is the second from the top in that particular action is where you'd want to set the object or the item.

for example, when a monster is being targeted by the player using the "Mouse Pick" action, i place the object that it picks into a gameObject variable. from there i do a test to determine the tag (you don't need to do this, i do though) and if it's tagged "enemy" it goes to the "dealing damage" state where it uses the "send event" to send the global event "dealt damage" to the object that it's targeting.

granted, my own issue was not knowing how to make an event a global event (the checkbox next to the name in the event browser.)

let me know if that helps or if you need more information.

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Send Event
« Reply #3 on: October 25, 2011, 09:44:32 AM »
Thanks for the reply on how you use this system.. Makes sense. And i do similar.. I guess i was just posting to say that i am not sure it makes sense to work like this..

When we have two choices for Events Global and Local and when i look at my lists and 90% of them are global it just seemed that something was not quite right..

But it works for me right now so i guess i will just go with it.

Q

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Send Event
« Reply #4 on: October 25, 2011, 02:03:40 PM »
Now is the Broadcast all slow enough that having an object list or FSM component list worth while?

Q

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Send Event
« Reply #5 on: October 25, 2011, 11:28:57 PM »
I just started playing with adding a second Scene to my project for up front menus and splash movies etc..

When i went to select a Global Even to Send i got the whole list from the project. Is that supposed to be correct?

Q

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Send Event
« Reply #6 on: October 27, 2011, 10:30:07 AM »
i don't quite know wether it's slower or not to use broadcast or send event so i don't think i can really answer that... but a global event does imply that it's accessible globally so that you're seeing it in another scene does make sense (it's also how i've had to rethink the player health management in my own since i had up to a few days ago been using a global variable to store the health which would lead to multiplayer issues)

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Send Event
« Reply #7 on: October 27, 2011, 11:00:38 AM »
Well i did ask the difference at one time and there were differences between the efficiency of the different Send Event modes.. but how much i do not know..

I guess if you are incrementally loading a Scene or Level then you need to be able to talk from one to the other as they will both be active i guess.. I am working with it as a replace type of loading so it did not make sense to me at first or in my case.

Q