EvenLess wrote: ↑Thu Sep 14, 2023 12:10 pm
DosDeosos wrote: ↑Thu Sep 14, 2023 11:25 am
EvenLess wrote: ↑Thu Sep 14, 2023 12:07 am
Updated ...
... the new BG3 Commander not seem to work when I use "Add Selected" or even "Remove Selected"? ...
That just goes to show that I need to actually test things in-game before publishing
I was planning to get some playtime in today, so I can test it then. I might have made an error in the code somewhere. I only tested the form functionality.
I think I got it fixed now. Uploaded latest version to
[Link], and attached to this post.
EDIT: Just added a field to enter the amount to spawn. Field is shown if Armors, Objects, or Weapons are selected.
To the people that are downloading everything, because they think everything is needed. Only the
[Link] Cheat Table and the
[Link] Database are needed. The rest is just whatever else I've made, mostly made available to other CT makers
And to all the people having issues with loading/registering commands. I never have any issues when using my table that autoloads/-registers, when I ensure the cheat table is loaded before I start the game. If I load the cheat table AFTER starting the game, then I also experience the issues you're mentioning. I am guessing it's a timing issue, with loading/registering the moment it's possible.
I've added my autoloader to Zanzer's v9 table and attached it to this post. Try and see if that doesn't work. IMPORTANT to have the table loaded, and run the script at load, BEFORE launching the game.
Nothing have been changed in Zanzer's existing code. Just the Lua Script code that have been added.
You can also just add the autoloader code to your existing table, if you have added/modified it. Just add the following to the Cheat Table Lua Script (
Table
>
Show Cheat Table Lua Script
[
Ctrl
+
Alt
+
L
]).
Code: Select all
bg3setting = {}
bg3setting['bg3Executable'] = { 'bg3_dx11.exe', 'bg3.exe' }
bg3setting['LoadCommandsControlID'] = 4928
bg3setting['RegisterCommandsControlID'] = 357
bg3setting['TimerInterval'] = 1000 -- Milliseconds between ticks.
--[[ MainForm.OnProcessOpened
https://github.com/cheat-engine/cheat-engine/blob/65b383535cba0325c25b95310137e13b409e75ae/Cheat%20Engine/bin/celua.txt#L377C14-L377C14
EvenLess
]]
MainForm.OnProcessOpened = function (openedPID, processHandle, caption)
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['RegisterCommandsControlID'])
memoryRecord.disableWithoutExecute()
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['LoadCommandsControlID'])
memoryRecord.disableWithoutExecute()
end
--[[ Timer. Check/execute things ad-hoc.
https://wiki.cheatengine.org/index.php?title=Tutorials:Lua:Setup_Auto_Attach
EvenLess
Continously checks/executes various tasks.
]]
local tickCounter = 0 -- Used to calculate runtime.
local function bg3Timer_callback(timer) -- Tick callback function.
local bg3Executable = bg3setting['bg3Executable']
local runtime = bg3setting['TimerInterval'] * tickCounter
--[[ Find the active game process, if any.
EvenLess
Attempt to find process ID for both bg3 executables (in their specified order).
If Game process is found, store the process ID and update settings with actual
ExecutablePath and ExecutableFile.
]]
local actualPID = nil
for i = 1, #bg3Executable do
-- Loop through the bg3Executables to get its PID, if the game is running.
actualPID = getProcessIDFromProcessName(bg3Executable[i])
if actualPID ~= nil then break end
end
--[[ If if the (actual) game process isn't opened/attached.
EvenLess
]]
local openedPID = getOpenedProcessID()
if actualPID ~= openedPID then
-- Update Register Commands to indicate "Not Ready".
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['RegisterCommandsControlID'])
memoryRecord.disableWithoutExecute()
-- Update Console Commands to indicate "Not Ready".
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['LoadCommandsControlID'])
memoryRecord.disableWithoutExecute()
--[[ If the game process IS running.
EvenLess
]]
if actualPID ~= nil then
openProcess(actualPID)
end
end
-- If "Load Console Commands" is enabled.
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['LoadCommandsControlID'])
if memoryRecord.Active == true then
local numberOfCommands = nil
local commandList = readPointer("cmdList")
if commandList ~= nil and commandList ~= 0 then
numberOfCommands = readInteger(commandList + 0x2C)
if numberOfCommands > 0 then
if numberOfCommands > 3000 then
numberOfCommands = 3000 -- just in case
end
end
commandList = readPointer(commandList + 0x20)
if commandList ~= nil and commandList ~= 0 then
-- If "Register Commands" is NOT enabled.
local memoryRecord = AddressList.getMemoryRecordByID(bg3setting['RegisterCommandsControlID'])
if memoryRecord.Active ~= true then
memoryRecord.Active = true
end
end
end
else
if actualPID == openedPID then
memoryRecord.Active = true
end
end
tickCounter = tickCounter + 1
end
-- Create the timer and attach the callback function.
local bg3Timer = createTimer(getMainForm()) -- Create timer with the main form as its parent.
bg3Timer.Interval = bg3setting['TimerInterval'] -- Set timer interval.
bg3Timer.OnTimer = bg3Timer_callback -- Set timer tick callback function.
If you in some way got the ID's of
Console Commands
and
Register Commands
changed, you need to update the ID's in the code. I usually just open the CT in Notepad++ and search for "Console Commands" and note the ID there.