Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by jcl. 04/20/24 08:52
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (7th_zorro, Aku_Aku, henrybane, flink, 1 invisible), 712 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
XBox 360 Controller #439276
03/30/14 13:00
03/30/14 13:00
Joined: Jul 2013
Posts: 158
F
Feindbild Offline OP
Member
Feindbild  Offline OP
Member
F

Joined: Jul 2013
Posts: 158
Do we have support for the xbox 360 controller? I can't find anything in the manual about it.
This would be (another) major drawback for Acknex if it didn't have controller support... Yes I know about joy_*, wiimotes, the support of 3D mice, but nothing about xbox controller support.

Re: XBox 360 Controller [Re: Feindbild] #439277
03/30/14 13:23
03/30/14 13:23
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Can be used with the DirectInput API
http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx


Visit my site: www.masterq32.de
Re: XBox 360 Controller [Re: MasterQ32] #439279
03/30/14 13:31
03/30/14 13:31
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
joy_* pretty much includes all types of gamepads (I'm using those variables to play my game with an XBox 360, PS4 and even a Nintendo 64 controller).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: XBox 360 Controller [Re: Superku] #439290
03/30/14 16:06
03/30/14 16:06
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
You can just use the predefined engine variables (joy_*), like Spuperku said. Maybe this will help you:

Code:
//XBOX 360 CONTROLLER INPUT////////////////////////////////////
var XBOX360_get_deadzone(var axis)
{
	if(axis < -0.5){ return((axis+0.5)*2); }
	else if(axis > 0.5){ return((axis-0.5)*2); }
	else { return(0); }
}

#define XBOX360_BUTTON_X 258
#define XBOX360_BUTTON_Y 259
#define XBOX360_BUTTON_B 257
#define XBOX360_BUTTON_A 256
#define XBOX360_BUTTON_LB 260
#define XBOX360_BUTTON_RB 261
#define XBOX360_BUTTON_BACK 262
#define XBOX360_BUTTON_START 263
#define XBOX360_BUTTON_LEFT_STICK 264 
#define XBOX360_BUTTON_RIGHT_STICK 265
#define XBOX360_TRIGGER_LEFT maxv(joy_raw.z/255,0)
#define XBOX360_TRIGGER_RIGHT abs(minv(joy_raw.z/255,0))
#define XBOX360_STICK_LEFT_HORIZONTAL XBOX360_get_deadzone(joy_raw.x/255)
#define XBOX360_STICK_LEFT_VERTICAL XBOX360_get_deadzone(joy_raw.y*(-1)/255)
#define XBOX360_STICK_RIGHT_HORIZONTAL XBOX360_get_deadzone(joy_rot.y/255)
#define XBOX360_STICK_RIGHT_VERTICAL XBOX360_get_deadzone(joy_rot.x*(-1)/255)


Re: XBox 360 Controller [Re: oliver2s] #439325
03/31/14 14:42
03/31/14 14:42
Joined: Jul 2013
Posts: 158
F
Feindbild Offline OP
Member
Feindbild  Offline OP
Member
F

Joined: Jul 2013
Posts: 158
Hey, thank you for your helpful answers!! laugh
My problem with the default joy_* functions were
1) no vibration and
2) you can't press both triggers at once, one of the most important functions of them (zoom then shoot for example)

I will look into the DirectInput API, that looks promising but complicated.

Re: XBox 360 Controller [Re: Feindbild] #439326
03/31/14 14:57
03/31/14 14:57
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Originally Posted By: Feindbild
2) you can't press both triggers at once, one of the most important functions of them (zoom then shoot for example)


Ah yes, that's right.

Re: XBox 360 Controller [Re: oliver2s] #439395
04/02/14 02:47
04/02/14 02:47
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
@ Feindbild: did you get any more info on the triggers? I recently purchased a wired 360 controller only to find such a disapointment


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: XBox 360 Controller [Re: DLively] #439396
04/02/14 05:51
04/02/14 05:51
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
This allows for the triggers to operate. If anyone finds an algorithm for both triggers, I, Feindbild, and many others would appreciate it very much, until then Here is how you can get started with the triggers laugh

Code:
var left_trigger;
var right_trigger;

var left_trigger_press;
var right_trigger_press;

function hold_triggers(){
    left_trigger = maxv(joy_raw.z/255,0);
    right_trigger = abs(minv(joy_raw.z/255,0));

    left_trigger_press = (left_trigger>0);
    right_trigger_press = (right_trigger>0);
}

action suchandsuch(){

    while(comparison){wait(1);
        if(left_trigger_press == 1 && right_trigger_press == 0){this();}
        if(right_trigger_press == 1 && left_trigger_press == 0){this();}
    }

}


Thank you for the contributiono Oliver2s laugh
I hope this is helpful for anyone else

Last edited by DevoN; 04/02/14 06:33.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: XBox 360 Controller [Re: DLively] #439432
04/02/14 19:28
04/02/14 19:28
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Middle console button for the 360 remote.
Anyone know the joy_code for this?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: XBox 360 Controller [Re: DLively] #439435
04/02/14 20:00
04/02/14 20:00
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Draw (DEBUG_VAR) key_lastpressed in a loop and find it out yourself the easy way!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1