Gamepad Issue

Get help using Construct 2

Post » Wed Aug 21, 2013 1:20 am

read the manual, it explains how to pick gamepads by index.

always read the manual first
B
43
S
12
G
6
Posts: 446
Reputation: 6,797

Post » Wed Aug 21, 2013 5:01 am

@philx I have not yet found a way to do it. And either way works, I just dont want to repeat the whole list of commands for 4 controllers, when it seems like it should be simple to call on certain sprites with certain controllers, without having to set up code for 4 different controllers.
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Wed Aug 21, 2013 5:03 am

[QUOTE=Sargas] read the manual, it explains how to pick gamepads by index.

always read the manual first[/QUOTE]

@Sargas You obviously misunderstand the issue. I have read the manual several times, it does not explain a way to do what I ask. So in turn, I ask you to READ THE QUESTION before jumping to conclusions.

Thanks
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Wed Aug 21, 2013 9:27 pm

yeah i totally understand your issue and i am facing exactly the same "problem".
i tried to solve it with families and instance variables now but couldnt get either to work. so maybie ill just make an event for each of the four players -.-

@Sargas you completely misunderstood our problem here.
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Thu Aug 22, 2013 2:53 am

@philx I tried the families too. It seems like something so simple to pull off, but there just doesn't seem to be a way. Im sure there is something. I work on about 10 projects at a given time, as soon as I return to it Ill let you know of any progress I make.
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Thu Aug 22, 2013 8:50 am

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.andreyin2013-08-22 08:52:56
B
121
S
41
G
40
Posts: 841
Reputation: 27,859

Post » Fri Aug 23, 2013 12:36 am

[QUOTE=andreyin] 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.[/QUOTE]

Hey man, thanks! I can confirm that it works with up to 3 controllers by adding a 3rd tank. Great job!
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Fri Aug 23, 2013 5:23 am

No problem, glad to hear it worked!
B
121
S
41
G
40
Posts: 841
Reputation: 27,859

Post » Tue Dec 24, 2013 5:03 am

[QUOTE=andreyin] No problem, glad to hear it worked![/QUOTE]

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:
https://www.dropbox.com/s/qhnpvol91w8k5dp/tank_firerate.capx



Any ideas on a way around this?

digitalsoapbox2013-12-24 05:10:09
B
66
S
37
G
22
Posts: 506
Reputation: 18,646

Post » Tue Dec 24, 2013 12:28 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: istero and 10 guests