playMaker

Author Topic: Randomly generating movement sequence for platforms.  (Read 3134 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Randomly generating movement sequence for platforms.
« on: July 21, 2015, 02:51:24 AM »


I'd like to use arraymaker for randomly moving platforms up and down, except one platform at a time like this video.


How would this work without mouse input? Since the player has to move the crane object and collide with a separate trigger FSM to confirm one platform collided with crane?

« Last Edit: July 22, 2015, 04:54:57 PM by coffeeANDsoda »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Randomly generating movement sequence for platforms.
« Reply #1 on: July 22, 2015, 04:55:11 PM »
Bump!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Randomly generating movement sequence for platforms.
« Reply #2 on: July 23, 2015, 08:59:26 AM »
Hi,

 that's quite simple to do:

 have an array with all your platforms for that group ( it's like a radio button UI system basically).

-- in your fsm, you'll have an FsmInt called "Current Platform", and that index represent the current platform moving.
-- then you pick a random int within the range of the array, and call that platform for this random int
-- when the platform has finished it calls this fsm ( because it knows who sent the event to actuall move using "get event info" action), and then your fsm can pick another one

Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Randomly generating movement sequence for platforms.
« Reply #3 on: July 25, 2015, 04:07:48 PM »
have an array with all your platforms for that group ( it's like a radio button UI system basically).

Assuming with this system created in the fsm manager that it requires a Array List proxy script right?

With this method, or at least in this context, one thing at a time.

First of all..

-- in your fsm, you'll have an FsmInt called "Current Platform", and that index represent the current platform moving.

Local int variable set to 3? So it can be used to represent three platforms?



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Randomly generating movement sequence for platforms.
« Reply #4 on: July 30, 2015, 07:26:10 AM »
Hi

yes, use an ArrayList proxy to manage this.

 the number of items in your array represents the number of platforms you want to control. so yes, a local int variable set to 3 means platform 4 ( indexes starts at 0), and it means you must have at least 4 items or more in your array ( 4 platforms or more).


Bye,

 Jean

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Randomly generating movement sequence for platforms.
« Reply #5 on: July 30, 2015, 03:05:16 PM »
Hi
 the number of items in your array represents the number of platforms you want to control. so yes, a local int variable set to 3 means platform 4 ( indexes starts at 0), and it means you must have at least 4 items or more in your array ( 4 platforms or more).


So I have to set that local int to 4 even though in reality it's 3?

-- then you pick a random int within the range of the array, and call that platform for this random int

With Array List get random?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Randomly generating movement sequence for platforms.
« Reply #6 on: July 31, 2015, 05:59:10 AM »
Hi,

 yes, platform number 4 will be indexed 3 in the array, cause the first platform has index 0.

the random is if you want platforms to be controlled randomly, else you can iterate the index after each platform finished moving, that's up to you at this point.

 Bye,

 Jean