Page 1 of 22

Crusader Kings III v1.7.1.0 Achievement Table - Updated 2022-09-15

Posted: Thu Sep 03, 2020 7:00 pm
by CompactDisc
I have taken a break from development for a while.
Find the updated table by Namelessy here:
viewtopic.php?p=182622#p182622


-------------------------------------------------------------------------
Achievement Table Crusader Kings 3 v1.7.1.0
-------------------------------------------------------------------------
==By CompactDisc==

Credits:
  • AOB code for static pointers from Zanzer
  • Version 1.3.* and higher updated by Namelessy
This table allows one to get achievements while running mods and/or using the console.
It also contains a few value pointers for the game, allowing you to alter values manually.
Combine with this table by tfigment for many more options:
viewtopic.php?f=4&t=13576
And/or this one by Recifense:
viewtopic.php?f=4&t=13703

In combination with the 'Rules Mod' (see attachments), you can even get achievements with any game rules enabled.

Instructions
Try to enable the '[X] <== Enable Achievements with Mods/Debug Mode' function before entering the main menu.
In other words: during the loading screen.
If this is not possible (perhaps due to your awesome SSD setup), click 'New Game' -> 'Game Rules' and turn Ironman (off and) on again. The table will initialise and you can load a game if you want to.

Game rules mod
The .zip password is 'Paradox'.
I didn't put this mod up on the workshop due to Paradox rules. You can only download the mod from this post or the discord server.
Extract it to this folder: "%USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\mod".

There should be a mod file and a folder called 'rules' now.
Select the mod in the launcher to activate it.

Discord server:
Please join the Paradox Engine discord to discuss Paradox game tables and table-extensions:
[Link]

Change log:
2020-09-03: Made Table
2020-09-03 (a bit later): Made the table more robust, so it might withstand the next hotfix intact.
2020-09-29: Updated table for CK3 v1.1.1
2020-10-02: Updated table for CK3 v1.1.2
2020-10-19: Updated Rules mod for CK3 v1.1.3
2020-11-30: Updated table for CK3 v1.2.1
2020-12-02: Uploaded a fix for the previous table (some people had issues when using mods)
2020-12-09: Updated table for CK3 v1.2.2

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 7:11 pm
by Rhark
My game version is 1.0.2 and there's no updates available :/

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 7:24 pm
by CompactDisc
Rhark wrote:
Thu Sep 03, 2020 7:11 pm
My game version is 1.0.2 and there's no updates available :/
Very strange, people on the server mostly seem to be on 1.0.3 already.
[Link]

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 7:28 pm
by Rhark
CompactDisc wrote:
Thu Sep 03, 2020 7:24 pm
Rhark wrote:
Thu Sep 03, 2020 7:11 pm
My game version is 1.0.2 and there's no updates available :/
Very strange, people on the server mostly seem to be on 1.0.3 already.
[Link]
Strange, had to boot up the game then close it for the update to appear.

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 8:32 pm
by MFDOOM
Can't seem to get the rules mod to show up in launcher. I extracted the zip file into the mod folder in CK3.

The folder shows the rules.mod and the rules folder, but when i launch the game the mod isn't listed in the launcher.

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 8:57 pm
by Atomic
MFDOOM wrote:
Thu Sep 03, 2020 8:32 pm
Can't seem to get the rules mod to show up in launcher. I extracted the zip file into the mod folder in CK3.

The folder shows the rules.mod and the rules folder, but when i launch the game the mod isn't listed in the launcher.
In the launcher go to mods > manage mods > add more mods and it should have an entry there called "Rules Local mod" add that in

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 10:14 pm
by Testify
thank you

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Thu Sep 03, 2020 11:13 pm
by strayfies
Thanks, this is working great.

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Fri Sep 04, 2020 1:03 am
by trakinas
Thanks for this, but, its works on windows store edition?

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Fri Sep 04, 2020 1:14 am
by Rhark
trakinas wrote:
Fri Sep 04, 2020 1:03 am
Thanks for this, but, its works on windows store edition?
Yes

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Fri Sep 04, 2020 2:16 am
by Ganymedes
does the table already enables the debug mode or i have to enable it in the launch settings? because i did that (enabled in the launch settings) and whenever i clicked on my characters they died by 'debug'

Re: 十字军国王 III V1.0.3 成就表

Posted: Fri Sep 04, 2020 2:54 am
by jigoku_e
It worked fine the first time I used it, but there was no response the second time I used it. I saw an error report. I have verified the integrity of the file on Steam. My native language is not English, so I use Google Translate, sorry.

// Warning!
// This script uses a little assembly hack.
// Saving this script will always give an error on the same line:
// aob_debug+(DWORD)[aob_debug+0B]+10:
// Don't pay it any heed :)

//=========================================
[ENABLE]
//=========================================

{$LUA}
memrec.Color = 0x00008000
{$ASM}

// Checksum1: Affects ck3.exe+29B1BF0 +F8
// ==============================================
AobScanModule(aob_checksum1, $process, 80 B9 F8 00 00 00 00 74 29) // Checksum1 read in menu

// Checksum2: Affects ck3.exe+29B1BF0 +F9
// ==============================================
AobScanModule(aob_checksum2_a, $process, 80 B9 F9 00 00 00 00 74 20) // Checksum2 read in menu
AobScanModule(aob_checksum2_b, $process, 80 B9 F9 00 00 00 00 48 8B) // Checksum2 on save load
AobScanModule(aob_checksum2_c, $process, 80 B8 F9 00 00 00 00 74 04) // Checksum2 - not sure when this triggers
// Included for good measure :P
AobScanModule(aob_checksum2_d, $process, 0F 94 C0 20 83 F9 00 00 00) // Checksum2 read in achievement screen

// Ironman: Affects ck3.exe+29B1BF0 +FA
// ==============================================
AobScanModule(aob_ironman, $process, 80 B9 FA 00 00 00 00 74 3B) // Ironman being read from menu

// Unknown: Affects ck3.exe+29B1BF0 +FB
// ==============================================
AobScanModule(aob_savegame, $process, 80 B9 FB 00 00 00 00 74 32) // Savegame/Steam check (not sure)?

// Trigger: Affects ck3.exe+29B1BF0 +F8,+F9,+FB
// ==============================================
AobScanModule(aob_trigger, $process, 40 88 B8 FA 00 00 00 40 88) // Trigger for Checksum2
// Fires on ironman-button change
// Timer: Reads the debug_mode static pointer
// ==============================================
AobScanModule(aob_debug, $process, 4C 8B AD C8 00 00 00 33 F6) // Timer reading debug_mode


alloc(achievement_script,8192,$process))

label(set_checksum1)
label(return_checksum1)
label(set_checksum2_a)
label(return_checksum2_a)
label(set_checksum2_b)
label(return_checksum2_b)
label(set_checksum2_c)
label(return_checksum2_c)
label(set_checksum2_d)
label(return_checksum2_d)
label(set_ironman)
label(return_ironman)
label(set_savegame)
label(return_savegame)
label(set_trigger)
label(return_trigger)

label(pDebug)
label(base_achievement_pointer)

registersymbol(set_checksum1)
registersymbol(return_checksum1)
registersymbol(set_checksum2_a)
registersymbol(return_checksum2_a)
registersymbol(set_checksum2_b)
registersymbol(return_checksum2_b)
registersymbol(set_checksum2_c)
registersymbol(return_checksum2_c)
registersymbol(set_checksum2_d)
registersymbol(return_checksum2_d)
registersymbol(set_ironman)
registersymbol(return_ironman)
registersymbol(set_savegame)
registersymbol(return_savegame)
registersymbol(set_trigger)
registersymbol(return_trigger)

registersymbol(pDebug)
registersymbol(base_achievement_pointer)

registersymbol(aob_checksum1)
registersymbol(aob_checksum2_a)
registersymbol(aob_checksum2_b)
registersymbol(aob_checksum2_c)
registersymbol(aob_checksum2_d)
registersymbol(aob_ironman)
registersymbol(aob_savegame)
registersymbol(aob_trigger)
registersymbol(aob_debug)

//=========================================
// Actual script
//=========================================
achievement_script:

set_checksum1:
mov [base_achievement_pointer], rcx // Save achievement pointer
mov byte ptr [rcx+F8],01 // Set Checksum1 = 1
cmp byte ptr [rcx+000000F8],00 // Original code
jmp return_checksum1

// Following 2 are the same code, but in different locations.
// I split them up because the code might change in the future.
set_checksum2_a:
mov [base_achievement_pointer], rcx // Save achievement pointer
mov byte ptr [rcx+F9],01 // Set Checksum2 = 1
cmp byte ptr [rcx+000000F9],00 // Original code
jmp return_checksum2_a

set_checksum2_b:
mov [base_achievement_pointer], rcx // Save achievement pointer
mov byte ptr [rcx+F9],01 // Set Checksum2 = 1
cmp byte ptr [rcx+000000F9],00 // Original code
jmp return_checksum2_b

set_checksum2_c:
mov [base_achievement_pointer], rax // Save achievement pointer
mov byte ptr [rax+F9],01 // Set Checksum2 = 1
cmp byte ptr [rax+000000F9],00 // Original code
jmp return_checksum2_c

set_checksum2_d:
mov [base_achievement_pointer], rbx // Save achievement pointer
mov byte ptr [rbx+F9],01 // Set Checksum2 = 1
jmp return_checksum2_d

set_ironman:
mov [base_achievement_pointer], rcx // Save achievement pointer
mov byte ptr [rcx+FA],01 // Set Ironman = 1
cmp byte ptr [rcx+000000FA],00 // Original code
jmp return_ironman

set_savegame:
mov [base_achievement_pointer], rcx // Save achievement pointer
mov byte ptr [rcx+FB],01 // Set ...Something? = 1
cmp byte ptr [rcx+000000FB],00 // Original code
jmp return_savegame

set_trigger:
mov [base_achievement_pointer], rax // Save achievement pointer
mov byte ptr [rax+F8],01 // Set Checksum1 = 1
mov byte ptr [rax+F9],01 // Set Checksum2 = 1
mov byte ptr [rax+FB],01 // Set ...Something? = 1
mov [rax+000000FA],dil // Original code
jmp return_trigger

//=========================================
// Variables
//=========================================

base_achievement_pointer:
dq 0
aob_debug+(DWORD)[aob_debug+0B]+10:
pDebug:

//=========================================
// Hack points
//=========================================

aob_checksum1:
jmp set_checksum1
nop 2
return_checksum1:

aob_checksum2_a:
jmp set_checksum2_a
nop 2
return_checksum2_a:

aob_checksum2_b:
jmp set_checksum2_b
nop 2
return_checksum2_b:

aob_checksum2_c:
jmp set_checksum2_c
nop 2
return_checksum2_c:

aob_checksum2_d:
jmp set_checksum2_d
nop 4
return_checksum2_d:

aob_ironman:
jmp set_ironman
nop 2
return_ironman:

aob_savegame:
jmp set_savegame
nop 2
return_savegame:

aob_trigger:
jmp set_trigger
nop 2
return_trigger:

//=========================================
[DISABLE]
//=========================================

//=========================================
// Put back the original code
//=========================================

aob_checksum1:
// cmp byte ptr [rcx+000000F8],00
db 80 B9 F8 00 00 00 00

aob_checksum2_a:
// cmp byte ptr [rcx+000000F9],00
db 80 B9 F9 00 00 00 00

aob_checksum2_b:
// cmp byte ptr [rcx+000000F9],00
db 80 B9 F9 00 00 00 00

aob_checksum2_c:
// cmp byte ptr [rax+000000F9],00
db 80 B8 F9 00 00 00 00

aob_checksum2_d:
// sete al
// and [rbx+000000F9],al
db 0F 94 C0 20 83 F9 00 00 00

aob_ironman:
// cmp byte ptr [rcx+000000FA],00
db 80 B9 FA 00 00 00 00

aob_savegame:
// cmp byte ptr [rcx+000000FB],00
db 80 B9 FB 00 00 00 00

aob_trigger:
// mov [rax+000000FA],dil
db 40 88 B8 FA 00 00 00

//=========================================
// Clear symbols and memory
//=========================================

unregistersymbol(set_checksum1)
unregistersymbol(return_checksum1)
unregistersymbol(set_checksum2_a)
unregistersymbol(return_checksum2_a)
unregistersymbol(set_checksum2_b)
unregistersymbol(return_checksum2_b)
unregistersymbol(set_checksum2_c)
unregistersymbol(return_checksum2_c)
unregistersymbol(set_checksum2_d)
unregistersymbol(return_checksum2_d)
unregistersymbol(set_ironman)
unregistersymbol(return_ironman)
unregistersymbol(set_savegame)
unregistersymbol(return_savegame)
unregistersymbol(set_trigger)
unregistersymbol(return_trigger)

unregistersymbol(pDebug)
unregistersymbol(base_achievement_pointer)

unregistersymbol(aob_checksum1)
unregistersymbol(aob_checksum2_a)
unregistersymbol(aob_checksum2_b)
unregistersymbol(aob_checksum2_c)
unregistersymbol(aob_checksum2_d)
unregistersymbol(aob_ironman)
unregistersymbol(aob_savegame)
unregistersymbol(aob_trigger)
unregistersymbol(aob_debug)

dealloc(achievement_script)

//=========================================
// Fancy colors!
//=========================================

{$LUA}
memrec.Color = 0x00c08000
{$ASM}

Re: CRUSADER KINGS III V1.0.3 Achievement Table

Posted: Fri Sep 04, 2020 6:47 am
by CompactDisc
Ganymedes wrote:
Fri Sep 04, 2020 2:16 am
does the table already enables the debug mode or i have to enable it in the launch settings? because i did that (enabled in the launch settings) and whenever i clicked on my characters they died by 'debug'
You can do either. When you activate the function in the table, you can 'Enable debug mode' there. OR you can start with debug_mode in the shortcut, both should work.
You can use the table to toggle on or off. Dying by 'debug' is something I never heard before :P Perhaps you committed suicide through console commands? There is a button on the debug menu that kills your current character.

Re: CRUSADER KINGS III V1.0.3 Achievement Table - Updated 2020-09-03

Posted: Fri Sep 04, 2020 7:37 am
by Alaunus
You might want to add all the pointers you found as a manual backup somewhere into that table so a monkey with a wrench can 'fix' it by flipping ironman on and off again to see where the offset moved.

Unless you WANT dozens 'minor hotfix happened plz fix table' posts CD :mrgreen:

Re: CRUSADER KINGS III V1.0.3 Achievement Table - Updated 2020-09-03

Posted: Fri Sep 04, 2020 9:22 am
by CompactDisc
Alaunus wrote:
Fri Sep 04, 2020 7:37 am
You might want to add all the pointers you found as a manual backup somewhere into that table so a monkey with a wrench can 'fix' it by flipping ironman on and off again to see where the offset moved.

Unless you WANT dozens 'minor hotfix happened plz fix table' posts CD :mrgreen:
I removed those pointers, simply because they broke every hotfix. I now made them scannable through AOB.
So even the static pointers should update every hotfix. And with some luck, even bigger patches.
I'll use this method for the similar Stellaris issues as well when the next patch happens.

They are still listed in the script (in the comments), so it's still as simple as switching ironman back on/off. :D