Author Topic: Talents & Savegame Hacking  (Read 8267 times)

Offline xpace

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • http://xpace.awardspace.com/
Talents & Savegame Hacking
« on: August 12, 2008, 12:03:10 PM »
I read the "Savegame Hacking" Guide on the GearHead wiki, but it seemed a bit lacking in certain areas. Specifically, I wanted to learn how to hack the Talents in the savegame. But, I couldn't find anything about that.

So, I tried some experimentation with a new, junk character. I saved before and then after buying a talent. Then I used a hex editor to compare the two files. It was more complex that I had imagined and part of the problem lies in how GearHead often rearranges the codes between the character's Stats and
"-1..SDL_COLORS" after saving.

Anyway, here's what I've learned so far:

After buying a talent, I noticed that the following ASCII lines were added immediately after the space (30h) after the last (Ch) Stat:

..0 4 1 1000..0 16 11 1

The first part (..0 4 1 1000) tells GearHead to reserve 1000 experience points from now on. So, for example, if you had 5655 Free Exp. before, now you have only 4655 Free Exp.

The second part (0 16 11 1) is the code to add the Talent - which, in this case, adds Bishonen.

Experimenting some more, I noticed a few other things. From my experience, I would hazard to guess that all Talent codes begin with "..0 16 ", followed by a unique number, and then a " 1". I'm basing this on the two codes I've found so far:

Code for adding Talent: Bishonen:
   ..0 16 11 1 --or-- 0D0A302031362031312031
Code for adding Talent: Stunt Driving:
   ..0 16 9 1 --or-- 0D0A3020313620392031

Also, since GearHead rearranges the codes between the Stats and SDL_COLORS when it saves, I would guess that it doesn't matter where the code goes as long as it is between these areas and as long as it doesn't split up an existing code. (But I like to add the code right after the Stats.)

Through experimentation, I learned that you don't have to add the "..0 4 1 1000" code to tell GearHead to reserve 1000 XP. It's cheating, but you could leave that out. I also learned that if you add a new Talent, GearHead will assume you bought it and thus the 5 Talent limit is still in effect. Further, you won't be able to buy a new Talent until your XP is high enough as per the usual.

BTW: I recommend using the hex code instead of the ASCII code. So, instead of inserting "..0 16 11 1" in the ASCII field, you would insert "0D0A302031362031312031" in the hex field. And instead of "..0 4 1 1000" you would insert "0D0A30203420312031303030".

The reason I was interested in hacking the savefile to add a Talent was because I wanted my character to have the Bishonen Talent without having to buy it. And the reason for this is because I wanted to try a female character without the added conversation difficulty with major NPCs. (Everyone knows that flirting and conversation in GH1 is heavily bent towards favoring male characters.) I thought the situation was unfair and so I searched for a way around the 5 Talent limit to get Bishonen for free.

This technique almost works, but it still imposes the 5 Talent limit. However, I was thinking of doing the following:

1) Buy or hack the Bishonen Talent.
2) When the PC would have enough XP to buy a new Talent (as if it had Bishonen for free), hack the save to remove Bishonen, then buy a new talent, and finally hack the save again to add Bishonen back.
3) Repeat this until the PC has 5 Talents, plus the hacked Bishonen.

I think doing it this way would allow for more than 5 Talents. But I won't know for sure until I try it. However, it sure would be nice if there was an easier way.

Offline xpace

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • http://xpace.awardspace.com/
Talents & Savegame Hacking
« Reply #1 on: August 13, 2008, 06:46:54 AM »
It took me a while to figure this out. But through experimentation, I've learned something else. GearHead uses the following code to determine gender:

"..0 3 0 1" in ASCII or "0D0A30203320302031" Hex code

If that code is found somewhere after the Stats, then the character is considered female. Otherwise, it is assumed to be male. This works for both the PC as well as NPCs.

BTW: I noticed the reason a simple cut and paste of the ASCII code does not work is because the ".." preceeding the code are not periods. It's actually two different bytes of hexadecimal 0D and OA. You could cut and past the rest of the code, however. (Such as "0 3 0 1", for example.)

Offline xpace

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • http://xpace.awardspace.com/
Talents & Savegame Hacking
« Reply #2 on: August 13, 2008, 07:31:42 AM »
I just learned about how age is determined. For example, the following is the code for age 16:

"..0 3 1 -4" ASCII or "0D0A3020332031202D34" Hex code

The key here is the last digit. In order to increase the age from there, simply add. So, for example, if you want to change the age to 21, you would add 5 (21 - 16) to "-4", which would be "1" or code "..0 3 1 1". If you want age 30, you would add 14 to make "10" or code "..0 3 1 10".

Offline Francisco Munoz

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
    • http://www.wesnoth.org
Talents & Savegame Hacking
« Reply #3 on: August 13, 2008, 07:45:03 AM »
Mmmm you just could check the macros at gamedata/ghpmacro.txt  to check this.
As you said the Age is the numerical attribute (Natt or 0) 3.

Offline xpace

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • http://xpace.awardspace.com/
Talents & Savegame Hacking
« Reply #4 on: August 17, 2008, 05:07:14 PM »
HACKING ITEMS:

I messed up one of my games where I lost the opportunity to recruit some Lancemates. Distraught over the amount of skills, money, items and experience I would loose by loading a (much) earlier save, I decided to hack the savefile to recover some of these things. Of course, copying over the amount of money and experience is easy because you just have to do an ASCII search for the amounts. But copying over items and equipment is a bit tricky. Here's a couple examples of an item:

..Z..0 4 0 22 0..Stats ..0 12 0 34..0 -3 1 355912..0 2 1 -15..-1..name <Night Scythe>..type <Extend ArmorPiercing POISON>

..Z..-1..-1..0 4 0 22 0..Stats ..0 2 1 -15..0 -3 1 355912..0 12 0 34..-1..name <Night Scythe>..type <Extend ArmorPiercing POISON>

Obviously, both of these items are the same. But the first example is an item that is already equipped. The second is the same item in general inventory. The "..-1..-1" after the "..Z" indicates that it's in the inventory and not equipped.

The first code example I found listed immediately after the <Right Hand> item. (Yes, GearHead treats limbs as equipped items, so that limbs can be damaged seperately and even destroyed due to grevious injury!) And in my case all equipped items, including <Right Hand> are listed after my <Ceram Helmet>. (Perhaps the code for a character's helmet, if one is equipped, is always listed above all other equipped items?) I assume that GearHead listed the Night Scythe item after the <Right Hand> to indicate that it was equipped in the right hand (which it was). The second example I found listed before my <Ceram Helmet>, along with all the other unequipped items. In my experience, all unequipped items could be found before the equipped items.

I don't know why, but in my experience cutting and pasting the code for an equipped item seems to cause the game to crash every time (even though I believe I pasted it in the right location). Instead, I would recommend adding "..-1..-1" or "0D0A2D310D0A2D31" hex code immedately after the "..Z" to turn it into an unequipped item and pasting the resulting item code somewhere in the general inventory.

Here's another example of an item:

..Z..-1..-1..0 12 2 500 0..Stats ..0 7 0 101..-1..name <Data Cartridge>..place <5>..Clue37 <Print 1>..Msg1 <This data cartridge holds a map which appears to lead somewhere outside of Snake Lake.>..ELEMENT <I Prefab>..SDL_SPRITE <default_items.png>

This is the code for the key item in the Snake Lake Smuggling Ring plot. Notice that it has code for an item sprite at the end? Just remember that all item codes begin with "..Z" and continue to the next instance of "..Z", which indicates the start of the next item.

BTW: I did an experiment where I substituted the following code with existing code for a Boxed Lunch:

..Stats ..0 12 0 34..0 -3 1 355912..0 2 1 -15..-1..name <Night Scythe>..type <Extend ArmorPiercing POISON>

I was trying to change my Boxed Lunch into a Night Scythe, as I was still figuring out how to add items. But while the game did not crash, the result was not what I expected. The Boxed Lunch was indeed renamed "Night Scythe", but it could not be equipped and it was still an edible item! Apparently, the "..0 4 0 22 0" code before "..Stats" denotes important item characteristics and not location info as I had suspected.

Offline Daemonward

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Talents & Savegame Hacking
« Reply #5 on: August 17, 2008, 06:27:33 PM »
It's much easier to edit the CHAName.txt files (made by the "Create Character" option) than it is to edit the RPGName.txt files. Everything is much more neat and organized.

Then again, I am using a text editor, not a hex editor on my save files. I am also running GearHead on Ubuntu GNU/Linux rather than Windows so I can't be certain how much our savefile editing experiences may vary.

Offline Onisuzume

  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Talents & Savegame Hacking
« Reply #6 on: August 18, 2008, 01:15:31 AM »
Well, if you're using a hex editor then it should be about the same afaik.

Offline Onisuzume

  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Talents & Savegame Hacking
« Reply #7 on: September 22, 2008, 11:34:53 AM »
Ok, here's the list of Talents:

0 16 1 1 - Strength of Faith (+2 ego, doesn't work if added this way)
0 16 2 1 - Body Builder (+2 body, doesn't work if added this way)
0 16 3 1 - Scientific Method (+2 knowledge, doesn't work if added this way)
0 16 4 1 - Presence (+2 charm, doesn't work if added this way)
0 16 5 1 - Kung Fu (+3 penetration using martial arts)
0 16 6 1 - Hap Ki Do (may block using martial arts)
0 16 7 1 - Anatomist (+1 penetration vs. living targets)
0 16 8 1 - Hard As Nails (attacks vs. PC are at -2 penetration)
0 16 9 1 - Stunt Driving (may reroll dodge when at full speed)
0 16 10 1 - Savant (learn 5 more skills)
0 16 11 1 - Bishounen/Bishoujo (may flirt with same gender)
0 16 12 1 - Diplomatic (may avoid reputation loss in a bad convo)
0 16 13 1 - Born to Fly (+3 mecha piloting when flying/jumping)
0 16 14 1 - Sure Footed (+2 mecha piloting when walking)
0 16 15 1 - Road Hog (+2 mecha piloting when rolling)
0 16 16 1 - Tech Vulture (salvage individual modules)
0 16 17 1 - Idealist Blood (+1 to 3 random stats, doesn't work if added this way)
0 16 18 1 - Business Sense (+25% mission cash rewards)
0 16 19 1 - Animal Trainer (new pets gain exp bonus)
0 16 20 1 - Jack of all Trades (no penalty for using unknown skills)
0 16 21 1 - Combat Medic (first aid and medicine take only 1/3rd normal time)
0 16 22 1 - Badass (bonus to combat when under bad morale)
0 16 23 1 - Ninjitsu (damage bonus when unseen)
0 16 24 1 - Hull Down (attacks at -3 penetration when rolling/walking)
0 16 25 1 - Gate Crasher (+2 penetration vs. inanimate objects)
0 16 26 1 - Extropian (1 implant per 3 points of cyberware don't disfunction)
0 16 27 1 - Cyber-Psycho (avoid traume by spending MP)
0 16 28 1 - Sniper (bonus to single-fire damage rolls)
0 16 29 1 - Innovation (install more junk onto your mecha)
0 16 30 1 - Camaraderie (Friends can join as lancemates)
0 16 31 1 - No actual talents above this number...

Offline Cornuthaum

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Talents & Savegame Hacking
« Reply #8 on: May 04, 2010, 12:27:13 PM »
Necroing this thread with relevant information:

All skill numbers for GearHead 2, since I was massively unsatisfied with some of my skills and didn't want to start over halfway through the story.

0 1 1 = Mecha Gunnery
0 1 2 = Mecha Fighting
0 1 3 = Mecha Piloting
0 1 4 = Ranged Combat
0 1 5 = Close Combat
0 1 6 = Dodge
0 1 7 = Vitality
0 1 8 = Athletics
0 1 9 = Concentration
0 1 10 = Awareness
0 1 11 = Initiative
0 1 12 = Survival
0 1 13 = Repair
0 1 14 = Medicine
0 1 15 = Electronics Warfare
0 1 16 = Spot Weakness
0 1 17 = Conversation
0 1 18 = Shopping
0 1 19 = Stealth
0 1 20 = Intimidation
0 1 21 = Science
0 1 22 = Mech Engineering
0 1 23 = Code Breaking
0 1 24 = Mysticism
0 1 25 = Performance
0 1 26 = Toughness
0 1 27 = Insight
0 1 28 = Taunt

List fix'd, thanks Francisco Munoz.
« Last Edit: May 04, 2010, 03:04:46 PM by Cornuthaum »

Offline Francisco Munoz

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
    • http://www.wesnoth.org
Re: Talents & Savegame Hacking
« Reply #9 on: May 04, 2010, 12:32:47 PM »
From gamedata/mesages.txt

SKILLNAME_7 <Vitality>
SKILLNAME_8 <Athletics>
SKILLNAME_9 <Concentration>

SKILLNAME_15 <Electronic Warfare>

Offline Cornuthaum

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Talents & Savegame Hacking
« Reply #10 on: May 04, 2010, 07:44:56 PM »
Since I am possessed of an inquisitive mind and the random urge to totally revamp my character in midgame, my notes on Talents for GH2.

0 16 27 1 - Extropian
0 16 26 1 - Pick Pockets
0 16 25 1 - Dominate Animal
0 16 24 1 - Acrobatics
0 16 23 1 - Robotics
0 16 22 1 - Entourage
0 16 21 1 - Cameraderie
0 16 20 1 - Innovation
0 16 19 1 - Sniper
0 16 18 1 - Gate Crasher
0 16 17 1 - Hull Down
0 16 16 1 - Ninjutsu
0 16 15 1 - Badass
0 16 14 1 - Jack of All Trades
0 16 13 1 - Business Sense
0 16 12 1 - Idealist Blood
0 16 11 1 - Tech Vulture
0 16 10 1 - Road Hog
0 16 9 1 - Sure Footed
0 16 8 1 - Born to Fly
0 16 7 1 - Bishounen
0 16 6 1 - Polymath
0 16 5 1 - Stunt Driving
0 16 4 1 - Hard as Nails
0 16 3 1 - Anatomist
0 16 2 1 - Hap Ki Do
0 16 1 1 - Kung Fu

Offline CCC

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: Talents & Savegame Hacking
« Reply #11 on: May 06, 2010, 01:40:02 AM »
BTW: I noticed the reason a simple cut and paste of the ASCII code does not work is because the ".." preceeding the code are <strong>not</strong> periods. It's actually two different bytes of hexadecimal 0D and OA. You could cut and past the rest of the code, however. (Such as "0 3 0 1", for example.)


Just as a quick note; the easiest way to get characters 0D and 0A in a text file under Windows is to hit the "enter" key in a text editor (e.g. Notepad).

Exactly why your hex editor is displaying them as periods I cannot say. Probably doesn't want to get the output formatting messed up with unexpected line endings.

Offline Trucidation

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Talents & Savegame Hacking
« Reply #12 on: July 26, 2010, 09:19:03 PM »
I was missing the Laser Drill in my latest run of GH1 so I thought I'd just edit it in.

I wish.

BTW: I did an experiment where I substituted the following code with existing code for a Boxed Lunch:

..Stats ..0 12 0 34..0 -3 1 355912..0 2 1 -15..-1..name <Night Scythe>..type <Extend ArmorPiercing POISON>

I was trying to change my Boxed Lunch into a Night Scythe, as I was still figuring out how to add items. But while the game did not crash, the result was not what I expected. The Boxed Lunch was indeed renamed "Night Scythe", but it could not be equipped and it was still an edible item! Apparently, the "..0 4 0 22 0" code before "..Stats" denotes important item characteristics and not location info as I had suspected.

It's not that simple. Sure, you get the description, but the item is completely different. Copying over the Laser Drill from char A to char B resulted in B obtaining a rifle addon (which was named "Laser Drill"...). By the way I copied entries starting from "Name" to the "-1" before the next item's occurance of "Name" so I'm pretty sure I got the entire item code. Those numbers aren't item characteristics, but more likely a reference -- which is why copying another character's code doesn't work because the references are different from save to save.

Anyway... grovelling through my save file showed me that the Laser Drill does exist (phew), it appears to be under the code for L4 of the Hogye Mines, but I'm pretty sure I scoured the place. Perhaps it spawned behind a wall? Ugh. I'll go check it out - if I still can't find it I'll try playing with the numbers hoping that I'll find the location and move it somewhere I can get it.

Edit:
Couldn't find it, gave up. Actually I figured out how to add status effects to weapons so I guess I don't feel so bad about not having that unique drill anymore. Not when my laser rifle burns and pierces armor :P  Apparently all you need to do is add the "Type <>" tag after the item name and the game takes care of the rest.

Note to self, giving melee weapons a blast effect is not a good idea.

Edit 2:
Doing this to mecha weapons causes your PV to skyrocket. Your mecha's PV is used to determine the size of the opposition, right? So this is a Bad Thing, unless there's a hard upper limit to the quality of enemies and you're already killing them with ease.
« Last Edit: July 27, 2010, 01:37:01 AM by Trucidation »

Offline Frumple

  • Sr. Member
  • ****
  • Posts: 347
    • View Profile
Re: Talents & Savegame Hacking
« Reply #13 on: July 27, 2010, 07:56:12 AM »
For items, especially non-plot related ones like the laser drill, it's a lot easier to just add it into the design files instead of messing around with the save file. You've got to buy it from some shop or another afterwards, but it's a considerably simpler process. Design file editing's pretty straightforward, even moreso in GH1.

Sidepoints: SMOKE BLAST melee weapons are alright; pretty useful, actually. I like to make a blast 1 or 2 energy weapon for some stealth-themed mecha.

Also, yeah, adding types increases weapon cost and PV, usually by a certain amount, though I forget if it's percentage, multiple, or straight addition. Certain tags increases cost by more -- a HYPER weapon is going to cost more than a BRUTAL one, ferex. There's a number of guides, iirc, on how item design works, but it's pretty self-evident how most things work in GH1 if you don't want to bother hunting them down. GH2's a little more complicated, but not terribly so.

There's a 'soft' limit to how difficult the machines you encounter is, by th'by, depending on how high the machines in your design folder goes. Iirc, stuff like the Monstrous is about the highest PV thing you'll encounter in GH1 barring unique stuff. However, from what I vaguely (mis)remember, enemy pilots can keep scaling even if the machines stop, so you'll keep running into harder fights regardless, though I've no idea if the rewards from fighting such missions allow you to outpace their growth; I've never tried to do something like that. Still end-game fights can see you taking out dozens of high-end machines, so you'll probably be fine if your pilot has the stats to back up the machine's PV.
« Last Edit: July 27, 2010, 08:01:04 AM by Frumple »
Ask not!
What your country can hump for you.
Ask!
What you can hump for your country.

Offline Trucidation

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Talents & Savegame Hacking
« Reply #14 on: July 27, 2010, 08:26:08 PM »
Hmm, adding it to a shop and then buying it - should've thought of that  ;D  So I can just waltz into the Design folder and take PC_equipment.txt apart, without needing to recompile the game or something? Awesome.

...but i'd better leave further testing to after I actually finish the game, or I'll ruin the fun of exploring things for the first time.

You're right, my early-game pilot had no skills to back up the high end parts stripped from mecha I bought from stores - at the time didn't really think about PV. I tacked on some class 10 arc thrusters, class 10 sensors, phase cannons (read about these in a guide somewhere on the wiki), class 7 ECM suite, etc... all this stuff on mecha you can buy from the shady mecha dealer guy in Snake Lake waterfront. I stuck them on my starter mecha, a Corsair, thinking "it's still a starter mecha, even if the difficulty scales I should be okay." I guess the 13mil+ PV escaped my attention for a while.

The next few random missions got ugly real fast. Heh.