Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] joystick movement

#1
Hi dear Xonotic team,

I got a weird issue with using joy-pad.

When I turn left/right, there is step left/right and turn left/right behavior in the same time, but with keyboard, there is only turn behavior so, I think that there is a default configuration of using a joy-pad and maybe the horizontal axis is defined to step behavior in a first place.

I have checked in the file data/xonotic-data.pk3dir/defaultXonotic.cfg but it doesn't help me as I wanted to.

Do you have any idea if there is a configuration file for joy-pad and keys in general as well ?

Thanks a lot

--
Julien
Reply

#2
Try xonotic-sdl, it sometimes works better with joypads. And you can configure your binds the same way as with the keyboard, in the menu.
Reply

#3
I would to do so, but here is the thing, in the setting menu, there are not the turn left/right commands, just the step behavior command.

So I have change it in the source code by changing the behavior of step one by turn one because I don't need the step one.

After this change, it work well for keyboard but with my joy-pad, the behavior have just added the both of them.

However, in all config files I found (home/.xonotic/data/config.cfg and data/xonotic-data/defaultXonotic.cfg), the binds are rightly set for JOY_LEFT and JOY_RIGHT, respectivily to +left and +right.

I don't understand what is happening.
--
Julien
Reply

#4
Oh, alright. You want to change the joy_* cvars in the advanced settings window. Type joy_ in the filter to see the relevant cvars. There you can associate analog axes to movement.
Reply

#5
Thanks a lot for your answer but I have managed to fix the problem just before.

I have found in the source code the file vid_shared.c which handles joy-pads commands and I have just reversed the axis for step behavior to turn behavior.

It works fine.

By the way, maybe you should do the same in a new release, because with a classic joy-pad (horizontal axis and vertical axis), the associated movement should be move forward/backward and turn right/left, if not, you can't turn the camera.

Hope it can help, Bye and Thanks for your help
--
Julien
Reply

#6
Can you tell me what exactly you changed in the source code? Maybe it can be changed by editing cvars, without any engine mod needed. Axes have to be configured differently for each joypad, it's kind of arbitrary. That's why there are joy_* cvars that are supposed to do what you did in the source code, but in configuration files instead.
Reply

#7
When you open file vid_shared.c, in the darkplaces directory, you have access to any joy_pads cvars.

I have noticed that the cvar_t joy_axisyaw for turn camera behavior were setted to axis number 2 while the other one, cvar_t joy_axisside were setted to axis numer 0 (horizontal one).

So, I have reversed the numer of axis of the both of them because with my joy_pad, I don't need to step, only to turn the camera.

But I completely understand if you would prefer modify these with config files indeed to modify the source code as I did.

It's just that I only need the turn behavior and like that, the axis 0 is always setted to the behavior I want.

Hope this help, Bye!
--
Julien
Reply

#8
There's no need to recompile the engine and edit the default settings. Just use the advanced config editor in the menu to set your variables to something different than the defaults. It'll be saved to your config file.
Reply

#9
Just to be understood well, if I have modified the engine, it's just because I never need to use step movement behavior.

You're completely right by saying that I could change only the default setting but I would do that if I sometimes need to turn camera, and sometimes to step camera which is not the case !

So I hope you understand why in my case, I have modified the engine directly to use only turn behavior with the good axis.

Bye Mr Bougo and really thanks for all your answer to my differents topics.
--
Julien
Reply

#10
If what you did in the source code was change the line
Code:
cvar_t joy_axisyaw = {0, "joy_axisyaw", "2", "which joystick axis to query for looking right/left"};
to
Code:
cvar_t joy_axisyaw = {0, "joy_axisyaw", "0", "which joystick axis to query for looking right/left"};
and other similar line changes, you would get EXACTLY the same effect if you set the cvar joy_axisyaw to 0 in the menu's advanced configuration, or by adding the line
Code:
set joy_axisyaw 0
to your autoexec.cfg config file.

What the joy_axis* cvars do is map actions to axes on your joypad. If you want axis 0 to do the turning and axis 2 to do the stepping, you would set joy_axisyaw to 0 and joy_axisside to 2. Moreover, to disable stepping completely, you can map it to axis -1. I still don't understand what you think is different between setting the cvar in the source or in the config file. Feel free to explain in french if you want to.
Reply

#11
Oh my mistake !

From the beginning I thought that you would me to change the cvar directly in the game in the setting menu and I didn't understand why because first of all, I didn't find the command line you told me and second of all, I need to erase the step behavior.

Now I understand what you mean and I am going to change the config file directly.

Thanks
--
Julien
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] Joystick wont work? axe 7 9,721 04-05-2013, 04:31 PM
Last Post: Mr. Bougo

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-