playMaker

Author Topic: Loop state  (Read 3263 times)

joepalos

  • Playmaker Newbie
  • *
  • Posts: 28
Loop state
« on: July 30, 2016, 05:12:23 AM »
As of right now, to run a specific state X times I have to:
  • Create an INT variable
  • Create a "add INT" action to add +1 every loop
  • Create an INT check every loop to see if the INT variable is over the specified number
  • If for some reason I want to run the loop again, set the INT to zero
Couldn't this tedious process be concatenated in a single action?

For example, an action with an internal INT that goes up +1 every time you enter its state, and when the INT goes over the specified value, fires up the specified transition (FINISHED or whatever) and returns the internal INT to zero in case you want to run the loop again.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Loop state
« Reply #1 on: July 30, 2016, 06:59:30 AM »
Hi,
If you need to do this on many objects, maybe you could use a template?

joepalos

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Loop state
« Reply #2 on: July 30, 2016, 11:33:27 AM »
That would certainly be possible, but I really prefer using prefabs, and I think it wouldn't remove the need for dozens of single-use +1 counter variables, for example.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Loop state
« Reply #3 on: July 31, 2016, 04:32:28 AM »
Check the ecosystem, there is a loop action but it is not called loop but something else...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Loop state
« Reply #4 on: July 31, 2016, 05:46:43 AM »
Hi,
The loop action is called 'Iterate' and you can get the Ecosystem Here
(there is a little problem with the search atm, just spam search untill it works)

joepalos

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Loop state
« Reply #5 on: August 02, 2016, 05:26:10 AM »
Thanks a lot for this, I'll try it soon. It's going to be very convenient if it works.