Re: Editing Vices & Virtues
Ooops, my bad, I forgot one potentially important bit of information: the file I'm editing. It's maybe obvious, but the file to edit is your campaign savefile.
Oh well, at least I get to say sorry like a proper noob. Should I LOL now????/
Re: Editing Vices & Virtues
*reading thread*
~:confused: ~:confused: ~:confused: ~:confused: ~:confused:
moderators, can't you promote this guy so he can post in the dungeon??? I think he deserves it.
edit: oh, and welcome to the org.
Re: Editing Vices & Virtues
Thanks for the welcome cutepuppy ~:)
OK, just worked out how to edit Loyalty/Influence, Piety, Dread, Command & Accumen, although again it's a real pain to describe, but I'll try my best...
It might be easier if I use a simple example, so here I have a Joms Viking unit with 2 men (created like this as a starting unit in my test campaign's startpos file) at Valour 9 (including Command effects), with the leader having a Loyalty of 3, Piety of 8, Dread of 4, Command of 7 and Acumen of 5 plus the V & Vs of Skilled Risky Attacker (4600h).
Opening up my campaign savefile & searching for the hex value of 4600 - it tends to be easier the more V & Vs you search for or if looking for odd ones like Secret Incest - I find my general & his single subordinate, highlighting the virtue here in bold...
(Address in hex: Data in hex)
C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0000
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 8000
C50: 0603 0300 5408 0000 E700 0140 002A FFFF
C60: FFFF 4600 0004 0000 0000 0000 0000 0000
OK, here we go... ~:)
I want my general to be more loyal, so I want to up his Loyalty from 3 to 6. The loyalty is held at the address 10h less than the start of the general's V & Vs, in this case here...
C50: 0603 0300 5408 0000 E700 0140 002A FFFF
To give him the required loyalty I change the 3 to a 6...
C50: 0603 0600 5408 0000 E700 0140 002A FFFF
I also want my general to be a more imposing, less pious thug, although I'm happy with his smarts. Acumen, Dread & Piety are held as a composite value with the format of AD0Ph where A, D & P are the appropriate traits, so for my general with Piety of 8, Dread of 4 and Acumen of 5 the value is 5408h...
C50: 0603 0600 5408 0000 E700 0140 002A FFFF
I think I prefer a Piety of 3 & a Dread of 7, so my edited file now reads...
C50: 0603 0600 5703 0000 E700 0140 002A FFFF
Next, I want to give him Command 8, so that I have the maximum bonus but still have something to aim for during play. Command is held as the number of victorious battles, with 32 wins (hex 20h) for Command 6, 64 wins (hex 40h) for Command 7, etc. My general has won 64 battles so far & I need to change that to 128 (hex 80h).
C50: 0603 0600 5703 0000 E700 0140 002A FFFF becomes...
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
OK, now on to Valour, which is similar to Command, but tracks kills instead of victories - so Valour 4 requires 8 kills (hex 8h). Valour is normally a real pain since every warrior has it tracked seperately, but since I only have a 2-man unit in my example it's not difficult to demonstrate...
C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0000
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 8000
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
C60: FFFF 4600 0004 0000 0000 0000 0000 0000
In this case the subordinate has 0 kills & the general has 128 kills, giving an average of 64 kills or Valour 7. Adding in the Command bonus Valour this gives the unit a Valour of 10, although it only displays as 9 on the campaign map. Feeling moderately evil, I decide that I want both a Jedi general and his Padawan, so I'll edit them to Valour 16 & 10 respectively (32768 & 512 kills), giving an average unit Valour of 15 before Command effects.
C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 0080
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
C60: FFFF 4600 0004 0000 0000 0000 0000 0000
Next on to V & Vs, where this all started...
I don't want the Skilled Risky Attacker so that can go, being replaced with Legendary Leader (which will raise his loyalty from 6 to 9), Expert Sieger, Unbribable & Charismatic Leader, or 0700h, 3C00h, 8400h & 2101h respectively (Note: In my first post I said the value for Brave Beyond Belief was 2101h, but I'd mis-remembered, it's actually 2A01h)
I need to edit this...
C60: FFFF 4600 0004 0000 0000 0000 0000 0000
to this...
C60: FFFF 0700 3C00 8400 2101 0000 0000 0000
Note that I overwrote both the Skilled Risky Attacker and that odd value of 0004h that I mentioned in my first post. There doesn't seem to be any effect in doing this & since I'm paranoid I want it gone.
Finally ("At last!" you gasp) I'm going to change the unit from Joms Vikings to Viking Huscarles. The value can easily be found from the unit production file for the campaign, being the row number: Joms Vikings are on the 182nd row (hex B6h) & Viking Huscarles are the 177th row (hex B1h).
Before change...
C00: FFFF 0700 FE60 0000 00B6 0258 31D3 01B8
After change...
C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8
So my final data looks like this, with all changes highlighted...
C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 0080
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
C60: FFFF 0700 3C00 8400 2101 0000 0000 0000
The end result giving me a unit of 2 Viking Huscarles with a battlefield Valour of 19 (displays 9 on the campaign map), led by a general with Loyalty 9, Piety 3, Dread 7, Command 8 & Acumen 5 including all V & V effects, with the virtues of Legendary Leader, Expert Sieger, Unbribable & Charismatic Leader - he also knits socks in his spare time. ~:)
A King's stats work in a slightly similar way, but their details aren't held with bodyguard unit, just to make life more exciting. The lines of data with the king's Influence, Piety, Valour, etc are also seperate from his V & Vs. For example the Viking king's stats are held as follows in my test campaign:
120h: 0000 2100 0000 0000 0000 2000 0000 0400 (Valour 3)
130h: F702 0400 3102 0000 E700 0301 002A FFFF (
Influence 4, Acumen 3, Dread 1, Piety 2, Command 1)
440h: FFFF 9900 0000 0000 0000 0000 0000 0000 (Magnificent Steward)
You can come out from behind the couch now, I've finished. ~:p
Re: Editing Vices & Virtues
A last addition for the day: Attack, Armour & Morale bonuses from buildings...
Using my previous example again, I've highlighted the appropriate field:
C00: FFFF 0700 FE60 0000 00B1 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 0080
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
C60: FFFF 0700 3C00 8400 2101 0000 0000 0000
The Armour values run from 01h to 04h for a +1 to +4 bonus.
The Attack values are 08h, 10h, 18h & 24h for a +1 to +4 bonus.
The Morale values are 40h, 80h & C0h for a +1 to +3 bonus.
To work out the value for a particular combination of bonuses, simply add them together, so +3 Armour, +1 Attack & +2 Morale would be 03h + 08h + 80h giving 8Bh...
C00: FFFF 078B FE60 0000 00B1 0258 31D3 01B8
C10: B36E 0300 0000 0001 0000 0000 0000 FFFF
C20: FFFF 5E00 0000 0000 0000 FFFF FFFF 0002
C30: 0903 0100 1101 0000 E700 0000 002A 5F00
C40: 0000 5E00 0000 0000 0000 6100 0000 0080
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
C60: FFFF 0700 3C00 8400 2101 0000 0000 0000
Re: Editing Vices & Virtues
That really is rather impressive. Great job, it must have taken an age of trial and error to work out which values where what! (Unless there's a more cunning tactic?)
Very nice work. Now anyone wishing to create the ultimate unit in SP can frolic in hex to their heart's content. ~D
Perhaps we can put this somewhere as a guide/sticky, dear moderators?
Re: Editing Vices & Virtues
No cunning trick I'm afraid, just a systematic & tedious process of making single changes & observing the effects on a modified Viking campaign with no starting buildings, agents or heirs, placing only the Viking king and my experimental unit, leaving the savefile as clutterfree as possible. The heroes file was the key to cracking the problem, making it easy to make traceable changes.
Re: Editing Vices & Virtues
Quote:
Originally Posted by Sinner
The Attack values are 08h, 10h, 18h & 24h for a +1 to +4 bonus.
Oops, my bad, spotted a mistake... that should be 08h, 10h, 18h & 20h for +1 to +4 attack respectively. ~:0
Re: Editing Vices & Virtues
You can't see it from where you are but i'm actually saluting you.Excellent work.I tried the hex edit thing at one stage(with no success) but i never thought of modifying the game to be clutter free.All the great ideas...............
Re: Editing Vices & Virtues
wow, definetly tedious stuff, 'brain cracks open...spilling the cereal'
great stuff
congrats
~:cheers:
Re: Editing Vices & Virtues
Glad you're enjoying it. ~:)
As a further addition, it does get more (!!!!) complex as a campaign progresses or when using units larger than just 2 men. I've come across one false assumption I initially had: a general's Loyalty, Acumen, Dread, etc doesn't always appear the line before his Vices & Virtues, so it can make it more difficult to edit a particular unit.
You can search seperately for a general's V & Vs and the composite Acumen, Dread & Piety value, although this can also be a problem: you must take into account the effects of any V & Vs on those stats plus even though it may appear the general has a value of 9 in any particular trait, he may actually have a value of 10 (or hex A), so you sometimes have to search for a few different values. With no V & Vs to worry about, for a general that apparently has 9 in all 3 traits, you'd have to look for 9909h, 990Ah, 9A09h, 9A0Ah, A909h, A90Ah, AA09h & AA0Ah to be certain of finding his stats. Add in V & Vs and it only gets worse. I haven't come across a value of 11 yet (hex B), but it might occur.
I also found the value that holds the general's/royal's age:
C50: 0603 0600 5703 0000 E700 0180 002A FFFF
306h is 774, the year my test hero general was born.
130: F702 0400 3102 0000 E700 0301 002A FFFF
My example king was born in 759 (hex 2F7h).
Surprisingly enough, age is then calculated from there! ~:)
I vaguely recall from similar hex editing on STW how a unit is linked together, since it's possible that they might all be scattered individually through the 'misc chunk' section of the savefile. As I recall each soldier had an address that pointed either at the next one in the unit, or a unit header or the leader... one of those three, but it's been too long to be certain now. I'll do some tinkering this week & see what I find.
I found the field that holds the general's name but I haven't determined quite how that works yet and I'm similarly stuck on ships' captains - I can edit a ship type, even giving them stats beyond what they should have, but I can't yet edit the Command rating.
Hopefully I'll soon have enough worked out to be able to develop an editor & remove the grunt work, but once RTW comes out then MTW will be quickly forgotten I'm afraid.