NaSmieci wrote: ↑Sun Jan 09, 2022 1:18 am
Btw: Changing the raw date of the Birth Day seems to make the newly assigned age stick, whereas changing the Age Value alone does not stick if I reload the save game. That at least is the use I got out of it.
Yep. that is correct age is view only. I think the immortal age though has an impact though if immortal. I personally haven't used it but that is my understanding.
All of this is going from memory as I actually haven't played the game seriously for about a year. Regarding the demense number, the game loads the base number from lua define files when it starts. There is a different number for the level of ruler you are (count, king, emperor) and in this case I think you are overriding the stewardship number. I'm assuming one of the addresses you found was that number stored in global memory after loading the game. I havent explored so not sure. I suspect there is no way to permanently fix the number but presumably we can edit that global value and change it before loading game or something but would have to be done every game I suspect.
I'm sure there are other ways but we need to locate where that is used and calculated and then optionally restrict the calculation for only the player. I think you have intercepted this calculation which is good work.
Those edits sound dangerous (changing RBX+88 to RBX+5) but hard to say. I suspect you would be better off just overriding the return value and then just allow the player to pick what that number is. Also probably only want on the player as its hard to say what changing the value globally would do probably nothing. I may spend a few minutes on this as its an annoying limit in some game types and with the expansion coming probably will want this and you did enough work for me to quickly find it.
Edit:
Here is a version which seems to work. Limited testing was done. Have to advance at least one day to take effect. Requires my table since it is using the pRootCharacter reference to only apply to the player character.
The value I think you were looking at is for the tooltip display and has no impact on actual code. This will just override the value for player and you can set to any value (it defaults to 20 which is arbitrary, maybe I'll rewrite and default it to player actual value in future version). This code was in a separate function that is loaded beneath the code you were looking at and used in the in game calculations.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>26129</ID>
<Description>"Stewardship Demense Limit Override"</Description>
<Options moHideChildren="1"/>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>{ Game : ck3.exe
Version:
Date : 2022-01-09
Author : User
This script does blah blah blah
}
[ENABLE]
aobscanmodule(StewardshipDemenseLimit,ck3.exe,03 C7 4C 8D 5C 24 60 49 8B 5B 20 49 8B 73 28) // should be unique
alloc(newmem,$1000,StewardshipDemenseLimit)
label(code)
label(return)
label(iDemeseLimit)
newmem:
iDemeseLimit:
dq #20
align 8
code:
add eax,edi
// rbx holds player pointer
// rax is return value
push r11
mov r11, [pRootCharacter]
cmp rbx, r11
pop r11
jne @f
mov rax, [iDemeseLimit]
@@:
lea r11,[rsp+60]
jmp return
StewardshipDemenseLimit:
jmp code
nop 2
return:
registersymbol(StewardshipDemenseLimit)
registersymbol(iDemeseLimit)
[DISABLE]
StewardshipDemenseLimit:
db 03 C7 4C 8D 5C 24 60 49 8B 5B 20 49 8B 73 28
unregistersymbol(StewardshipDemenseLimit)
unregistersymbol(iDemeseLimit)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: ck3.exe+DC34F2
ck3.exe+DC34D3: 49 8B E3 - mov rsp,r11
ck3.exe+DC34D6: 5F - pop rdi
ck3.exe+DC34D7: C3 - ret
ck3.exe+DC34D8: 0F BE 83 88 00 00 00 - movsx eax,byte ptr [rbx+00000088]
ck3.exe+DC34DF: 8B 0D 33 1F A8 01 - mov ecx,[ck3.exe+2845418]
ck3.exe+DC34E5: BA 01 00 00 00 - mov edx,00000001
ck3.exe+DC34EA: 3B CA - cmp ecx,edx
ck3.exe+DC34EC: 0F 4C CA - cmovl ecx,edx
ck3.exe+DC34EF: 99 - cdq
ck3.exe+DC34F0: F7 F9 - idiv ecx
// ---------- INJECTING HERE ----------
ck3.exe+DC34F2: 03 C7 - add eax,edi
ck3.exe+DC34F4: 4C 8D 5C 24 60 - lea r11,[rsp+60]
ck3.exe+DC34F9: 49 8B 5B 20 - mov rbx,[r11+20]
ck3.exe+DC34FD: 49 8B 73 28 - mov rsi,[r11+28]
// ---------- DONE INJECTING ----------
ck3.exe+DC3501: 49 8B E3 - mov rsp,r11
ck3.exe+DC3504: 5F - pop rdi
ck3.exe+DC3505: C3 - ret
ck3.exe+DC3506: CC - int 3
ck3.exe+DC3507: CC - int 3
ck3.exe+DC3508: CC - int 3
ck3.exe+DC3509: CC - int 3
}
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>26130</ID>
<Description>"iDemeseLimit"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>8 Bytes</VariableType>
<Address>iDemeseLimit</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatTable>