playMaker

Author Topic: [SOLVED] help with send message  (Read 3354 times)

cel

  • Full Member
  • ***
  • Posts: 132
[SOLVED] help with send message
« on: January 05, 2013, 10:52:57 AM »
I am trying to send a message every frame but there is no option in the action to do so....
I am adding a value to a float variable every second and trying to pass this variable to a script using send message (using it with simple way point system) but the variable isn't updated to the script...

Maybe if there was an option in the send message action to do it every frame??
« Last Edit: January 06, 2013, 10:11:14 AM by cel »

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: help with send message
« Reply #1 on: January 05, 2013, 03:30:14 PM »
I don't know if it would work, but how about making a send message in a state and then have a FINISHED transition into a state that does the exact same thing and just loop them back and forth between the two.. maybe even put a wait state in there aswell :)
Remember, you don't fail unless you give up trying to succeed!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: help with send message
« Reply #2 on: January 05, 2013, 07:33:19 PM »
You can use the Next Frame Event action to loop a state.

P.S. I'll add an every frame option to Send Message in the next update...


cel

  • Full Member
  • ***
  • Posts: 132
Re: help with send message
« Reply #3 on: January 06, 2013, 06:11:10 AM »
thanks alex, that worked perfectly....

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • Pixel Life - portfolio
Re: help with send message
« Reply #4 on: January 06, 2013, 09:58:01 AM »
why didn't I think of that  ???
Remember, you don't fail unless you give up trying to succeed!

bizilux

  • Full Member
  • ***
  • Posts: 171
Re: [SOLVED] help with send message
« Reply #5 on: December 29, 2013, 11:23:42 PM »
has this ever been done?

i cant really use next frame event... because in the same state i have action "float interpolate"  so that state cant be restarted every frame...

"every frame" option would do wonders for me here...


im basically trying to slow down a car, gradually... sure there are other ways to do it, but this is the most elegant one i think

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] help with send message
« Reply #6 on: December 30, 2013, 06:50:53 AM »
Hi,

 The problem with this approach is that it's not performant at all, using "sendMessage" ( regardless the use of PlayMaker) is not a good idea to send everyframe.

Did you wrote that script you are sending events to or is it a framework you got from the asset store?

bye,

 Jean

bizilux

  • Full Member
  • ***
  • Posts: 171
Re: [SOLVED] help with send message
« Reply #7 on: December 30, 2013, 08:37:05 AM »
hey jean,

its framework from "simple waypoint system"  im using changespeed method to change speed of the car during runtime, so that when car detects obstacle, it slows down gradually and not straight to 0.

if every frame isnt an option, then i guess i could use float substract, and substract it by 0.1... and do that every frame...  and then clamp float value...

the problem is that you dont know how many frames per second the user on the phone will have... but okey i think its doable

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] help with send message
« Reply #8 on: December 30, 2013, 09:16:12 AM »
Hi,

 The other solution is to make a custom action that talk to simpleWaypoint framework efficiently.

Bye,

 Jean