playMaker

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

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Fire and alt fire [SOLVED]
« on: November 13, 2017, 03: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, 02:25:14 PM by djaydino »

Vanyfraise

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

https://youtu.be/7UbyuMrijlU
« Last Edit: November 13, 2017, 08:13:32 AM by Vanyfraise »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Fire and alt fire
« Reply #2 on: November 13, 2017, 05: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: 7
    • View Profile
Re: Fire and alt fire
« Reply #3 on: November 14, 2017, 03: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: 7
    • View Profile
Re: Fire and alt fire
« Reply #4 on: November 14, 2017, 06: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, 07:14:13 AM by Vanyfraise »