Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Changing Controls

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Changing Controls

Post 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,
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Changing Controls

Post 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.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Changing Controls

Post 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!
This is not a url, clicking it is pointless
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Re: Changing Controls

Post 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
User avatar
Mike
Administrator
Administrator
Posts: 871
Joined: May 24th, 2009, 12:52 pm

Re: Changing Controls

Post 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
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Changing Controls

Post 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.
This is not a url, clicking it is pointless
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Changing Controls

Post 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?
Image
Want a user bar like this one? PM Leo!
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Changing Controls

Post 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
This is not a url, clicking it is pointless
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Re: Changing Controls

Post 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?
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Changing Controls

Post by arcones »

Just to make sure, you used Hirato's instructions? Or are you not using Linux?
Image
Want a user bar like this one? PM Leo!
Locked