playMaker

Author Topic: Conditional Expression Action (BETA)  (Read 52415 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Conditional Expression Action (BETA)
« Reply #15 on: August 25, 2014, 12:13:33 PM »
One thing that I think could bear mentioning here is that this action is quite helpful in making complex actions simpler.

For example... I have it working in the camera control system where I want to make the camera move if the player is outside of a certain range. Previously I'd have to set up a system that uses the float operators, bool tests, that kinda thing and then do a test... And since some of those work best as a sequential action that meant I'd have to make that system cycle through every frame/unit-of-time.

This changes... Now I just get the position of the player and camera every frame and in the expression itself I have "player-pos > (camera-pos + padding)" for each direction. Saves me time and really makes for a much cleaner state.

So, I guess this is me singing praise for Lea's work. Thank you!

emperor1412

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Conditional Expression Action (BETA)
« Reply #16 on: September 20, 2014, 01:26:27 PM »
Hi, the plugin is cool, I suggest that the next update would allow to access global FSM variables

gamedivision

  • Full Member
  • ***
  • Posts: 227
Re: Conditional Expression Action (BETA)
« Reply #17 on: October 09, 2014, 10:31:07 AM »
Could someone just expand on the functionality how does it get access to variables just by naming them,and are we talking about the variables that are only attached to that specific FSM

Thanks

gamedivision

  • Full Member
  • ***
  • Posts: 227
Re: Conditional Expression Action (BETA)
« Reply #18 on: October 11, 2014, 05:56:39 AM »
Could this be used to remove trigger boxes based on camera distance,like if cam-Pos = to collider then remove otherwise show

play_edu

  • Full Member
  • ***
  • Posts: 116
Re: Conditional Expression Action (BETA)
« Reply #19 on: April 16, 2015, 08:39:37 AM »
I tryed with this action It's Work fine in pc but not Working on Mobile.
i'm i missing something?

« Last Edit: April 21, 2015, 08:27:57 AM by play_edu »

centaurianmudpig

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Conditional Expression Action (BETA)
« Reply #20 on: August 04, 2015, 09:03:40 AM »
This is very useful. It would be great if it could work with global variables.

I hope this hasn't been abandoned since it is undocumented and not implemented in the PlayMaker package.

Tremzoff

  • Guest
Re: Conditional Expression Action (BETA)
« Reply #21 on: June 20, 2016, 11:17:00 AM »
I have a question concerning Conditional Expression Action and strings. How should the Expression look for checking wether a string matches or not?

string == "something" ?

Is there any documentation for the Expressions syntax and/or operators?


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: Conditional Expression Action (BETA)
« Reply #22 on: June 20, 2016, 04:19:41 PM »
Yes, put the value in quotes, e.g., name == "Bob"

There's some documentation here:
https://hutonggames.fogbugz.com/default.asp?W1226

It could probably use a bit more detail in terms of syntax and operators allowed.
But the result field gives you feedback as you edit the expression which should help...

EDIT: BTW this action is now included with Playmaker, so you should use that version.

Tremzoff

  • Guest
Re: Conditional Expression Action (BETA)
« Reply #23 on: June 21, 2016, 04:18:13 AM »
@Alex Chouls

Thanks a lot! And looks like the online documentation got a little extended ;-)

Regards

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: Conditional Expression Action (BETA)
« Reply #24 on: June 21, 2016, 11:14:27 AM »
Yeah, I added the string example :)

Alatriste

  • Full Member
  • ***
  • Posts: 198
Re: Conditional Expression Action (BETA)
« Reply #25 on: January 16, 2017, 01:29:15 PM »
Can you call for global variables? If so, how the expression would be?

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Conditional Expression Action (BETA)
« Reply #26 on: January 17, 2017, 12:48:46 AM »
Hi,

 Good questions! I have pinged Alex on this. We'll know soon.


 Bye,

 Jean

marv

  • Junior Playmaker
  • **
  • Posts: 50
Re: Conditional Expression Action (BETA)
« Reply #27 on: February 03, 2017, 07:46:47 AM »
It would be grand if this action could be updated with an "Error Event" similar to the "xml select single node" action for when the content of the string variable used to store the condition is invalid.

I'm using the conditional expression action to test conditions read out of xml files and if there's a mistake somewhere in one of them (which happens easily) the fsm simply stops working instead of allowing me to output an error message.

This would help greatly to weed out those errors without bogging down the whole system.
« Last Edit: February 03, 2017, 07:49:30 AM by marv »

marv

  • Junior Playmaker
  • **
  • Posts: 50
Re: Conditional Expression Action (BETA)
« Reply #28 on: February 20, 2017, 08:28:54 AM »
Okay, I found another problem with this action that kind of makes it not viable anymore for what I actually wanted to use it for.

When using a string variable to change the actual expression (not the values of the variables used) in runtime it just doesn't update properly and continues to use the initial value of the string variable set in the editor.

Edit: it doesn't work properly when you change the value of the string in the editor either, even with the "refresh" button... I can't believe I hadn't noticed that earlier.

Any chance of someone picking work on this action up again? This is actually pretty major for me since I started redesigning "availability checks" of events and other things around this action... probably should've tested it more thoroughly... for some reason I didn't notice this for quite some while.

edit2: Well, turns out when used in a template it works properly the first time around, but afterwards it uses the string value from the first run... and I'd only done a test run with one "item", saw it worked and then started implementing it everywhere.
« Last Edit: February 20, 2017, 09:28:56 AM by marv »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Conditional Expression Action (BETA)
« Reply #29 on: February 22, 2017, 01:28:56 AM »
Hi,

 and if you reenter the state where you have the expression, does it work then?

I would raise a bug report on this too anyway. It would be good to change expression at runtime I agree.

 Bye,

 Jean