Possible to use FOSE to intercept controller button presses

Post » Sat Dec 03, 2011 6:49 pm

So I've recently tried a playthru with a controller on PC, and it's generally good except for one thing. (At least one thing I hope I can do something about) There's no way to quicksave.

Is it possible to use a script to intercept controller button presses and run custom script? What I'd like to do is change the back button to quicksave on press, while having it open the "wait" menu (the default command) on holding it down for a second.

Further, since I use http://www.fallout3nexus.com/downloads/file.php?id=3729, i'm hoping i can use THAT quicksave system, rather than the system quicksave, but before I get into that I want to make sure I can do the basic concept first.
User avatar
megan gleeson
 
Posts: 3493
Joined: Wed Feb 07, 2007 2:01 pm

Post » Sat Dec 03, 2011 9:52 pm

Wrote a quick script that should do the job - and if not at least point you in the right direction.
But you will have to replace X and Y with the scancodes of the correct keys. For a list see the fose command docs.
(I did not test the script at all)

short myKeyshort quicksaveKeyshort waitKeyfloat intervalshort initshort trapfloat timerBegin GameModeif init == 0	set init to 1	set myKey to X	set quicksaveKey to 62 ; F4	set waitKey to Y	set interval to 2endifif isKeyPressed  myKey == 1	if trap == 0		set trap to 1		set timer to 0	else		set timer to timer + getSecondsPassed	endifelse	if trap == 1		set trap to 0		if timer >= interval			tapKey waitKey		else			tapKey quicksaveKey		endif	endifendifEnd

User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Post » Sat Dec 03, 2011 12:51 pm

So I've recently tried a playthru with a controller on PC, and it's generally good except for one thing. (At least one thing I hope I can do something about) There's no way to quicksave.

Is it possible to use a script to intercept controller button presses and run custom script? What I'd like to do is change the back button to quicksave on press, while having it open the "wait" menu (the default command) on holding it down for a second.

Further, since I use http://www.fallout3nexus.com/downloads/file.php?id=3729, i'm hoping i can use THAT quicksave system, rather than the system quicksave, but before I get into that I want to make sure I can do the basic concept first.


I could be wrong, but I would think this could be done. (Although to me it's just as easy to press "F5")

FOSE has a list of keyboard ScanCodes, and Control Codes, but nothing in there for joypads.
There is a Control Code for "Quick Save" so you should be able to just set your "back" button to that without the need for a script.

IF you can't, then http://fose.silverlock.org/fose_command_doc.html#ControlCodes is your best bet...


Here's my idea for quick save that you can use whether you have a controller or not:

http://www.fallout3nexus.com/downloads/file.php?id=1193.
Take a look at the scripts. There is an option to assign a "Hot Key" via menu. See how it works.

1. Create a new item to serve as the trigger
2. Attach a script to it that opens a menu to ask what button to hotkey
3. Make the Hot Key item run your "Quick Save" script.

When you play your new mod the first time, activate the Item, press your "Back" button, and you should be all set up.

There are definitely many more steps to it, but that's the basic gist of what its going to take.
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm


Return to Fallout 3