For the LUA Console Command list I was using the "story_header.div" file that came with the scripts during data extraction. That was a text file listing all the commands with more details for the parameters. For some unknown reason (to me) I cannot find it back when extracting the data file ... I still have a local copy of it but I have found another source for all these functions here:HenryEx wrote: ↑Tue Sep 19, 2023 2:54 pmI slightly modified the Register Commands script to dump all possible console commands to a file (in your table's folder), since i didn't find any comprehensive list of available commands online. And specifically something that included the possible / neccessary parameters and arguments for the game's console commands.
This relies on having the "Console Commands" script active, and like "Register Commands" it only works when you've loaded a save.
Pastebin:
Or copy & paste into CE directly:Will end up as "bg3_commandslist.csv" at your table's location.Code: Select all
<?xml version="1.0" encoding="utf-8"?> <CheatTable> <CheatEntries> <CheatEntry> <ID>9999</ID> <Description>"Dump Commands List"</Description> <LastState/> <VariableType>Auto Assembler Script</VariableType> <AssemblerScript>[ENABLE] {$lua} if syntaxcheck then return end local commands = readPointer("cmdList") if not commands or commands == 0 then print("please load a saved game first") assert(false,"can't activate yet") return end local size = readInteger(commands + 0x2C) if size <= 0 then print("please load a saved game first") assert(false,"can't activate yet") return elseif size > 3000 then size = 3000 -- just in case end commands = readPointer(commands + 0x20) if not commands or commands == 0 then print("please load a saved game first") assert(false,"can't activate yet") return end local paramtypes = { "int", nil, "float", "strVar", "strObj", "strChar", "strItem" } local COMMAND_LIST = "Index;Command Name\n" --local COMMAND_LIST2 = "Index;Table Address;Cmd Address;Name;# of Arguments\n" for i = 1, size do local addr = readPointer(commands) if addr and addr ~= 0 then local name = readPointer(addr + 0x08) if name and name ~= 0 then name = readString(name, 256, false) if type(name) == "string" then local self = readPointer(addr + 0x40) local faddr = readPointer(addr + 0x48) local numParam = readInteger(addr + 0x18) local argtable = readPointer(addr + 0x10) local cmdargs = "" for j = 1, numParam do local argcur = (j - 1) * 0x10 + argtable local argname = readPointer(argcur) local argtype = readInteger(argcur + 0x08) local isResult = readInteger(argcur + 0x0C) argtype = paramtypes[argtype] or "type"..tostring(argtype) if isResult ~= 1 then cmdargs = cmdargs.."-> " end cmdargs = cmdargs..argtype.." "..readString(argname, 256, false) if j ~= numParam then cmdargs = cmdargs..", " end end COMMAND_LIST = COMMAND_LIST..string.format("%d;%s ( %s )\n", i, name, cmdargs) -- COMMAND_LIST2 = COMMAND_LIST2..string.format("%d;%X;%X;%s;%d\n", i, commands, addr, name, numParam) end end end commands = commands + 0x08 end --print(COMMAND_LIST) local file = io.output('bg3_commandslist.csv') io.write(COMMAND_LIST) io.close(file) {$asm} [DISABLE] </AssemblerScript> </CheatEntry> </CheatEntries> </CheatTable>
edit: i noted a few common parameter types, most of them are strings of some kind noted with "str" in the prefix, most of them are denoted by "typeXX" though, check the parameter name to find out what type it is.
Also, result parameters are denoted by a -> arrow. Like this:
IntegerSum ( int A, int B, -> int Sum )
This has 3 arguments, the first and second are what you wanna add up, and the result ends up in argument 3
[Link] ... have a look there!
for example this function that I use in my scripts for cleanly spawning items "nearby":
Code: Select all
---@param sourceX number
---@param sourceY number
---@param sourceZ number
---@param radius number
---@param object GUIDSTRING
---@param avoidDangerousSurfaces integer
---@return number validPositionX
---@return number validPositionY
---@return number validPositionZ
function Osi.FindValidPosition(sourceX, sourceY, sourceZ, radius, object, avoidDangerousSurfaces) end
Code: Select all
function FindValidPosition(X,Y,Z,Radius,Object)
SetArgToFloat(0,X)
SetArgToFloat(1,Z) -- YES coordinates are inverted internally!
SetArgToFloat(2,Y)
SetArgToFloat(3,Radius)
SetArgToString(4,Object)
SetArgToInteger(5, 1) -- AvoidDangerousSurfaces
ClearArg(6)
ClearArg(7)
ClearArg(8)
ExecuteCall("FindValidPosition")
_ValidX = GetArgAsFloat(6)
_ValidZ = GetArgAsFloat(7)
_ValidY = GetArgAsFloat(8)
return _ValidX, _ValidY, _ValidZ
end
How to use this cheat table?
- Install Cheat Engine
- Double-click the .CT file in order to open it.
- Click the PC icon in Cheat Engine in order to select the game process.
- Keep the list.
- Activate the trainer options by checking boxes or setting values from 0 to 1