playMaker

Author Topic: Get Event Info help  (Read 3727 times)

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Get Event Info help
« on: June 21, 2011, 08:54:39 PM »
I can't figure out how to properly use Get Event Info actions in conjunction with other fsms to, can anyone elaborate more please about how to use them and when you would for example?

thx

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Get Event Info help
« Reply #1 on: June 21, 2011, 09:06:26 PM »
I haven't used it myself, but at a glance it seems like an action that's best suited for debugging, or general tracking of what states are firing where and when. 

If you understand the basic premise of how State Machines work in PlayMaker, this action will output each of the requested datatype.  So for example if you have an event that sets a float somewhere, you can use this action to determine the value of that float, what object and FSM it came from, and so on.

I would probably use it for debugging my scripts, but that's about it.  I could see it being useful for some level of automated reporting and assembling of data for the purpose of feedback in a more complex State Machine as well.

Take it with a grain of salt, because I really just read the description and poked around with it in order to answer your question.  Take it with a grain of salt.  ;)

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Get Event Info help
« Reply #2 on: June 21, 2011, 09:39:09 PM »
Thanks for the insight.

In your opinion then, what meathod would be be used for recieving the value of damage lets say caused by another object?

eg: if my player gets hit by a fireball, how would you set that up?  Apply some value to the fireball (eg: i cause 10 damage upon impact), and then along with a ONCOLLISIONENTER how do you get the fireball to pass that damage value onto the player and subtract that health from him appropriately?


artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Get Event Info help
« Reply #3 on: June 22, 2011, 12:02:33 AM »
You want to use a "CollisionEvent", found under the Physics actions group.  You need physics primitive components on both objects, and at least one must have a rigidbody component.  Then you can pass the data between the two objects when they collide.

For example, put a numeric variable on your Fireball object that's something like 10 (or whatever), and call it "Damage" or something.  When the Fireball hits the Player object, the Collision event will trigger and you can use it to send a specific event to trigger another state, or pass the Fireball Damage variable and subtract the value from Player health, or whatever. 

Good luck!

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Get Event Info help
« Reply #4 on: June 22, 2011, 02:11:47 AM »
Which specific set of actions would i use for that setup?