Game Development Community

Building Beta2 1.1 with Xinput mod?

by Nicolas Stohler · in Torque Game Builder · 03/27/2006 (11:35 am) · 16 replies

I just downloaded and rebuilt the TGB beta 2 1.1. this worked fine, but then I tried reapplying the Xinput mod from http://tdn.garagegames.com/wiki/Torque/EngineMods/Xbox360ControllerSupport . It did compile, but when i just start the T2D.exe, the whole menu interface that I did see on the unpatched version does not load, also, I do not get any mouse button (closing tgb with alt-f4 works...). do i need to patch this mod for it to work? i noticed the directory structure changed a bit...

btw, I'm using VS2005, standard edition to compile TGB

#1
03/28/2006 (2:15 am)
Ok, I merged previous code modifications into the new TGB beta2 1.1 code, recompiled it and now it looks like it works again (level builder loading and working). I will test this once I get home from work (dont have a gamepad here, of course).

is there a way to upload files to this forum?
#2
03/28/2006 (9:44 am)
No, but you can upload files to TDN and reference them here.
#3
03/28/2006 (9:52 am)
Thanks jason.

I just finished testing the code. it works again. I'm going to make sure that the samples all work and then upload it there.

I'm allowed to upload my compiled t2d.exe there, or am I mistaken? It's a t2d-buyers only area there, yes?
#4
03/28/2006 (1:36 pm)
Oh, if you want, I can rebuild the latest and greatest with the XInput mod and update my links. That probably makes the most sense. My links are restricted to T2D owners. I didn't understand what you wanted to upload. I'm happy to fix this up, if you like.
#5
03/28/2006 (1:48 pm)
Oh, didnt realize at first that you're the one that started this mod!
I've got your mod running now, I just wanted to convert the sample scripts a little so I can run them side-by-side with my other samples (...I just planed to do this as an exercise, so I get faster into all this scripting stuff and see how it works). I didn't get as far as I wanted to this evening, but I think I'll have everything ready sometime tomorrow. I'll just upload it to TDN then and send you a link. Then I'll let you decide if you want to put my stuff on your tdn site or not.
#6
03/28/2006 (5:46 pm)
That would be way cool if you updated them Jason!

~Steve
#7
03/28/2006 (8:53 pm)
Ok, uploaded it:

[links removed]

scroll down for updated official files

(how do I make real links here in this forum??)
#8
03/28/2006 (10:28 pm)
Thanks Nicolas! Just picked up a 360 controller this evening. Time to learn.
#9
03/28/2006 (10:39 pm)
Edit: removed my files

scroll down for updated official files
#10
03/28/2006 (10:57 pm)
Nicolas -- please don't take my post as being "territorial", but can you edit your post to remove your links. I've updated my TDN page so that the links now work with Beta 2. I went through my diff tonight and integrated it with B2 (there were some conflicts in the diff). Also, I maintain this code for everyone, including people with TGE and TSE, so I'd prefer to not have "patches" laying around.

Also, I've broken out the source code from the samples and from the compiled exe... that way, going forward, if people just want the latest version of the exe, they can download that. Here's the links to the latest versions of everything:

The TDN article for this mod
Xbox 360 Controller Support

Source code mod for TGB 1.1 Beta 2
JoystickXInputAndRumble1.4.zip

Samples showing how to use XInput and Rumble (no longer contains the exe)
DeviceSamples1.4.zip

Compiled SHIP build of TGB 1.1 Beta 2 with the XInput mod applied
TGB-XInput-B2.zip
#11
03/28/2006 (11:45 pm)
Jason -- sorry for that, I just thought I put them up when I saw it worked, didn't knew if you had time to update your page soon, so I thought maybe other users were looking for the fixed files as well.

One request though: can you include the fix for the rotateTo function, please (it's in source/T2D/t2dPhysics.cc). Just take a look at that file in my code-"fix", it's the only thing that changed there (details)
#12
03/28/2006 (11:51 pm)
Sure. I will compile that into the EXE, but I'm not going to put it in the source code of the diff, since I want the diff to just cover XInput stuff... that way, it's less confusing to apply just the XInput stuff to subsequent builds when that fix is applied. Does that work?

And -- hey -- thanks for being understanding. As I said, I'm really not trying to be a controlling bastard about the sources and I appreciate you helping the community by getting something out there!
#13
03/29/2006 (12:06 am)
Done. The link above contains the RotateTo fix compiled into the EXE.
#14
03/29/2006 (3:42 pm)
Hey Jason, would you mind if I merged this into head?

Edit: Going to e-mail instead, that's a better idea.
#15
03/30/2006 (12:47 pm)
Yes, i hope this mod can make it into head too!

Jason, one more question:

I'm playing around with my Xbox 360 controller and your mod. In your script you have the following calls:

$enableDirectInput = "1";
activateDirectInput();
enableXInput();

everything works ok for the gamepad actionmaps. but i did notice that if I want to open the console using the ~ (tilde) key, it doesn't work as smoothly as without the above lines: most of the time I have to keep the key pressed down for about half a second, otherwise I only see a short flicker of the console and then it's gone again. is there a workaround for this??
#16
03/30/2006 (3:59 pm)
No. I get that too. It's a general problem with the DirectInput implementation in Torque (not my mod). What's happening is the console is setting a new actionmap t=not using DirectInput which is causing this mess. I'd welcome a solution to it too.