Revise Control setup

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
Post Reply
jibbles

Revise Control setup

Post by jibbles »

One thing missing from Vegastrike is the ability for a user to create a set of custom controls.

The way I have done this in the past is save the control names as a string (such as: "Axis A+" for up on the A axis whatever it might be, "Key Z" for the keyboard key Z, or "Button 1" for button 1 on the joystick). When a match is made in game (e.g. Axis A on the joystick has moved), we can make a corresponding move on the game. To make a match we can use an if statement like so:
if <control>.substring(0,4) == "Axis" (to determine if its an axis first, we don't want to unnecessaryily make axis checks).
if <control>.substring(5,1) == "A" (check that Axis A has been set)
<move forward speed of axis value> (e.g. value 65535 = max speed)

It is assumed that the axis' are named Axis A (for first Axis and so on). Axis values are assumed to be from 0-65535. And subsrting is (start byte, number of bytes to substring).

Setting the controls:
have a button the user clicks, then wait for input from the various devices (for axis, if it has moved say 10% from its original position)

The reason I ask for this is because I have either no roll on the joystick (2 axis joystick and throttle), or my throttle becomes thr roll (using the 3 axis Joystick and throttle).

One last thing to add, is the whole dead zone thing. This is because my joystick doesn't sit 100% upright, so on long flights it can drift off course making me miss the target by several light seconds.
I reckon it could be done by grabbing the neutral position of the axis, and depending on the dead zone value, ignores movement up to a certain point (e.g. 10% either side of neutral)

I hope my descriptions are ledgible.
Cheers
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

We have a problem here as the engine is currently it is only possible to change the bindings out of game the config file is one of the first things read changing one thing in it means going back and restart everything so it is actually easier to do it out of game try this utility http://vegastrike.sourceforge.net/forum ... php?t=8895 have fun 8)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
jibbles

Post by jibbles »

Yea lol, i figured that much. The facility really needs to be built into the code to make this an easy task. \
Because the settings are stored in the XML file, would it be possible to edit those values. I'll give it a go and see what happens, (make a backup in case things go horribly wrong)
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Just use a XML aware editor Notepad++ works great under XP while just about any of the Linux text editors has syntax highlighting.that little java script utility works great with 0.4.3 i haven't figured out how to modify it for SVN version yet.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
jibbles

Post by jibbles »

Since my last post, i've created a small utility that can edit the appropriate lines in the XML file for basic pitch/yaw/rool/and throttle. I'll expand it if I can be bothered at some stage. (It also creates a backup of the original XML file so you can revert back if needs be)
Post Reply