playMaker

Author Topic: Fire and alt fire [SOLVED]  (Read 1581 times)

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 19
Fire and alt fire [SOLVED]
« on: November 13, 2017, 05:45:48 AM »
Hi guys,

I want to make this danmaku shooting system :

  • if player press fire then create bullet1,
  • if player held button x seconds then create bullet2 all long player held down fire button (alternate fire).

For now, i'm trying this :
- Idle is waiting for "Get Button Down", it stores the result in the bool fireIsPressed.
- IsFiringOnce, take position of owner, create the bullet,
- FireBoolTest is waiting for x secondes and is testing the bool :
   - if true (means player's still pressing "fire1" button), it goes to HOLDFIRE event.
   - if false (means player's not pressing anymore "fire1" button), it return to Idle Start state.

Of course, it's not working, i don't know why but the bool does not set to false when the fire button is release.

I try to make a "shootmanager" in another gameobject in the scene, it set correctly the bool but no result when i test the condition (it do not send to the STOPFIRE event, even if the bool is false).

Do i try with the wrong "get..." action or something else ?

« Last Edit: November 14, 2017, 04:25:14 PM by djaydino »

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Fire and alt fire
« Reply #1 on: November 13, 2017, 09:58:01 AM »
After some investigations,
it seems that my bool test, can't accept the bool to be true.

« Last Edit: November 13, 2017, 10:13:32 AM by Vanyfraise »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Fire and alt fire
« Reply #2 on: November 13, 2017, 07:03:50 PM »
Hi,
Try a different setup :

State 1 : have a 'mouse down' action. on mouse down go to state 2

State 2 : have a mouse up action and a wait. Connect the mouse up transition to State 3 and wait to State 4.

State 3 : Do single shot

State 4 : Do HoldFire and have a mouse up action when you need to know if released, to go back to State 1.

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Fire and alt fire
« Reply #3 on: November 14, 2017, 05:16:02 AM »
I'll try this, thank you.

And thank you for your coin magnet video that i just use to make mine :D

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Fire and alt fire
« Reply #4 on: November 14, 2017, 08:46:41 AM »
Hi,
Try a different setup :

State 1 : have a 'mouse down' action. on mouse down go to state 2

State 2 : have a mouse up action and a wait. Connect the mouse up transition to State 3 and wait to State 4.

State 3 : Do single shot

State 4 : Do HoldFire and have a mouse up action when you need to know if released, to go back to State 1.

It works but i need to repeat the alternate fire as long the button is pressed !

[EDIT] Ok it works ! I put another state making a loop aside . Thank you very much !

« Last Edit: November 14, 2017, 09:14:13 AM by Vanyfraise »