Jump to content


Photo

What would you like to see in a 360controller lib?


  • Please log in to reply
6 replies to this topic

#1 bluesy_92

bluesy_92

    GMC Member

  • New Member
  • 49 posts

Posted 11 October 2010 - 03:49 PM

So, here is what I am planning on including:

Calibrate analog sticks: Instead of using the regular "zero is center" value of GM, you can use your own value, and it will scale analog output (used within the library functions, not GM functions) to that. So, imagine this: you go to a calibrate menu, center both joysticks, press a button, and it records those values. Then, it would use those as center, and scale around it. I didn't make this yet, but I already know the concept, and how to make it work.

Return analog value: This, again, would be based on the value you calibrate to. I could either return this as a percent, or as a -1 to 1, depending on the feedback I get.

Buttons (held, pressed, released) I would, of course, wrap the standard "button held" functions, but I would also use pressed and released functions, which I have already figured out how to use.

Triggers: Being made as a lib rather than a DLL, triggers would still be on the same axis, since it is not xInput. Sorry. But, I would include both a trigger axis, and trigger button functions (if one trigger is pressed in more than a certain amount, it is one value. If not, it is another. This would allow use of the triggers as buttons just as easily as a regular button, since it is "on-off" rather than an analog value)

What else would you like to see? And how should I word the gml functions to call it? eg, 360_xbutton_pressed (lib, what you are checking, what is being returned?) or some other way?

Once I get enough input, I will start on the library.

My goal is: rather than a D&D lib that returns the GML commands, designed around use for beginners, this will be a full-featured GML library, with more freedom than the GML commands allow (such as calibration, pressed and released, and using triggers as an axis or buttons.) This will be designed around the serious 360 controller user, for serious 360 controller use.

Also, I need a name for the lib. Any ideas?

Edited by bluesy_92, 11 October 2010 - 03:52 PM.

  • 0

#2 Alfred0110

Alfred0110

    Programmer

  • New Member
  • 366 posts

Posted 11 October 2010 - 05:10 PM

1. Only topics which showcase an Action Library (LIB) may be posted here. All other topics of discussion will be removed.

It's the first rule for this subforum!
  • 0

#3 PivotGamer84

PivotGamer84

    GMC Member

  • New Member
  • 170 posts

Posted 09 November 2010 - 04:50 AM

I think functions should be like below, and use extension constants.

Example:
if (360_button_pressed(360_btn_X)) {
 // stuff
}
if (360_button_held(360_btn_X)) {
 // stuff
}
if (360_button_released(360_btn_X)) {
 // stuff
}

if (360_joystick_get_tilt_amount(360_js_left) == /* some percentage here */) {
 // stuff
}
if (360_joystick_get_tilt_direction(360_js_left) == /* some number between 0 and 360 here */) {
 // stuff
}

if (360_get_controller_id() == /* number between 1 and 4, 0 is returned if no controllers are paired */)

Constants:
360_trg_left;
360_trg_right;
360_btn_X;
360_btn_Y;
360_btn_A;
360_btn_B;
360_btn_xbox;
360_btn_select;
360_btn_start;
360_bmp_left;
360_bmp_right;
360_js_left; // could be used for joystick, or button
360_js_right; // could be used for joystick, or button

  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14389 posts
  • Version:GM:Studio

Posted 09 November 2010 - 05:12 AM

Like this?
http://gmc.yoyogames...howtopic=476029
  • 0

#5 PivotGamer84

PivotGamer84

    GMC Member

  • New Member
  • 170 posts

Posted 12 November 2010 - 04:05 PM

Like this?
http://gmc.yoyogames.com/index.php?showtopic=476029


Yessir, does it support Xbox360 controller?
  • 0

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14389 posts
  • Version:GM:Studio

Posted 12 November 2010 - 07:11 PM


Like this?
http://gmc.yoyogames.com/index.php?showtopic=476029


Yessir, does it support Xbox360 controller?


The control being a joystick, it probably installs as a joystick; I'm sure someone made a driver for it. All buttons and sticks and dpad should be supported by default as those are on all controlers sold for the PC. Not sure about the triggers, them being analog, and the start button and the vibrate. But I'm confident most of it would work.

I should really hunt down a driver though.

My first short post though was <really> to show what support you can add to a normal joystick, mainly the dead zone and the click, pressed and held implementation included in my wrapper.
  • 0

#7 kburkhart84

kburkhart84

    GMC Member

  • GMC Member
  • 1608 posts
  • Version:GM:Studio

Posted 15 November 2010 - 05:52 AM

I created an extension for action mapping that can also use the joysticks. A user of the extension had the 360 controller, and I can confirm that GM's joystick functions work well with it. The user of my extension wanted to be able to use the L/R triggers as buttons instead of axes, and he never reported to me that they were working as one axis instead of two separate ones, so I would guess that it works fine.

I suggest you look at my extension(called kbinput). I included the scripts as well so you can see how I did it. The reason I suggest is because I implemented using all of the axes as buttons instead of axes, which I saw you were mentioning in your feature list. I don't mind if you use my code so feel free. It is also all gml, no dll so it should be easy to use.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users