Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Wednesday, May 14, 2014

How to Force a Gamepad to Work with Saints Row 2

I purchased Saints Row 2 off Steam only to discover my PlayStation DualShock controller doesn't work out-of-the-box with it.  After spending an hour experimenting with it, I figured out how to make it work.

The problem is the axes are screwed up.  The game assumes there's an Xbox 360 controller, which has more than four axes.  It also assumes the axes do different things or are in different positions.  This causes the uncontrollable scrolling effect when starting up the game.

How Saints Row 2 recognizes controller input:
Axis 1: Non-existent.  Doesn't correspond to any button or axis on a DualShock.  (May also be a default setting for unused axes.)
Axis 2: Left analog stick back/forth movement.  (Y-axis)
Axis 3: Left analog stick left/right movement.  (X-axis)
Axis 4: Right analog left/right movement.  (Z-rotation +/-)
Axis 5: Right analog up/down movement.  (Z-axis +/-)
An almost working controller configuration.
If it weren't for Axis 1, this would work perfectly.
The in-game controller settings only allow the user to assign Axes 1-4 when using a DualShock controller.  Axis 1 doesn't work with the DualShock.  Axis 5 does work, but the user can't assign it.  However, hex editing the file "input.bin" can force the game to use Axis 5.
Changing controller configuration has never been more annoying.
The red number "04" corresponds to "Axis 5".
The game will play perfectly with this setting, but changing gamepad input with the in-game menu causes graphical glitches.
Messed up menus.
It sort of works.
Simply switching 0x2C4 in input.bin back to "00" fixes this and allows the player to change buttons again.

Here are the steps to get a DualShock or similar controller working with Saints Row 2:

  1. Start game with controller off or unplugged (to prevent scrolling problem).
  2. Set Movement X/Y to Axis 3/2 and Camera X/Y to Axis 4/1.
  3. Exit game.
  4. Open input.bin with a hex editor (such as HxD).  File should be located in "D:\Documents and Settings\{username}\Local Settings\Application Data\THQ\Saints Row 2".
  5. Change address 0x2C4 (row 0000002C0, column 04) from "00" to "04".  Make sure it overwrites (replace characters) and doesn't insert (add characters, lengthening the file).
  6. Save and start up Saints Row 2.
  7. If you need to change the controller's other buttons (such as changing fire button to a shoulder trigger), repeat steps 4-6, but change the hex value from "04" to "00".  The in-game menu should work then.  (Then change back to "04" to get the camera working again.)  You can also just keep the hex editor open, but the file might change if you make input changes via the game's interface.  The game needs to be restarted with every change via hex editor as well.

If this doesn't qualify as "forcing", I don't know what does.

Tuesday, April 29, 2014

How to Reset Dandelion's Lute Quest in The Witcher

I've been playing The Witcher recently and ran into a problem with a quest.  Basically, I messed up Dandelion's Lute quest:  I found the lute before even talking to Dandelion thus robbing Geralt of a Romance Card.  I found a somewhat successful way to fix this using The Witcher save game editor.

Here are some things you'll need:
  • The Witcher save game editor.
    • Make sure the run shortcut points to your install and save game files.  Right-click on the shortcut, select Properties, and check the Target text box.
    • For example, my shortcut link is: 
      • %windir%\system32\javaw.exe -DTW.install.path="D:\Program Files\Steam\SteamApps\common\The Witcher Enhanced Edition" -DTW.language=3 -Xmx256m -jar TWEditor.jar 
    • DTW.install.path is the install location of The Witcher.  In this case it is Steam, but your system may be different.
    • DTW.language=3 apparently puts it in English.
    • DTW.data.path (not seen in above example) controls save data path.  The default is "C:\Documents and Settings\{username}\My Documents\The Witcher".
  • Two save files:  One from the beginning of the game (your "source save game") and the one you want to change (your "target save game").
  • A backup of the to-be-changed saved game in case anything goes wrong.
Steps to reset the quest:
  1. File->Open the target save game.
  2. Delete Dandelion's Lute from Inventory.  (Important since it affects dialogue choices.)
  3. File->Save to save these changes.
  4. Click on the "Quests" tab.
    • Click on the name of the quest you want to change, such as Dandelion's Lute, and click the Examine button.
    • Note at the end of the description a file is listed.  This is the file we need to copy from the source save game to the target save game.  In the case of Dandelion's Lute, the file is called "q3031_lute".
  5. Actions->Unpack Save the target save game to a directory such as "target".
  6. File->Close the target save game.
  7. File->Open the earlier save game.
  8. Actions->Unpack Save the earlier source save game to a directory such as "source".
  9. Close the save game.
  10. Copy the quest file (such as "q3031_lute.qst" for Dandelion's Lute) from the "source" directory to the "target" directory, overwriting as necessary.
  11. In the save game editor, select File->Open and open the target save game again.  Select Actions->Repack Save and choose the "target" directory to merge all those files into the target save.
  12. File->Close to close the file.
  13. Play the fixed save.  Talk to Dandelion about the quest.  He should say to go see a woman.
  14. Visit the woman and this time she'll talk about Dandelion more and enable a Romance Card.
  15. Return to Dandelion, save the game, and edit this save file.  Re-add Dandelion's Lute to inventory and save.  Talking to him again will complete the quest.
This successfully reset the quest triggers to the point Geralt could earn a Romance Card.  However, this did not reset every conversation or previous action:  the woman who held the lute already knew Geralt, Geralt had already dealt with her father, and the lute wasn't returned to the trunk.  I also experimented with completing the quest and then resetting the quest file.  The conversation with Dandelion already occurred, so Geralt couldn't activate the lute quest.  In short, this quick and dirty way of resetting quests has very limited use.