Discuss Scratch

Wettining
Scratcher
500+ posts

Xbox 360 Controller Support Mod?

bump

Last edited by Wettining (Dec. 31, 2016 00:39:05)

johny5134
Scratcher
71 posts

Xbox 360 Controller Support Mod?

bobbybee wrote:

…and done!

https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js

Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!

The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png

Have fun!
How exactly do you install this, please reply soon, I really look foward to this
Thepuzzlegame
Scratcher
1000+ posts

Xbox 360 Controller Support Mod?

johny5134 wrote:

bobbybee wrote:

…and done!

https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js

Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!

The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png

Have fun!
How exactly do you install this, please reply soon, I really look foward to this
Go into the editor, open up the browser console and paste this code in and press enter. Then check the More Blocks section and the blocks should be loaded
happyland440
Scratcher
1000+ posts

Xbox 360 Controller Support Mod?

Awesome! Does it work with DUALSHOCK controllers?
bobbybee
Scratcher
1000+ posts

Xbox 360 Controller Support Mod?

happyland440 wrote:

Awesome! Does it work with DUALSHOCK controllers?

No idea. Feel free to try it, though.

EDIT: I think so.

Last edited by bobbybee (Feb. 23, 2016 22:28:19)

DonnyCraft
Scratcher
100+ posts

Xbox 360 Controller Support Mod?

This is amazing! I'll use the extension in my game!
bobbybee
Scratcher
1000+ posts

Xbox 360 Controller Support Mod?

DonnyCraft wrote:

This is amazing! I'll use the extension in my game!

Your welcome
sonicthejoe
Scratcher
11 posts

Xbox 360 Controller Support Mod?

(Post removed)

Last edited by sonicthejoe (May 25, 2016 18:11:07)

addius8
New Scratcher
2 posts

Xbox 360 Controller Support Mod?

bobbybee wrote:

…and done!

https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js

Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!

The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png

Have fun!


Hey there ! Your mod is very very useful, but nearly every controller uses the left and right top “buttons” (you named them left and right bottom) as “force” buttons. Usually you can control speed or anything like this with force.

Could you add this feature to the mod? Everyone here would apprechiate this very much . So we can use these control buttons as force buttons like the joystick force function ))

Thank you very much )
KEL5isGod
Scratcher
27 posts

Xbox 360 Controller Support Mod?

GIANT BUMP!
Suggestions:
whencontrollers connected>2whencontrollers on>2rumblecontroller1for...secondsiscontroller1axbox onecontroller?iscontroller2axbox 360controller?iscontroller3aps3controller?iscontroller4aps4controller?iscontroller5aother consolecontroller?doescontroller1usexInput?doescontroller2usedirectinput?dpadbuttonuppressedoncontroller1?
lukefandlukel
Scratcher
4 posts

Xbox 360 Controller Support Mod?

Thepuzzlegame wrote:

110Percent wrote:

How does one import a JSON extension? I can only seem to import html ones using the Offline Editor.
Go into the web console and paste the code for the extension
But how do i get into the web console?
TheDragonMaster42
Scratcher
4 posts

Xbox 360 Controller Support Mod?


bobbybee wrote:

…and done!

https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js

Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!

The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png

Have fun!

Thepuzzlegame wrote:

110Percent wrote:

How does one import a JSON extension? I can only seem to import html ones using the Offline Editor.
Go into the web console and paste the code for the extension

How does one go into the web console?
CatIsFluffy
Scratcher
100+ posts

Xbox 360 Controller Support Mod?

Look it up.
Benfun
Scratcher
16 posts

Xbox 360 Controller Support Mod?

Help me at https://scratch.mit.edu/discuss/topic/297482/?page=1#post-3055887

Last edited by Benfun (April 7, 2018 09:50:29)

jcgamer
Scratcher
29 posts

Xbox 360 Controller Support Mod?

Hmm, so what do you do after you put the code into the HTML console?
Wettining
Scratcher
500+ posts

Xbox 360 Controller Support Mod?

jcgamer wrote:

Hmm, so what do you do after you put the code into the HTML console?
After you put it into the Javascript console the blocks should show up in the “More Blocks” category and you should be able to connect a controller to your computer to use it.
thelegosensei
Scratcher
21 posts

Xbox 360 Controller Support Mod?

it's cool, but the way it's coded makes it a bit hard to implement into a scratch game.

I would do it like this:

Xinput1LeftstickXXinput1Apressed?Xinput1connected?
I deem this one most important:
Xinput1LeftstickX
I tried to make a little dot move around in circles with the joystick, but ultimately couldn't due to how the directional thing works. I couldn't create a diagonal axis using two axis, because it's locked on direction and force. great plugin, but I can't really use it without this ability.

if it gets reimplemented like I showed above, then it would blow Joy2Key out of the water.

Last edited by thelegosensei (July 10, 2018 00:04:28)

SeeminglyOkay
Scratcher
77 posts

Xbox 360 Controller Support Mod?

I know you want it to be built into Scratch as a block, but wouldn't it be better to use an external program to map XInput to Keyboard?
thelegosensei
Scratcher
21 posts

Xbox 360 Controller Support Mod?

SeeminglyOkay wrote:

I know you want it to be built into Scratch as a block, but wouldn't it be better to use an external program to map XInput to Keyboard?

the reason I want it is analog controls is the ability to tilt the joystick slightly or fully, in any analogue direction. and that can't be replicated with the keyboard.

getting exact numbers from the controller is really the best in many cases.

Last edited by thelegosensei (July 10, 2018 18:40:55)

bobbybee
Scratcher
1000+ posts

Xbox 360 Controller Support Mod?

thelegosensei wrote:

I tried to make a little dot move around in circles with the joystick, but ultimately couldn't due to how the directional thing works. I couldn't create a diagonal axis using two axis, because it's locked on direction and force. great plugin, but I can't really use it without this ability.

You can compute the components in Scratch as:

X = Force * cos of Direction
Y = Force * sin of Direction

Hope this helps

(The blocks for cos/sin are in Operators, if you haven't used them.)

Powered by DjangoBB