Posted December 26, 2014
Background
I started on WC1 but found it nearly unplayable because of the large joystick deadzone in the game.
I set out to fix it, trying alternative versions of doxbox, without success.
Prerequisite
I have now "fixed" it, but it does come with a prerequisite: You must be running a script through Thrustmasters Target Script Editor.
So... if you don't have a joystick from Thrustmaster, you are probably out of luck (I don't know if its possible to get joysticks from other vendors working thought Target Script Editor). But... perhaps something can be done with software from other vendors.
Resume of fix:
Use trim on X and Y axis (depending on position) to set value of position out of the deadzone.
Specifics of fix:
Inside the main() function, I mapped the Engine Fuel Flow - Left switch to these 2 settings (turning "fix" on and off):
//---- snip on ------
MapKey(&Throttle, EFLNORM, EXEC("StopAutoRepeat(2);TrimDXAxis(DX_X_AXIS, SET(0));TrimDXAxis(DX_Y_AXIS, SET(0));"));
MapKey(&Throttle, EFLOVER, REXEC(2, 25,"RemoveDeadZone();"));
//---- snip off ------
After the main() function, I created 2 functions to handle the trimming:
//---- snip on ------
// Removes dead zones from games, by trimming X and Y axis
int RemoveDeadZone()
{
int xval;
int yval;
int sval;
int xtrim;
int ytrim;
xval = Axis[DX_X_AXIS].pos;
yval = Axis[DX_Y_AXIS].pos;
// sval sets the value for trimming
// That value can either be set directly, or by getting it from the FC Slider
// I suggest that for testing out what value suits you the best, use the slider
// afterwards set it to the desired value.
// For instance, in Wing Commander 1, with my Joystick, I prefer a value of 205
// So, remark out the line you dont want, and remember to turn of the printf line when you have a set value.
//sval = Axis[DX_SLIDER_AXIS].pos/128;
sval = 205;
xtrim = GetTrimValue(xval);
ytrim = GetTrimValue(yval);
TrimDXAxis(DX_X_AXIS, SET(xtrim));
TrimDXAxis(DX_Y_AXIS, SET(ytrim));
//printf("\xa--X = %i, sval = %i, xtrim = %i", xval, sval, xtrim);
};
int GetTrimValue(int pos)
{
int t;
int slide;
// slide sets the value for trimming
// That value can either be set directly, or by getting it from the FC Slider
// I suggest that for testing out what value suits you the best, use the slider
// afterwards set it to the desired value.
// For instance, in Wing Commander 1, with my Joystick, I prefer a value of 205
// So, remark out the line you dont want
slide= 205;
// slide = Axis[DX_SLIDER_AXIS].pos/128;
if (pos == 0) t=0;
else if (pos >= 1 & pos <=25000) t=slide;
else if (pos > 25000) t=0;
else if (pos <= -1 & pos >= -25000) t=0-slide;
else if (pos < -25000) t=0;
return t;
};
//---- snip off ------
I hope some of you will get use of this. I couldn't find a solution posted anywhere else, so perhaps I am saving some of you a lot of time (I'm not a programmer, so to figure this out actually took quite some time).
If anyone is interested I'll upload my my scripts somewhere accessible, though tbh except for this fix and the way I set the throttle to work, there is nothing to be proud of.
I started on WC1 but found it nearly unplayable because of the large joystick deadzone in the game.
I set out to fix it, trying alternative versions of doxbox, without success.
Prerequisite
I have now "fixed" it, but it does come with a prerequisite: You must be running a script through Thrustmasters Target Script Editor.
So... if you don't have a joystick from Thrustmaster, you are probably out of luck (I don't know if its possible to get joysticks from other vendors working thought Target Script Editor). But... perhaps something can be done with software from other vendors.
Resume of fix:
Use trim on X and Y axis (depending on position) to set value of position out of the deadzone.
Specifics of fix:
Inside the main() function, I mapped the Engine Fuel Flow - Left switch to these 2 settings (turning "fix" on and off):
//---- snip on ------
MapKey(&Throttle, EFLNORM, EXEC("StopAutoRepeat(2);TrimDXAxis(DX_X_AXIS, SET(0));TrimDXAxis(DX_Y_AXIS, SET(0));"));
MapKey(&Throttle, EFLOVER, REXEC(2, 25,"RemoveDeadZone();"));
//---- snip off ------
After the main() function, I created 2 functions to handle the trimming:
//---- snip on ------
// Removes dead zones from games, by trimming X and Y axis
int RemoveDeadZone()
{
int xval;
int yval;
int sval;
int xtrim;
int ytrim;
xval = Axis[DX_X_AXIS].pos;
yval = Axis[DX_Y_AXIS].pos;
// sval sets the value for trimming
// That value can either be set directly, or by getting it from the FC Slider
// I suggest that for testing out what value suits you the best, use the slider
// afterwards set it to the desired value.
// For instance, in Wing Commander 1, with my Joystick, I prefer a value of 205
// So, remark out the line you dont want, and remember to turn of the printf line when you have a set value.
//sval = Axis[DX_SLIDER_AXIS].pos/128;
sval = 205;
xtrim = GetTrimValue(xval);
ytrim = GetTrimValue(yval);
TrimDXAxis(DX_X_AXIS, SET(xtrim));
TrimDXAxis(DX_Y_AXIS, SET(ytrim));
//printf("\xa--X = %i, sval = %i, xtrim = %i", xval, sval, xtrim);
};
int GetTrimValue(int pos)
{
int t;
int slide;
// slide sets the value for trimming
// That value can either be set directly, or by getting it from the FC Slider
// I suggest that for testing out what value suits you the best, use the slider
// afterwards set it to the desired value.
// For instance, in Wing Commander 1, with my Joystick, I prefer a value of 205
// So, remark out the line you dont want
slide= 205;
// slide = Axis[DX_SLIDER_AXIS].pos/128;
if (pos == 0) t=0;
else if (pos >= 1 & pos <=25000) t=slide;
else if (pos > 25000) t=0;
else if (pos <= -1 & pos >= -25000) t=0-slide;
else if (pos < -25000) t=0;
return t;
};
//---- snip off ------
I hope some of you will get use of this. I couldn't find a solution posted anywhere else, so perhaps I am saving some of you a lot of time (I'm not a programmer, so to figure this out actually took quite some time).
If anyone is interested I'll upload my my scripts somewhere accessible, though tbh except for this fix and the way I set the throttle to work, there is nothing to be proud of.
Post edited December 26, 2014 by Darthwobert