Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (flink, AndrewAMD, TipmyPip, 1 invisible), 667 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
4 player split screen #465159
04/06/17 18:59
04/06/17 18:59
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Is there a way to handle 4 players? I know we can plug in 2 controllers, but is it possible to have 4 players? 4 controllers? 2 on keyboard and 2 on controllers? Not sure if that would work since some keys stop other keys.

Re: 4 player split screen [Re: jumpman] #465164
04/07/17 09:45
04/07/17 09:45
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Perhaps let on use the mouse? Or joystick? How many keys does the player have to hold simultaneously? If it is not to absurd, 2 can be on the same keyboard as long as its has anti ghosting.

Re: 4 player split screen [Re: Reconnoiter] #465165
04/07/17 10:52
04/07/17 10:52
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Use the XInput Plugin by SuperKu. It's pretty easy to use and can handle 4 controllers. Afaik it was 'AckXinput'


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: 4 player split screen [Re: alibaba] #465170
04/07/17 18:05
04/07/17 18:05
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
thank you for the replies friends!

Re: 4 player split screen [Re: jumpman] #465179
04/10/17 10:42
04/10/17 10:42
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
You can just use the win api to catch input from the controllers. I once managed 8 controller inputs. Or direct-input, but I never used this.
I think up to 16 controller can be connected.

Re: 4 player split screen [Re: jenGs] #465191
04/10/17 15:47
04/10/17 15:47
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi JenGs,

What does that mean? The Api is a dll/plugin I use?

Re: 4 player split screen [Re: jumpman] #465193
04/10/17 17:08
04/10/17 17:08
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
Hi,
First you need to include the windows.h

#include <windows.h>

then you need to set up some needed structs:

Code:
typedef struct { 
	UINT wXpos; 
	UINT wYpos; 
	UINT wZpos; 
	UINT wButtons; 
} JOYINFO; 

typedef struct { 
    WORD wMid; 
    WORD wPid; 
    char szPname[32]; 
    UINT wXmin; 
    UINT wXmax; 
    UINT wYmin; 
    UINT wYmax; 
    UINT wZmin; 
    UINT wZmax; 
    UINT wNumButtons; 
    UINT wPeriodMin; 
    UINT wPeriodMax; 
    UINT wRmin; 
    UINT wRmax; 
    UINT wUmin; 
    UINT wUmax; 
    UINT wVmin; 
    UINT wVmax; 
    UINT wCaps; 
    UINT wMaxAxes; 
    UINT wNumAxes; 
    UINT wMaxButtons; 
    char szRegKey[32]; 
    char szOEMVxD[260]; 
} JOYCAPS;



Then you need to declare the methods you want to use from the Windows API, because windows.h only has a fraction declared.

Code:
UINT WINAPI joyGetPos(UINT uJoyID, JOYINFO* pji);
UINT WINAPI joyGetNumDevs(VOID); 
UINT WINAPI joyGetDevCaps(UINT uJoyId, JOYCAPS* pjc, UINT cbjc);



These are some methods I used.
You need to test the for joiIds, save them somewhere and use the controller id with joyGetPos. You can read about it on msdn.

Of course there are other (perhaps better) ways to capture jostick input. (I think directinput is better but in my experience it is not that nice to use directx interface methods with acknex, but as I said, I never used it).

Re: 4 player split screen [Re: jenGs] #465201
04/11/17 20:51
04/11/17 20:51
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
hey thanks Jengs! Do you have a finished game/demo with this controller support if possible?

Re: 4 player split screen [Re: jumpman] #465205
04/12/17 00:27
04/12/17 00:27
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
sadly not. I will try to extract it out of my old project this weekend, if you are willing to wait that long.

Re: 4 player split screen [Re: jenGs] #465209
04/12/17 14:15
04/12/17 14:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
What's giving you trouble about it/ have you tried doing so yet? You're using lite-C now, right?
Have a look at joyGetPosEx, too. It returns more data than joyGetPos.
The data obviously can be easily converted into (Gamestudio) standard values or factors, for example like this:
joyStickForceX = (Xpos-32768.0)/32768.0; // and so on


"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: 4 player split screen [Re: jenGs] #465211
04/12/17 16:12
04/12/17 16:12
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Thanks man! You dont have to extract the code if you dont want to, I would be fine with just playing a closed exe without the resources open, I have multiple USB controllers and would like to see it in action in gs

Page 1 of 2 1 2

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