don't click here

Sonic Adventure 2 Hacking

Discussion in 'Engineering & Reverse Engineering' started by Turbohog, Feb 20, 2012.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    All of these fixes can be activated at any time.

    Edit: though it would help if he put the correct byte in the tweaks.lua file, writeBytes(0x720BAE, 0x74) should be writeBytes(0x720BAE, 0xEB).
     
  2. flarn2006

    flarn2006

    Member
    280
    3
    18
    Oops, I'll have to fix that. Thanks for letting me know!
    By the way, what was that fix you mentioned for Tails/Eggman again?
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    You could probably add these to the 1P Alt Char fix.
     
  4. flarn2006

    flarn2006

    Member
    280
    3
    18
    Okay, I will. What exactly do the ones for making Amy/Metal/Tikal/Chaos/(Dark)Chao playable in 1P mode do? Aren't they already? Sure, somersaulting crashes, but you already posted a different fix for that.
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    They make it so the game doesn't check that you're in 2P mode before checking for the alternate character variable being set. Without those, the only way to get them in 1P mode is via the character switch.

    Also you could add these too:
     
  6. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    Is it possible to save a cheat engine table with all the values frozen as they are?

    Like every time I boot the game, I have to implement the 20 corrections MainMemory has posted. Is it possible to save those values with the table so that when I reopen the table and attach the game to cheat engine, the values are already implemented? (Instead of the game default?)
     
  7. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    You could just get the locations of the repective elements in the .exe, and just use a hex editor to modify the EXE you're using directly. Most of the fixes are single bytes being changed.

    If you need the normal values to be there too, just use two different EXE's and skip the launcher.
     
  8. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    I'll definitely mess around with the .exe and hex editor, and if I make anything convenient, I'll post it here.

    Thanks for the suggestion!
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    Unfortunately because of the way the exe is segmented there is no simple calculation to convert any RAM address into an exe address like there is for SADX. To use a term from SADX hacking, every section of the exe appears to have its own "key".
     
  10. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    Then is it possible to write a script in cheat engine such that, when the .CT file is loaded, it will automatically write in the 20+ corrections (somersault, spin dash, flame right, etc corrections along with voice and SFX enabling) to get 2P characters in 1P mode?

    (I'm not asking you to do it - I'm asking if it's possible. I wouldn't mind learning the code, if it isn't too difficult to understand.)
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    If you just want to play as the alternate characters, my alternate characters exe has those fixes, and better fixes for somersault/spindash all applied.

    Otherwise, I know nothing about Lua scripting myself.
     
  12. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    I know of your .exe and already use it. However, your .exe cannot alternate between 1P and 2P characters.

    In cheat engine, after implementing the corrections you gave out, I merely had to change the value of an address from 0 to 1 to switch back between 1P/2P characters. With your .exe, it's frozen to 2P characters, unless there's some way to go back to 1P characters that I missed while reading the thread.

    The way I preserve the 2P character setup is I freeze all the values in cheat engine after changing the bytes so that even if the game is closed, upon reboot, it rewrites the correct bytes again on the addresses. Cheat engine, however, has to stay open.

    For now, this is the best way to preserve those fixes. If you don't close cheat engine AND don't use it for any other game, just freeze those addresses and you're good to go.

    I'll take a look at some lua scripts that members here and on the cheat engine forum have written and see if I can come up with something. I'm not expecting positive results (if any results at all), but the least I could do is try.

    I also don't know what a .CETRAINER file is. Anybody know what that is?

    I'd be willing to make a guide on how to use the cheat engine cheats that everybody has been contributing to, once I manage to understand how all of the quirks in it work.
     
  13. flarn2006

    flarn2006

    Member
    280
    3
    18
    Yes; that's definitely possible. Just go to Table->Show Cheat Table Lua script and type in something like this for each modification:

    Code (Text):
    1. writeBytes(address, byte, byte, byte, ...) -- description of what this does to help you remember (optional)
    Make sure to put 0x before any hexadecimal values.

    Also, my cheat table has a button to conveniently apply many (soon to be all) of the 2P-characters-in-1P tweaks, though it won't do so until you click the button.

    That would be great! Make sure to put it on the wiki, so everyone can improve it!
     
  14. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    So, is what you want basically to set the alternate characters to load under specific instances, like say, load Sonic if you choose Sonic but load Metal Sonic if you choose Shadow? That is something that could be done automatically using LUA scripting, and it doesn't seem like it would be that difficult.

    Not that I'd really know to say, it's just a thought knowing what I know about other scripting languages, I never learned LUA.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    http://www.youtube.com/watch?v=2f5kIAeyqY0
     
  16. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    Yeah, sort of.

    You see, changing the address 174B015 from 0 to 1 enables 2P characters after putting in the other fixes. However, if I want to play as Sonic instead of Amy in one level (or any 1P char. instead of 2P char.), I can manually change that value back to 0 whenever I feel like doing so.

    However, what I want done automatically is having all of 20+ of MainMemory's fixes to be implemented immediately after booting a CT file. It will still load 1P characters even with the script added; I just would need to manually (and simply) change the value of from 0 to 1 to switch from 1P to 2P. In other words, I want to be lazy and not implement MainMemory's fixes every time the game boots, but I can switch from 2P to 1P at my convenience with just changing one number.

    I'll definitely be trying this out, as flarn2006 shed me some light already. Again, not expecting great results, but definitely worth a shot. However, I shall get to work on the guide on the collaborative massive cheat table, because that I can guarantee success, so I'll do that first. Should I put this guide in the same page as where the .CT zip file is, or do it elsewhere?

    As for the video MainMemory found, I'm assuming that there's an address we have to change to make the emerald radar disappear, and it automatically turns on if Knuckles or Rouge are characters. Am I somewhat right or absolutely wrong?
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    I didn't find the video, I made it. And your guess is incorrect.
     
  18. flarn2006

    flarn2006

    Member
    280
    3
    18
    As the cheat table doesn't yet have its own page on the wiki (the closest it has is the RAM editing page for SA2), I would suggest creating a new page for the guide. This could serve as the cheat table's main page.

    Also, new cheat table update.
    This one lets you set the rotation and scale of objects right when you spawn them. It also adds more of the 1P alt char fixes.
    Pro tip: Spawn a movable cylinder, throw it at a wall, check off "Use Player/Sel. Rot.", select a spring, and click Replace Selection.
     
  19. KingLightning

    KingLightning

    Member
    17
    0
    0
    Atlanta, Georgia
    SA2 Cheat Engine Guide
    Flarn, add this to your tweaks.lua file and update the .zip file: (I don't know how to update the zip file.)

    Code (Text):
    1.  
    2.     -- Enable characters in 1P
    3.     writeBytes(0x716E13, 0x90, 0x90) -- Amy
    4.     writeBytes(0x717373, 0x90, 0x90) -- Metal Sonic
    5.     writeBytes(0x728123, 0x90, 0x90) -- Tikal
    6.     writeBytes(0x728473, 0x90, 0x90) -- Chaos 0
    7.     writeBytes(0x740C61, 0x90, 0x90) -- Dark Chao Walker
    8.     writeBytes(0x740EC1, 0x90, 0x90) -- Chao Walker
    9.     -- Amy Spin Dash
    10.     writeBytes(0x723E1F, 0x90, 0x90) -- Amy Spindash
    11.     writeBytes(0x725257, 0xEB) -- Ancient Light Off
    12.     writeBytes(0x725E76, 0xEB) -- Ancient Light Off
    13. end
    14.  
    The first 6 fixes are already there. Below that, add the part that starts with
    Code (Text):
    1. --Amy Spin Dash
    and put it in the .zip file. This allows Amy to spin dash without the game crashing (MainMemory found this, of course, but I found this contribution to be missing in the lua file).

    Since I have zero knowledge in Lua scripting, I'm first beginning my learning by modifying/improving existing scripts before writing mine from scratch.

    Also, since Flarn's script does what I want to do (alternate between 1P & 2P characters), except my idea is too much work, I've decided to put off writing the correction script later.

    Right now I'll start working on that guide to use the .CT file. However, the tweak & object editor are confusing the living crap out of me (I don't know how to use it), so that I'll let the creators of those (flarn/MainMemory) work on that part if I can't manage to figure it out on time.

    EDIT: Selecting Mechless Tails in the built-in menu causes the game to crash. I'll try to find a fix for it in the .lua file (if I can).

    EDIT 2: Trying to find the .lua file that is tied to the character select menu, so that I can find the function/code related to Mechless Tails. In my table, I change the value of 0043CAD6 to 2 and 01934B80 to 2 in order to play as Mechless Tails, and it works fine. Now I'm trying to find the place to put the writeByte function.

    EDIT 3: When I use your character select menu, the SFX is all messed up. Knuckles' SFX is replaced with Sonic's SFX if I go into a Sonic level, for example. I did notice that your script does not change the value of the character address 01934B80. If you freeze the character value there, the character loads up with the correct SFX. Again, still testing your work.

    Also, when the stage is over, is it possible to delete the character select we put in? Like after I finish Metal Harbor with Tails, if I go to Pumpkin Hill, I still come as Tails instead of Knuckles. Is it possible to reset it back to normal so after the "hack", the game will load the normal character in the next level?
     
  20. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Wasn't "Link" from X-CulT an LUA expert? is there anyway to get in contact with him for your guys LUA issues?