Help - Search - Members - Calendar
Full Version: Sixaxis Pack!
Game Maker Community > Games > Game Maker Creations > Tools & Applications
nutter999
Got a PS3 controller? If so I have made a pack that allows you to play and create GM games that are compatible with the Sixaxis controller!
The pack contains the neccesary drivers (not made by me), a program which helps you to install and test the controller (with button checking, analog diagrams and analog positions), my Analog Control game (use the analog stick to carefully go through a maze without touching the sides) and my Nugget Mania Conveyor mini-game (Jump over explosives on an accelerating conveyor belt using the PS3 controller or keyboard). Here is the YYG link:

http://www.yoyogames.com/games/show/99602

Any comments and feedback (positive or negative) are welcome.
Enjoy!

Edit: If anybody makes a Sixaxis compatible game or application can you please leave a link in this topic? Thanks!
Newly Discovered
holy crap, awesome! I don't have my controller at the house right now, but I'll grab it tomorrow and test this out.
does this support R2 L2? I'm working on a racing game but it sucks having a constant flow of drive power...R2 would make it so much better!
having that pressure sensitive "gas petal" is a ton better than the up arrow key... if it doesn't, PLEASE ADD IT!
nutter999
L2 and R2 are considered at either on or off. However, the analog sticks are checked to a percentage in each direction, so you could make it so an analog stick up accelerates and down decelerates or something. The test app in the pack is a good way to see how accurate the analog sticks are.
Newly Discovered
aw that's disappointing! the analogs are good, but they're hexagons, not circles...not like it matters too much though.
I tried playing with the joystick controls but it's a lot of work...I'm trying set it up so you get an accurate pressure variable for the joysticks.
I set up the directional variable, but pressure is a bit more complex using two position values.

it's a great addition to gm, if only R2 and L2 worked as they should sad.gif
nutter999
Okay. PM if you want any help or anything.
And the test app can also be used to tell how off centre your analog sticks are :L
ga05as
The left analogue stick can be mapped using

joystick_xpos(1)
joystick_ypos(1)

but what is the right stick classed as

when i check joystick_exists(2) it returns false so its not

joystick_xpos(2)
joystick_ypos(2)
Newly Discovered
it's joystick_rpos(1) and zpos(1)
ga05as
QUOTE (Newly Discovered @ Oct 15 2009, 08:17 PM) *
it's joystick_rpos(1) and zpos(1)


thank you

i worked out the buttons

the code below will return the name of the button

eg.
if sixaxis_button() = "circle"{
instance_create(x,y,obj_bullet)
}



CODE
//sixaxis_button()
var i;
i = 0
while(i<19){
    if joystick_check_button(1,i) = true{
    if i = 1{
        return("select")
    }
    if i = 2{
        return("l3")
    }
    if i = 3{
        return("r3")
    }
    if i = 4{
        return("start")
    }
    if i = 5{
        return("up")
    }
    if i = 6{
        return("right")
    }
    if i = 7{
        return("down")
    }
    if i = 8{
        return("left")
    }
    if i = 9{
        return("l2")
    }
    if i = 10{
        return("r2")
    }
    if i = 11{
        return("l1")
    }
    if i = 12{
        return("r1")
    }
    if i = 13{
        return("triangle")
    }
    if i = 14{
        return("circle")
    }
    if i = 15{
        return("x")
    }
    if i = 16{
        return("square")
    }
    if i = 17{
        return("ps")
    }
        break;
    }
    else{
        i+=1
    }
}

return("none")
nutter999
Yeah, Newly Discovered is right. On the test app the 'labels' for all the values are pretty similar to the function names used to get the values. And joystick_exists(2) would check if theres a 2nd controller plugged in. But it makes me wonder if you can use 2 controllers at once. I'm posting from mobile now, so I'll try to test it tomorow.

EDIT: Tomorrow I'll post some code I used to make the test app as well.
ga05as
Can you utilize the six axis motion sensor?
nutter999
QUOTE (ga05as @ Oct 15 2009, 08:40 PM) *
Can you utilize the six axis motion sensor?


As awesome as that would be, it is unlikely.
ga05as
awww. i am working on a joystick mapping script so we can make games like skate that uses the analogue sticks insead of buttons do do tricks
nutter999
Sweet. When i added the analog diagram things into the test app i thought it could help with perfecting Skate tricks. Great minds think alike eh :L?
Tomorrow i'll make a key release script, as there isnt an inbuilt GM joystick_button_release.
I'll happily test anyone's Sixaxis based projects by the way.
nutter999
EDIT: ignore this post, i accidentally double posted.
ga05as
QUOTE (nutter999 @ Oct 15 2009, 09:19 PM) *
Sweet. When i added the analog diagram things into the test app i thought it could help with perfecting Skate tricks. Great minds think alike eh :L?
Tomorrow i'll make a key release script, as there isnt an inbuilt GM joystick_button_release.
I'll happily test anyone's Sixaxis based projects by the way.


analogue diagrams in the test app ehh

can i download this test app
nutter999
In the Sixaxis Pack. The Install + Test exe. In the test bit. The analog diagrams are the circles that represent where the analog sticks are.
Edit: Its not really too much of a diagram now i think about it. More a visual representation.
ga05as
QUOTE (nutter999 @ Oct 15 2009, 09:40 PM) *
In the Sixaxis Pack. The Install + Test exe. In the test bit. The analog diagrams are the circles that represent where the analog sticks are.
Edit: Its not really too much of a diagram now i think about it. More a visual representation.


ahh i see now

in pseudo(ish) code here is what i plan to do if anyone else wants to try it.

Save all of the points that the analogue stick is in (during the trick) to an array.

then join up these points with lines, and then draw that line with lots of points ontop of an image of where the line is ment to be.

the image of where the line is ment to be would be a fat white line on a black back background
then when the black (Player drawn) line is drawn on top it would be effictivly be erazing some of the white

and depending on how much white is left maby 70% the program would decide if the line made by the player is ment to be the line in the image.

do you get me
Newly Discovered
nice little script there ga05as, that'll come in handy!

I didn't really understand your idea for skate tricks, but here's mine:
create a path of the motion you'd move the joystick. create an object that follows the path. create an object in the same starting position, but follows your analog motion. with the analog object, use collision_circle(x,y,radius) to check if it's colliding with the path's object. if it is colliding, success!

maybe a path is too difficult. maybe just a sprite to collide with would work just as well. a thick line in the shape you'd move, and collision_point for your analog object.
ga05as
good idea that would probably work aswell,

the only problem with that is you can only check for one trick at a time sad.gif
Newly Discovered
do a switch check based on the position of the analog? maybe collision circles in 8 directions.
nutter999
Not really sure what youre trying to do, but it sounds like you could just do
CODE
//Step of analog representation
Instance_create(x,y,obj_circle)

If(joystick_check_button(1,17))
{room_restart}

This would place an object wherever you go so you could see what you did with the sticks on screen. And you could restart with PS button.
ga05as
that bit is the easy bit

except i used paths, and it resets itself when you stop doing the trick.
the problem is how to check which built in pattern it is most like

you can download it here but i havent added the pattern checking yet. just the drawing of the trick you did with the analogue stick



(btw its the right analogue stick you have to move)
nutter999
I'll check that out tomorrow morning. Anybody like the idea of a GMCG for the Sixaxis?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.