playMaker

Author Topic: HUD Help  (Read 1270 times)

patheticorganic

  • Playmaker Newbie
  • *
  • Posts: 11
HUD Help
« on: June 23, 2020, 04:28:41 AM »
Hey guys,
I'm making a dash system for my game and I want to have 4 dashes that can regenerate over time. I could theoretically be able to make that already with the knowledge I have, but I don't know how I can "sync" the HUD (4 separate arrow icons on the bottom left) to disappear every time I use a dash.
With other stamina systems that usually uses a bar, you could just change the dimensions of the bar itself since it is just one object. The arrow icons are four different objects under one parent, but I am not sure how I can separately remove and regenerate the icons when I use the dash.
Thank you.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: HUD Help
« Reply #1 on: June 23, 2020, 01:13:29 PM »
Hi.
You can Use Get/Set  Fsm Actions
Also on the Ecosystem you can find more fsm actions (for Example Fsm Int add)

Make a fms somewhere (call it 'Dash Counter' for example).
Have a variable (call it 'Dash Count' for example)
Then when you press 'dash' first do 'Get Fsm Int' (or 'fsm int compare' from the Ecosystem)
to check if your Dash Count is not 0, if 0 don't dash.
If not 0 do dash and do 'Fsm Int Add' (-1)

on the 'Dash Counter' fsm :
you can use a 'Int Changed' and when changed have a 'int switch' and for example if 3 you can show 3 arrow icons and hide the others.

Then have another fsm to handle the timer, for example :
have a wait (3 sec)
then Get fsm int and compare if its at the maximum, if not do fsm int add (1)

you can also 'reset' the timer when doing a dash by using send event and use a global transition on the state with the wait.