playMaker

Author Topic: Who Can explained how to make same system ?  (Read 1748 times)

vultar

  • Playmaker Newbie
  • *
  • Posts: 2
Who Can explained how to make same system ?
« on: April 04, 2016, 11:29:44 AM »
Hello there, can anybody explain to me how can I make such a system so that I can prescribe the combination to the buttons can be generated randomly by any expert there who knows how to do it, please help !!! scrolling buttons that must be pressed in time (will some action), or, if the button is not pressed in time will be different action.I Want to know how to implement it by means of Gu all to implement it?

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Who Can explained how to make same system ?
« Reply #1 on: April 04, 2016, 07:05:35 PM »
Hi and welcome to the forums!

This can easily be done but I would recommend sitting through some basic tutorials first and just learning the basics first (I dont know that you havnt, but Im just offering some advice in case you havnt as I dont want my full answer to scare you off playmaker :) . It really is an amazing tool that can do everything you will ever need to, but If I had received a reply like the one below when I started (6/5 months ago)- I would have dropped it all and ran lol. Because from my reading of your question, it is quite complex to answer in a forum post).

Im a bit of a noob myself, but I think I have a basic system like you need worked out, minus the scrolling, but if the scrolling is your main goal, then Im sure basic animations or translate, tween or move towards actions should do it.

Regarding the general button timing gameplay setup, I will try to explain as best as I can, but please ask if something is not clear:


(be warned I tend to ramble and over/under explain at times, so it is a bit long)


First create the gui. Add the 'correct button to press indicator' images to the Unity gui canvas. Make sure they are all in the position you want them to appear and then deactivate their game objects (tick box in inspector).

Make an FSM. In start state add these actions: 'random int', 'int switch'.

On the 'random int' action, set the minimum to 1 and maximum to how many buttons you will use. I will use 3 for an example.

On the 'int switch' action set it to the maximum ints that the random int action can produce (so 3 in my example). Then enter the ints (1,2 & 3) as switches. Make each swich transition into a seperate event.

In the 3 new events you created add the actions: 'activate game object',  'get key down', 'wait'.

In the 'activate game object' action, drag the 'correct button to press' indicator game object from the hierachy. Make sure to drag a different button game object into each state.

In the 'get key down' action, Set a different key for each state and make sure it corresponds to the 'correct button indicator' game object' sprite/image.

Then create 2 events and add them to each of the 3 states you just created. (eg: 'win' & 'fail').

In the 'get button down', for send event chose 'win'.

In the 'wait' action; set the time you want the button to be active for. And for finish event chose 'fail'.

Then create 2 more states called 'won' and 'lost'. And link 'win' transitions/events to the 'won' state - then link the 'fail' transitions to the 'lost' state.

In the 'win' condition add points(using 'int operator' action)to the points int (or whatever the win is).

In the 'lose' state subtract (using 'int operator' action) points (or whatever happens in your game when the player fails to press a button in time).

Then add a' finish' event and transition it back to the start event.

Critique and Improvements:

As I said this is just a very basic start to what you need, but to explain it all in my style in a forum post is pretty impossible. But I will just try to give a very brief rundown of the basic idea of improvmemts that would need to be made:

For the scrolling just use animations and play them each time a button is turned on or add an fsm to the button indicator game objects that mkes them tween/translate/move twoards. Then just make a wait time between the activation of the button indicator and the activation of the actual button. Time it so it turn the button itself when the button indicator is in the Hit box
  :)

This is clearly a never ending loop but it should be easy to figure out a way to end it. (eg. Add 1 to an int each time you fail, then an int compare in the beginning (the top of the action list) of the start state, which ends the state and sends it to another state (a game over screen for example) -if the losses have reched a certain number.

This basic setup is lacking a fail condition for wrong button presses, but all you would do is add more 'on button down' actions to the states that hold that action already and setup so that the incorrect buttons being pressed also fires the 'fail' event.

Also to make this work for sequences of buttons duplicate this FSM as many times as you would like buttons per sequence.

Then add bools for every time a button is pressed correctly or fails to ensure buttons have to be pressed in sequence. Also other fine tuning will be required.

Also to make the sequemces of varying length. Just make the minimum random int 0 and on the switch make sure 0 sends to a state that turns off a bool. in the FSM that activates the next button image in the sequence: add a bool test in the first state if it is false the state should just spin around back to start wirhout acrivatimg anything (this will ensure that if buttons 1 and 2 are on but 3 is not on, then nor will any buttons be firther in the sequemce.

Usually I think you will find better and more understandable/readable (that is if anybody ever read this far) help on these forums, if you post a description of something you are trying to do and is not working- then the top people here can easily help you fix your setup.

But I was bored and thought Id have a go at this :D .  Good luck with it and I hope my rambled reply helped somewhat and has not scared you off from playmaker, it really is awesome.
« Last Edit: April 04, 2016, 07:25:35 PM by Zeldag »

vultar

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Who Can explained how to make same system ?
« Reply #2 on: April 05, 2016, 11:16:46 AM »
I hope this will help me, thank you for taking the time and write instructions, very grateful