Page 1 of 2

Changing Controls

Posted: August 23rd, 2011, 1:30 pm
by UCLA.RES.
Hello,

I am a neuroscience researcher. We are making trying to make a virtual world for our experimental mice to navigate themselves in. I have learned to use Platinum Arts Sandbox to make the maps, but require assistance in changing the game controls to work with the mouse only.

Basically all I need done is to switch the mouse, up and down directionality capability with the keyboard's W and S respectively. Apparently the only way to do this is with changing the coding. Could anyone please assist me with this. If you are still wondering as to exactly what I am trying to do, please watch this video.



http://www.youtube.com/watch?v=1DJOTEDBA2c

Best,

Re: Changing Controls

Posted: August 23rd, 2011, 5:18 pm
by chocolatepie33
I'm not entirely sure about this, but I think it would be done by modifying one of the many configuration files with keybinds, such as data/defaults.cfg. I hope Hirato comes around, he'd know for sure. Hope you finish your project, I like the look of it.

Re: Changing Controls

Posted: August 24th, 2011, 3:11 am
by Hirato
This would be done through the code.
Essentially you want something akin to the classic doom.

My approach to this would be to
1) create some sort of entropy variable with a limit of about 500 in each direction
2) increase it when the mouse is moved forward and decrease it when it's moved backwards
3) during the update cycle
3.1) set the player1->move to clamp<int>(1, -1, entropy)
3.2) move entropy closer to 0, based on the value of curtime

Good Luck!

Re: Changing Controls

Posted: August 25th, 2011, 1:26 pm
by UCLA.RES.
Thank you pie33 for your help and interest.

Hirato,

Could you possibly give me directions to accomplish this for someone who does not have a coding background? I understand that it is inconvenient for you. However, I think it would be worthwhile because to be able to say that the program you developed was used for scientific research is one large achievement to add to your resume.

Thank You

Re: Changing Controls

Posted: August 25th, 2011, 4:13 pm
by Mike
Hirato he just wants to remove "mouselook" and replace bind W forward with bind (mousemove forward variable) forward. Is there a variable for moving the mouse forward we can use in defaults.cfg? I'll be taking more looks myself today. Take care.
-mike

Re: Changing Controls

Posted: August 25th, 2011, 9:10 pm
by Hirato
Mike wrote:Hirato he just wants to remove "mouselook" and replace bind W forward with bind (mousemove forward variable) forward. Is there a variable for moving the mouse forward we can use in defaults.cfg? I'll be taking more looks myself today. Take care.
-mike
mousemove isn't exposed as a key and therefor cannot be bound without modifications to the code.

I'll make a patch for our little friend, I've already given him as much as I can without holding his hand through every step of the way.

Re: Changing Controls

Posted: August 26th, 2011, 8:27 am
by arcones
Hirato wrote: mousemove isn't exposed as a key and therefor cannot be bound without modifications to the code.
That's what I thought. Hence the reason I never suggested it. Will the patch be included in the regular version now?

Re: Changing Controls

Posted: August 27th, 2011, 10:31 pm
by Hirato
http://pastebin.com/XtLvAEuH (download as mousemove.patch)
It is a complete hackjob, it works poorly (but it works!) and I will not be committing this to sandbox
if you do use it, /mouselook 1 will return normal behaviour

Linux instructions
1) download to sandbox directory
2) run 'patch -p0 -u < mousemove.patch' in sandbox directory
3) run 'make -C src install' in sandbox directory

Re: Changing Controls

Posted: August 30th, 2011, 4:01 pm
by UCLA.RES.
I tried, literally all day to apply the patch. I did everything I could. Went on google to try to learn how to do it. Downloaded 4 programs that were supposed to do it for me and I tried simply imputing it places I thought it should go. All with no success. Can anyone help me out please?

Re: Changing Controls

Posted: August 30th, 2011, 5:31 pm
by arcones
Just to make sure, you used Hirato's instructions? Or are you not using Linux?