Gamepad Issue

  • I think I've got it but I don't have a way to test it. Basically it's just a "for" that goes from 0 to gamepad.count. You can set which button is being pressed inside of it.

    I have no idea if the pin at the Start of Layout is working also.

    dl.dropboxusercontent.com/u/2383513/linkedOUT/tanks.capx

    edit: Whoops, I forgot to set the angles to gamepad(loopindex,0).

    And I forgot to mention, whenever using a for you can use "loopindex" to use it on expressions.

  • I think I've got it but I don't have a way to test it. Basically it's just a "for" that goes from 0 to gamepad.count. You can set which button is being pressed inside of it.

    I have no idea if the pin at the Start of Layout is working also.

    https://dl.dropboxusercontent.com/u/2383513/linkedOUT/tanks.capx

    edit: Whoops, I forgot to set the angles to gamepad(loopindex,0).

    And I forgot to mention, whenever using a for you can use "loopindex" to use it on expressions.

    Hey man, thanks! I can confirm that it works with up to 3 controllers by adding a 3rd tank. Great job!

  • No problem, glad to hear it worked!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • No problem, glad to hear it worked!

    I know this is an older post, but I also noticed that if there's any kind of delay on the weapon firing rate, if player 1 is firing then player 2 is unable to fire. If Player 2 is firing, Player 3 is unable to fire, etc.

    Example .capx:

    dropbox.com/s/qhnpvol91w8k5dp/tank_firerate.capx

    <img src="https://dl.dropboxusercontent.com/u/14245368/firedelay.jpg" border="0" />

    Any ideas on a way around this?

  • I see this mistake a lot with new developers. well maybe not mistake, but just not really effective and doesn't behave the way the developer wants.

    Don't nest an Every X seconds under anything. Only use every X seconds at the root. I know it sound like it should work as in

    While condition is met then on every X seconds do this.

    but that usually doesn't.

    Instead you need work another way of handling the problem of next time.

    If Gamepad(loopindex) Right Shoulder is down and array(loopindex) < time

    then

    shoot

    array(loopindex) = time + 0.25

    This is psuedo code of course. But that's what your looking for.

  • The problem is that since it's in a loop, you're basically only checking for each controller every 25 seconds (I think).

    You could use some sort of cooldown (either a timer behaviour or a plugin) together with the loopindex. Wish I could help more but I don't have two controllers anymore, I'm afraid ):

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)