playMaker

Author Topic: [SOLVED]Start a fsm or action sequence when int value reaches a specific number?  (Read 71 times)

PINKCANNON

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Hello

I am new to Playmaker and scripting in general... so with that being said, here are my noobish questions.

I have a global int variable converted to a string to show onto the UI.
I want to activate actions/fsm everytime the int value reaches a milestone that I could set but don't know how to do that either.

Random but related Scenario:
My car rolls and at every 25km I would like for a big red light to flash and tell me that I am out of gasoline...

How could I achieve that with my variables?


« Last Edit: November 01, 2017, 03:27:46 AM by PINKCANNON »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2254
    • View Profile
    • jinxtergames
Hi,
It depends a bit on your setup, but here are some ideas :

You can use some 'int compare' actions on the int variable. for each milestone.

or you can use a single 'int compare' but set a variable and add 25 after each milestone to compare to that global.

You can find many tutorials on the User Tutorial Wiki Page to get you familiar with playmaker.

btw: a Tip : you should try to minimize using globals.
you can use "get/set fsm" actions to get/set local variables on fsms

PINKCANNON

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Hi,
It depends a bit on your setup, but here are some ideas :

You can use some 'int compare' actions on the int variable. for each milestone.

or you can use a single 'int compare' but set a variable and add 25 after each milestone to compare to that global.

You can find many tutorials on the User Tutorial Wiki Page to get you familiar with playmaker.

btw: a Tip : you should try to minimize using globals.
you can use "get/set fsm" actions to get/set local variables on fsms

Thank you! I will give it a look.
And it's a one scene game. I have 2 globals set up my int & string and thats it. I only need those. The milestone is to activate upgrade buttons each time player reaches a specified value. A type of clicker game but with an end since i don't want to get into math to much.

PINKCANNON

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Did the int compare method and worked like a charm. Thank you again!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2254
    • View Profile
    • jinxtergames
Hi,
No Problem :) happy to help