Page 1 of 1

Aiming with joystick ?

Posted: 2008-10-20 13:50
by General Dragosh
Is it possible to manually set the mouse look to the plane joystick ?

Purpose: In reality tank turrets use joysticks to move the turret(IIRC.)

So i thought if its possible to add a second option to move the sight with the joystick... :D

Re: Aiming with joistick ?

Posted: 2008-10-20 13:51
by Tirak
Your suggestion is confused. Are you talking about Infantry, Tanks, .50s driving, be more precise.

Re: Aiming with joystick ?

Posted: 2008-10-20 14:03
by Rhino
well in the CR2 they dont have a joystick, more like a game pad that looks very much like a PS gamepad hehe.

but ye, it is possible to setup the turret to move with your joystick (and mouse if you want as well) in your control settings.

Since all commands have 2 option box for the same action, you can setup the land vehicle settings so that your look/aim commands are to be your mouse in the first box (should be by default anyways) then setup the 2nd boxes for your joystick.

not too hard really.

Re: Aiming with joystick ?

Posted: 2008-10-20 14:14
by General Dragosh
Is it just me or there are NO look/aim commands for the mouse axis in the options ?

I dont think i could ever do that ingame options...

Re: Aiming with joystick ?

Posted: 2008-10-20 14:43
by Rhino
going by memory i thought there was controls there to put in in the ingame menu for this but looks like this isn't so.

How ever it should be possible to do this in at least 1 of 2 ways I can think of, the 2nd one I know for sure would work its just not the best method.

so ye, first off you should be able to hack the controls.con in your profile settings out of game to add this type of control.

now if you dont know your controls.con is located in your profile folder which you can find in your My Docs: My Documents\Battlefield 2\Profiles\

then in there should be a bunch of folders from 0001 upto how many profiles you have on your computer, 0001 is most likly yours depending on the profile you use but if you have a bunch and your unsure go in each and open each Profile.con with notepad until you see the username you use.

Then make a backup of your controls.con in your profile just encase this dont work and it screws it up some how so you can revert to the backup if needed.

anyways once you have done that, open the Controls.con up with notepad, if you look though the settings you will find that there is a:

Code: Select all

ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFMouse IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFMouse IDAxis_1 0 0
this is basically the default of your settings for mouse look.

search for that first line in your control settings.

Now if you look in your profile and look to see what your plane setup with your joystick is should look something like this.

Code: Select all

ControlMap.addAxisToAxisMapping c_PIYaw IDFGameController_0 IDAxis_5 0 1
ControlMap.addAxisToAxisMapping c_PIPitch IDFGameController_0 IDAxis_1 1 0
ControlMap.addAxisToAxisMapping c_PIRoll IDFGameController_0 IDAxis_0 0 0
Now we are really only intrasted in the Pitch and Roll configs so if you go back to the mouse bits you found about in the default settings we can then add our new bits of code in there to look something like this.

Code: Select all

ControlMap.create defaultGameControlMap
ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFMouse IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFMouse IDAxis_1 0 0
[b]ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFGameController_0 IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFGameController_0 IDAxis_1 1 0[/b]
ControlMap.addKeyToTriggerMapping c_GIMenu IDFKeyboard IDKey_Escape 10000 0
ControlMap.addKeyToTriggerMapping c_GIToggleConsole IDFKeyboard IDKey_Grave 10000 0
now you will probaly need to fiddle with this a little since I think the "1 0" or "0 0 " or w/e is on the end of each command means if its inverted or w/e, if you look on the IDAxis_1 of the stick command ive put "1 0" on the end since that is what the plane settings had so not 100% sure if that is correct, you will just have to try it ingame and if its inverted the wrong way, switch it to 0 and just generally have a play around, trial and error till you get it right.

Then once you have done that, save the control.con file up and try it :)

The other way is to use a profiler, if you have one you get one with all Saitek gaming products these days and force it to have a mouse output axis on the profile and then you load that profile before game but not the best way since you most of the time can't set it up with a clean axis.

Re: Aiming with joystick ?

Posted: 2008-10-20 15:58
by General Dragosh
Hmmm.... weird, doesent work when it should... :-(
W
ell i attached my controls.con file if u can look at it ?

I dont know anything of coding so its very hard to understand anything, i get lost easly :D

Re: Aiming with joystick ?

Posted: 2008-10-20 16:06
by Rhino
go down to the bottom where you will find it again and put it in again there, may help.

Re: Aiming with joystick ?

Posted: 2008-10-20 16:23
by Swe_Olsson
I admire you cleverness Rhino.

Re: Aiming with joystick ?

Posted: 2008-10-21 11:04
by General Dragosh
Nope still doesent work, but thx for trying to help :D

Have u tryed yourself that ?

Re: Aiming with joystick ?

Posted: 2008-10-21 16:55
by scandhi
tried it my self and the pitch anf roll settings seem to överwrite the mousecontrols. So on spawnscreen i have to use mouse to select spawn and use mouse to accept. But the tankturret is still not been able to move with my mouse. Got a saitek cyborg evo.

Re: Aiming with joystick ?

Posted: 2008-10-21 16:57
by Fluffywuffy
So you can't aim while on the ground with a mouse?

Re: Aiming with joystick ?

Posted: 2008-10-21 17:50
by Rhino
Swe_Olsson wrote:I admire you cleverness Rhino.
:p


well the other way is just to use the profiler to emulate a mouse axis with the joystick but that's a little complicated I'm not 100% sure how to set that up hehe.

In fact with the Saitek profiler its pretty easy, just a little confusing since the x52 has a mouse built into it but if you remove the current mouse (its a little stick for your left thumb, very hard to use accurately :p ) then you can program you normal joystick axis to use the mouse axis.

Image

then you can just load the profile on before you run game and if you want to fly jets / choppers and do tank aiming etc all with the same profile then if you have different modes on your stick like my x52 has (note, 3 modes) then you can set up the first mode to just use normal and the 2nd or 3rd mode to use the mouse axis.

I may try it some time :)

Re: Aiming with joystick ?

Posted: 2008-10-21 17:51
by scandhi
oh yes i can. i use mouse as infantery and it works great. it' just that i too wanted to use the joystick driving tanks and EEEspecialy APC. Nice crawl u know. :wink: Anyways; i get this "only use joystick" effect not in the tank/APC turret as i wanted, but just on the spawn screen. Not much else is effected. :confused:

Re: Aiming with joystick ?

Posted: 2015-06-21 20:05
by ando
Maybe it is a bit late, but I found the solution for those who want to aim tank turrets with a joystick. I hope at least that some is still interested in it :razz:

[R-DEV]Rhino: you said you have to put these two lines:
ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFGameController_0 IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFGameController_0 IDAxis_1 1 0

over here:
ControlMap.create defaultGameControlMap
ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFMouse IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFMouse IDAxis_1 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookX IDFGameController_0 IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_GIMouseLookY IDFGameController_0 IDAxis_1 1 0

ControlMap.addKeyToTriggerMapping c_GIMenu IDFKeyboard IDKey_Escape 10000 0
ControlMap.addKeyToTriggerMapping c_GIToggleConsole IDFKeyboard IDKey_Grave 10000 0

But when you do that, your mouse blocks. What you actually got to do is to put those two lines over here:
ControlMap.create LandPlayerInputControlMap
ControlMap.addKeysToAxisMapping c_PIYaw IDFKeyboard IDKey_D IDKey_A 0
ControlMap.addKeysToAxisMapping c_PIThrottle IDFKeyboard IDKey_W IDKey_S 0
ControlMap.addAxisToAxisMapping c_PIMouseLookX IDFGameController_0 IDAxis_0 0 0
ControlMap.addAxisToAxisMapping c_PIMouseLookY IDFGameController_0 IDAxis_1 1 0
ControlMap.addButtonToTriggerMapping c_PIFire IDFMouse IDButton_0 0 0
ControlMap.addButtonToTriggerMapping c_PIFire IDFGameController_0 IDButton_0 0 1

now the mouse view also is blocked, but only for aiming tanks. I tested it and it is real fun to aim with a joystick. I like it even more than the mouse hahaha
I hope you do too.

Kind regards
Ando Lataire

ps: I am playing version 1.3.1