Newbie Attempt: Pathfinder Kingmaker Script

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
Doombeard762
What is cheating?
What is cheating?
Posts: 1
Joined: Sat Oct 20, 2018 5:11 am
Reputation: 0

Newbie Attempt: Pathfinder Kingmaker Script

Post by Doombeard762 » Sat Oct 20, 2018 5:23 am

Hi!

I just recently started reading about LUA in an attempt to create my own "Level Up" script for Pathfinder Kingmaker. I'm not yet sure how to correlate the memory address for the current instance to the variable, or if this is even the correct way to go about it. Any tips/pointers is appreciated!

Code: Select all

function xpBtnClk1(sender)
--Get Current XP amount
currentXP = ;

--Get Max XP for This Level
currentLevel = ;

--Level Up - Set Current to Max +1
currentXP = currentLevel +1;

return currentXP;

end

User avatar
TheyCallMeTim13
Administration
Administration
Posts: 1178
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 232
Contact:

Re: Newbie Attempt: Pathfinder Kingmaker Script

Post by TheyCallMeTim13 » Sat Oct 20, 2018 10:14 am

Doombeard762 wrote:
Sat Oct 20, 2018 5:23 am
Hi!

I just recently started reading about LUA in an attempt to create my own "Level Up" script for Pathfinder Kingmaker. I'm not yet sure how to correlate the memory address for the current instance to the variable, or if this is even the correct way to go about it. Any tips/pointers is appreciated!

Code: Select all

function xpBtnClk1(sender)
--Get Current XP amount
currentXP = ;

--Get Max XP for This Level
currentLevel = ;

--Level Up - Set Current to Max +1
currentXP = currentLevel +1;

return currentXP;

end
You'll need to read and write to the memory location (address); so you'll need to know the value type and size, for this you'll just have to see how the game uses the value. And then you need to create a symbol for the address in a separate hook, or find/create a static pointer; to use with the Lua read or write.

But for what you have there; you'll need to find address for experience, and an array to all level experience limits. Just doing a plus experience might be easier.

There is a file in the CE (EXE) folder, "celua.txt" that has the current CE Lua documentation.
Here are some links to the CE Wiki for Lua.
https://wiki.cheatengine.org/index.php?title=Lua
https://wiki.cheatengine.org/index.php?title=Lua#Memory

Here's a "level current weapon" script from my Borderlands 2 table as an example.

Code: Select all

local playerLevel = readInteger('[[[ptrBaseHook]+8]+24]+258')
local weaponAddr = getAddressSafe('[ptrWeaponHook]')
if weaponAddr ~= nil and playerLevel > 0 then
	writeInteger(weaponAddr + 0x1E0, playerLevel)
	writeInteger(weaponAddr + 0x1E4, playerLevel)
	writeInteger(weaponAddr + 0xE3C, playerLevel)
	writeInteger(weaponAddr + 0xE6C, playerLevel)
end

Post Reply

Who is online

Users browsing this forum: No registered users