z Baldur's Gate 3

Upload your cheat tables here (No requests)
bloodaxis
Expert Cheater
Expert Cheater
Posts: 460
Joined: Thu Apr 13, 2017 5:09 am
Reputation: 59

Re: z Baldur's Gate 3

Post by bloodaxis »

Zanzer wrote:
Sat Aug 26, 2023 2:48 pm
Sounds like the people having problems are either due to the mods they have installed or maybe the game behaves differently when you're in act 3. Not a clue. So the only thing I can possibly do to help you all is provide a pointer to the command count.

Now you can see when the game has loaded all of the commands in memory and when you should click the Register Commands button.

At this time, it shows that there are 1263 commands. So when that value populates, register the commands!

Best of luck to you all.
I am both in act 3 and playing with ~20 or so mods, so it'll most probably be one of those reasons.

How to use this cheat table?
  1. Install Cheat Engine
  2. Double-click the .CT file in order to open it.
  3. Click the PC icon in Cheat Engine in order to select the game process.
  4. Keep the list.
  5. Activate the trainer options by checking boxes or setting values from 0 to 1

unREAL
Expert Cheater
Expert Cheater
Posts: 159
Joined: Sat May 07, 2022 4:46 pm
Reputation: 67

Re: z Baldur's Gate 3

Post by unREAL »

Nick8472 wrote:
Sat Aug 26, 2023 4:06 pm
Zanzer wrote:
Sat Aug 26, 2023 2:48 pm
Sounds like the people having problems are either due to the mods they have installed or maybe the game behaves differently when you're in act 3. Not a clue. So the only thing I can possibly do to help you all is provide a pointer to the command count.

Now you can see when the game has loaded all of the commands in memory and when you should click the Register Commands button.

At this time, it shows that there are 1263 commands. So when that value populates, register the commands!

Best of luck to you all.
I cannot even click the "Console Commands" button, even after saving and reloading.
Game Version: V4.1.1.3669438
CE Table v8
how about reading if its already solved? solutions how to fix is already posted from me ...

Nick8472
What is cheating?
What is cheating?
Posts: 4
Joined: Sat Aug 26, 2023 4:03 pm
Reputation: 0

Re: z Baldur's Gate 3

Post by Nick8472 »

ayurai wrote:
Sat Aug 26, 2023 4:07 pm
Console Commands only work on Vulkan for me (not DX11).
This works for me too!

Nick8472
What is cheating?
What is cheating?
Posts: 4
Joined: Sat Aug 26, 2023 4:03 pm
Reputation: 0

Re: z Baldur's Gate 3

Post by Nick8472 »

unREAL wrote:
Sat Aug 26, 2023 4:11 pm
Nick8472 wrote:
Sat Aug 26, 2023 4:06 pm
Zanzer wrote:
Sat Aug 26, 2023 2:48 pm
Sounds like the people having problems are either due to the mods they have installed or maybe the game behaves differently when you're in act 3. Not a clue. So the only thing I can possibly do to help you all is provide a pointer to the command count.

Now you can see when the game has loaded all of the commands in memory and when you should click the Register Commands button.

At this time, it shows that there are 1263 commands. So when that value populates, register the commands!

Best of luck to you all.
I cannot even click the "Console Commands" button, even after saving and reloading.
Game Version: V4.1.1.3669438
CE Table v8
how about reading if its already solved? solutions how to fix is already posted from me ...
I scrolled and found what you posted but when I copy and paste it says:

Not all code is injectable

Are you sure you want to edit it to this?

Then nothing!

unREAL
Expert Cheater
Expert Cheater
Posts: 159
Joined: Sat May 07, 2022 4:46 pm
Reputation: 67

Re: z Baldur's Gate 3

Post by unREAL »

Nick8472 wrote:
Sat Aug 26, 2023 4:24 pm

I scrolled and found what you posted but when I copy and paste it says:

Not all code is injectable

Are you sure you want to edit it to this?

Then nothing!

Oh I made a typo .. Im sorry :mellow:

okay to make it easier for everyone, here is the complete code:

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end
local commands = readPointer("cmdList")
if commands == 0 then
  print("plaese load a saved game first")
  return
end
local size = readInteger(commands + 0x2C)
if size <= 0 then
  print("please load a saved game first")
  return
elseif size > 3000 then
  size = 3000 -- just in case
end
commands = readPointer(commands + 0x20)
COMMAND_SELF = {}
for i = 1, size do
  local addr = readPointer(commands)
  if addr > 0 then
    local name = readPointer(addr + 0x08)
    name = readString(name, 256, false)
    local self = readPointer(addr + 0x40)
    addr = readPointer(addr + 0x48)
    COMMAND_SELF[name] = self
    if addr > 0x1000 then
      unregisterSymbol(name)
      registerSymbol(name, addr, true)
    end
  end
  commands = commands + 0x08
end

function PrepareCall(name)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmd = getAddress(name)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[name])
end

function ExecuteCall(FuncName)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmdCall = getAddress("cmdCall")
  local cmd = getAddress(FuncName)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[FuncName])
  return executeCodeEx(0, nil, cmdCall)
end

function GetArgAt(i)
  return getAddress("cmdArgs") + 0x10 * i + 0x08
end

function GetStringAt(i)
  return getAddress("cmdStr"..i)
end

function ClearArg(i)
  SetArgToLong(i, 0)
end

function GetArgAsInteger(i)
  local arg = GetArgAt(i)
  return readInteger(arg)
end

function SetArgToInteger(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsLong(i)
  local arg = GetArgAt(i)
  return readQword(arg)
end

function SetArgToLong(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsFloat(i)
  local arg = GetArgAt(i)
  return readFloat(arg)
end

function SetArgToFloat(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeFloat(arg, value)
end

function SetArgToPointer(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writePointer(arg, value)
end

function GetArgAsString(i)
  local arg = GetArgAt(i)
  local value = readPointer(arg)
  if value and value > 0 then
    return readString(value, 256, false)
  end
  return nil
end

function SetArgToString(i, value)
  local str = GetStringAt(i)
  writeString(str, value)
  writeBytes(str + #value, 0)
  SetArgToPointer(i, str)
end

function GetHostCharacter()
  ClearArg(0)
  ExecuteCall("GetHostCharacter")
  return GetArgAsString(0)
end

function AddPassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      SetArgToString(1, PassiveID[i])
      ExecuteCall("AddPassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("AddPassive")
  end
end

function AddPassiveToPlayer(PassiveID)
  local player = GetHostCharacter()
  return AddPassive(player, PassiveID)
end

function AddPassiveToWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return AddPassive(item, PassiveID)
end

function RemovePassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      local value = PassiveID[i]
      SetArgToString(1, value)
      ExecuteCall("RemovePassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("RemovePassive")
  end
end

function RemovePassiveFromPlayer(PassiveID)
  local player = GetHostCharacter()
  return RemovePassive(player, PassiveID)
end

function RemovePassiveFromWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return RemovePassive(item, PassiveID)
end

function AddBoosts(Object, Boosts, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, SourceID)
  SetArgToLong(3, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("AddBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("AddBoosts")
  end
end

function AddBoostsToPlayer(Boosts)
  local player = GetHostCharacter()
  return AddBoosts(player, Boosts, 0, 0)
end

function RemoveBoosts(Object, Boosts, RemoveOnlyFirstDescMatch, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, RemoveOnlyFirstDescMatch)
  SetArgToLong(3, SourceID)
  SetArgToLong(4, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("RemoveBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("RemoveBoosts")
  end
end

function RemoveBoostsFromPlayer(Boosts)
  local player = GetHostCharacter()
  return RemoveBoosts(player, Boosts, 0, 0, 0)
end

function ApplyStatus(Object, Status, Duration, Force, Source)
  if Duration == nil then
    Duration = -1
  end
  SetArgToString(0, Object)
  SetArgToFloat(2, Duration)
  SetArgToLong(3, Force)
  SetArgToLong(4, Source)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("ApplyStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("ApplyStatus")
  end
end

function ApplyStatusToPlayer(Status, Duration)
  local player = GetHostCharacter()
  return ApplyStatus(player, Status, Duration, 1, 0)
end

function ApplyStatusToWeapon(Status)
  local item = GetEquippedWeapon()
  return ApplyStatus(item, Status, Duration, 1, 0)
end

function RemoveStatus(Target, Status, Cause)
  SetArgToString(0, Target)
  SetArgToLong(2, Cause)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("RemoveStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveStatus")
  end
end

function RemoveStatusFromPlayer(Status)
  local player = GetHostCharacter()
  return RemoveStatus(player, Status, 0)
end

function RemoveStatusFromWeapon(Status)
  local item = GetEquippedWeapon()
  return RemoveStatus(item, Status, 0)
end

function AddSpell(Character, Spell, ShowNotification, AddContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, ShowNotification)
  SetArgToLong(3, AddContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("AddSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("AddSpell")
  end
end

function AddSpellToPlayer(Spell)
  local player = GetHostCharacter()
  return AddSpell(player, Spell, 0, 1)
end

function RemoveSpell(Character, Spell, RemoveContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, RemoveContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("RemoveSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveSpell")
  end
end

function RemoveSpellFromPlayer(Spell)
  local player = GetHostCharacter()
  return RemoveSpell(player, Spell, 0)
end

function SetTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("SetTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("SetTag")
  end
end

function SetTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return SetTag(player, Tag)
end

function ClearTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("ClearTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("ClearTag")
  end
end

function ClearTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return ClearTag(player, Tag)
end

function IsTagged(Target, Tag)
  SetArgToString(0, Target)
  SetArgToString(1, Tag)
  SetArgToLong(2, 0)
  local result = ExecuteCall("IsTagged")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function IsTaggedOnPlayer(Tag)
  local player = GetHostCharacter()
  return IsTagged(player, Tag)
end

function SetFlag(Flag, Object, DialogInstance, SendFlagSetEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagSetEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("SetFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("SetFlag")
  end
end

function SetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return SetFlag(Flag, player, 0, 1)
end

function GetFlag(Flag, Object)--: FlagState
  SetArgToString(0, Flag)
  SetArgToString(1, Object)
  SetArgToLong(2, 0)
  local result = ExecuteCall("GetFlag")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function GetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return GetFlag(Flag, player)
end

function ClearFlag(Flag, Object, DialogInstance, SendFlagClearEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagClearEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("ClearFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("ClearFlag")
  end
end

function ClearFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return ClearFlag(Flag, player, 0, 1)
end

function TemplateAddTo(ItemTemplate, InventoryHolder, Count, ShowNotification)
  if Count == nil then Count = 1 end
  if ShowNotification == nil then ShowNotification = 0 end
  SetArgToString(1, InventoryHolder)
  SetArgToLong(2, Count)
  SetArgToLong(3, ShowNotification)
  ExecuteCall("TemplateAddTo")
  if type(ItemTemplate) == "table" then
    for i = 1, #ItemTemplate do
      SetArgToString(0, ItemTemplate[i])
      ExecuteCall("TemplateAddTo")
    end
  else
    SetArgToString(0, ItemTemplate)
    return ExecuteCall("TemplateAddTo")
  end
end

function TemplateAddToPlayer(ItemTemplate, Count)
  local player = GetHostCharacter()
  return TemplateAddTo(ItemTemplate, player, Count, 1)
end

function GetPosition(Target)--: X: Y: Z
  SetArgToString(0, Target)
  ClearArg(1)
  ClearArg(2)
  ClearArg(3)
  ExecuteCall("GetPosition")
  local x = GetArgAsFloat(1)
  local z = GetArgAsFloat(2)
  local y = GetArgAsFloat(3)
  return x, y, z
end

function GetPositionOfPlayer()
  local player = GetHostCharacter()
  return GetPosition(player)
end

function CreateAt(TemplateId, X, Y, Z, Temporary, PlaySpawn, SpawnFinishEvent)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToFloat(1, X)
  SetArgToFloat(2, Z)
  SetArgToFloat(3, Y)
  SetArgToLong(4, Temporary)
  SetArgToLong(5, PlaySpawn)
  SetArgToLong(6, SpawnFinishEvent)
  ClearArg(7)
  ExecuteCall("CreateAt")
  return GetArgAsString(7)
end

function CreateAtPosition(TemplateId, X, Y, Z)
  if X == nil or Y == nil or Z == nil then
    X, Y, Z = GetPositionOfPlayer()
  end
  return CreateAt(TemplateId, X, Y, Z, 0, 0, 0)
end

function CreateAtObject(TemplateId, Anchor, Temporary, PlaySpawn, SpawnFinishEvent, MatchOrientation)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToString(1, Anchor)
  SetArgToLong(2, Temporary)
  SetArgToLong(3, PlaySpawn)
  SetArgToLong(4, SpawnFinishEvent)
  SetArgToLong(5, MatchOrientation)
  ClearArg(6)
  ExecuteCall("CreateAtObject")
  return GetArgAsString(6)
end

function CreateAtPlayer(TemplateId)
  local player = GetHostCharacter()
  return CreateAtObject(TemplateId, player, 0, 0, 0, 0)
end

function GenerateTreasure(InventoryHolder, TreasureID, Level, Finder)
  SetArgToString(0, InventoryHolder)
  SetArgToString(1, TreasureID)
  SetArgToLong(2, Level)
  SetArgToString(3, Finder)
  ClearArg(4)
  return ExecuteCall("GenerateTreasure")
end

function GenerateTreasureBag(TreasureID)
  local player = GetHostCharacter()
  local bag = "3e6aac21-333b-4812-a554-376c2d157ba9"
  bag = CreateAtObject(bag, player, 0, 0, 0, 0)
  GenerateTreasure(bag, TreasureID, 12, player)
  return bag
end

function GetEquippedWeapon(Character)
  if Character == nil then
    Character = GetHostCharacter()
  end
  SetArgToString(0, Character)
  ClearArg(1)
  ExecuteCall("GetEquippedWeapon")
  return GetArgAsString(1)
end

Slotnames = {
  "Helmet",
  "Breast",
  "Cloak",
  "Melee Main Weapon",
  "Melee Offhand Weapon",
  "Ranged Main Weapon",
  "Ranged Offhand Weapon",
  "Underwear",
  "Boots",
  "Gloves",
  "Amulet",
  "Ring",
  "Ring2",
  "Wings",
  "Horns",
  "Overhead",
  "MusicalInstrument",
  "VanityBody",
  "VanityBoots"
}
for i = 1, #Slotnames do
  Slotnames[ Slotnames[i] ] = true
end
function GetEquippedItem(Character, Slotname)--: Item
  if Slotname == nil then
    Slotname = Character
    Character = GetHostCharacter()
  end
  if Slotname == nil then
    return nil
  end
  if Slotnames[Slotname] ~= true then
    print("Slotname must be one of the following: " .. table.concat(Slotnames, ", "))
    return nil
  end
  SetArgToString(0, Character)
  SetArgToString(1, Slotname)
  ClearArg(2)
  ExecuteCall("GetEquippedItem")
  return GetArgAsString(2)
end

{$asm}
[DISABLE]
just paste into Register Commands :)

User avatar
Wraithspectr3
Novice Cheater
Novice Cheater
Posts: 24
Joined: Fri Nov 12, 2021 5:59 pm
Reputation: 13

Re: z Baldur's Gate 3

Post by Wraithspectr3 »

okay, i found out some weird behavior:

i started a completly new game but with same mods, saved and reloaded, command count said 1263 like it should and everything activated.

then i loaded my main campaign save 120hours in. command count said 1269 and console commands wont activate (lua syntax error).

my workaround was load the level 1 save, activate " Console Commands" and "Register Commands", load main save and everything works.

// EDIT

thanks unREAL, your solution works!
Last edited by Wraithspectr3 on Sat Aug 26, 2023 4:38 pm, edited 1 time in total.

Nick8472
What is cheating?
What is cheating?
Posts: 4
Joined: Sat Aug 26, 2023 4:03 pm
Reputation: 0

Re: z Baldur's Gate 3

Post by Nick8472 »

unREAL wrote:
Sat Aug 26, 2023 4:33 pm
Nick8472 wrote:
Sat Aug 26, 2023 4:24 pm

I scrolled and found what you posted but when I copy and paste it says:

Not all code is injectable

Are you sure you want to edit it to this?

Then nothing!

Oh I made a typo .. Im sorry :mellow:

okay to make it easier for everyone, here is the complete code:

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end
local commands = readPointer("cmdList")
if commands == 0 then
  print("plaese load a saved game first")
  return
end
local size = readInteger(commands + 0x2C)
if size <= 0 then
  print("please load a saved game first")
  return
elseif size > 3000 then
  size = 3000 -- just in case
end
commands = readPointer(commands + 0x20)
COMMAND_SELF = {}
for i = 1, size do
  local addr = readPointer(commands)
  if addr > 0 then
    local name = readPointer(addr + 0x08)
    name = readString(name, 256, false)
    local self = readPointer(addr + 0x40)
    addr = readPointer(addr + 0x48)
    COMMAND_SELF[name] = self
    if addr > 0x1000 then
      unregisterSymbol(name)
      registerSymbol(name, addr, true)
    end
  end
  commands = commands + 0x08
end

function PrepareCall(name)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmd = getAddress(name)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[name])
end

function ExecuteCall(FuncName)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmdCall = getAddress("cmdCall")
  local cmd = getAddress(FuncName)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[FuncName])
  return executeCodeEx(0, nil, cmdCall)
end

function GetArgAt(i)
  return getAddress("cmdArgs") + 0x10 * i + 0x08
end

function GetStringAt(i)
  return getAddress("cmdStr"..i)
end

function ClearArg(i)
  SetArgToLong(i, 0)
end

function GetArgAsInteger(i)
  local arg = GetArgAt(i)
  return readInteger(arg)
end

function SetArgToInteger(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsLong(i)
  local arg = GetArgAt(i)
  return readQword(arg)
end

function SetArgToLong(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsFloat(i)
  local arg = GetArgAt(i)
  return readFloat(arg)
end

function SetArgToFloat(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeFloat(arg, value)
end

function SetArgToPointer(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writePointer(arg, value)
end

function GetArgAsString(i)
  local arg = GetArgAt(i)
  local value = readPointer(arg)
  if value and value > 0 then
    return readString(value, 256, false)
  end
  return nil
end

function SetArgToString(i, value)
  local str = GetStringAt(i)
  writeString(str, value)
  writeBytes(str + #value, 0)
  SetArgToPointer(i, str)
end

function GetHostCharacter()
  ClearArg(0)
  ExecuteCall("GetHostCharacter")
  return GetArgAsString(0)
end

function AddPassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      SetArgToString(1, PassiveID[i])
      ExecuteCall("AddPassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("AddPassive")
  end
end

function AddPassiveToPlayer(PassiveID)
  local player = GetHostCharacter()
  return AddPassive(player, PassiveID)
end

function AddPassiveToWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return AddPassive(item, PassiveID)
end

function RemovePassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      local value = PassiveID[i]
      SetArgToString(1, value)
      ExecuteCall("RemovePassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("RemovePassive")
  end
end

function RemovePassiveFromPlayer(PassiveID)
  local player = GetHostCharacter()
  return RemovePassive(player, PassiveID)
end

function RemovePassiveFromWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return RemovePassive(item, PassiveID)
end

function AddBoosts(Object, Boosts, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, SourceID)
  SetArgToLong(3, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("AddBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("AddBoosts")
  end
end

function AddBoostsToPlayer(Boosts)
  local player = GetHostCharacter()
  return AddBoosts(player, Boosts, 0, 0)
end

function RemoveBoosts(Object, Boosts, RemoveOnlyFirstDescMatch, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, RemoveOnlyFirstDescMatch)
  SetArgToLong(3, SourceID)
  SetArgToLong(4, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("RemoveBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("RemoveBoosts")
  end
end

function RemoveBoostsFromPlayer(Boosts)
  local player = GetHostCharacter()
  return RemoveBoosts(player, Boosts, 0, 0, 0)
end

function ApplyStatus(Object, Status, Duration, Force, Source)
  if Duration == nil then
    Duration = -1
  end
  SetArgToString(0, Object)
  SetArgToFloat(2, Duration)
  SetArgToLong(3, Force)
  SetArgToLong(4, Source)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("ApplyStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("ApplyStatus")
  end
end

function ApplyStatusToPlayer(Status, Duration)
  local player = GetHostCharacter()
  return ApplyStatus(player, Status, Duration, 1, 0)
end

function ApplyStatusToWeapon(Status)
  local item = GetEquippedWeapon()
  return ApplyStatus(item, Status, Duration, 1, 0)
end

function RemoveStatus(Target, Status, Cause)
  SetArgToString(0, Target)
  SetArgToLong(2, Cause)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("RemoveStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveStatus")
  end
end

function RemoveStatusFromPlayer(Status)
  local player = GetHostCharacter()
  return RemoveStatus(player, Status, 0)
end

function RemoveStatusFromWeapon(Status)
  local item = GetEquippedWeapon()
  return RemoveStatus(item, Status, 0)
end

function AddSpell(Character, Spell, ShowNotification, AddContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, ShowNotification)
  SetArgToLong(3, AddContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("AddSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("AddSpell")
  end
end

function AddSpellToPlayer(Spell)
  local player = GetHostCharacter()
  return AddSpell(player, Spell, 0, 1)
end

function RemoveSpell(Character, Spell, RemoveContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, RemoveContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("RemoveSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveSpell")
  end
end

function RemoveSpellFromPlayer(Spell)
  local player = GetHostCharacter()
  return RemoveSpell(player, Spell, 0)
end

function SetTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("SetTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("SetTag")
  end
end

function SetTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return SetTag(player, Tag)
end

function ClearTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("ClearTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("ClearTag")
  end
end

function ClearTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return ClearTag(player, Tag)
end

function IsTagged(Target, Tag)
  SetArgToString(0, Target)
  SetArgToString(1, Tag)
  SetArgToLong(2, 0)
  local result = ExecuteCall("IsTagged")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function IsTaggedOnPlayer(Tag)
  local player = GetHostCharacter()
  return IsTagged(player, Tag)
end

function SetFlag(Flag, Object, DialogInstance, SendFlagSetEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagSetEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("SetFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("SetFlag")
  end
end

function SetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return SetFlag(Flag, player, 0, 1)
end

function GetFlag(Flag, Object)--: FlagState
  SetArgToString(0, Flag)
  SetArgToString(1, Object)
  SetArgToLong(2, 0)
  local result = ExecuteCall("GetFlag")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function GetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return GetFlag(Flag, player)
end

function ClearFlag(Flag, Object, DialogInstance, SendFlagClearEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagClearEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("ClearFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("ClearFlag")
  end
end

function ClearFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return ClearFlag(Flag, player, 0, 1)
end

function TemplateAddTo(ItemTemplate, InventoryHolder, Count, ShowNotification)
  if Count == nil then Count = 1 end
  if ShowNotification == nil then ShowNotification = 0 end
  SetArgToString(1, InventoryHolder)
  SetArgToLong(2, Count)
  SetArgToLong(3, ShowNotification)
  ExecuteCall("TemplateAddTo")
  if type(ItemTemplate) == "table" then
    for i = 1, #ItemTemplate do
      SetArgToString(0, ItemTemplate[i])
      ExecuteCall("TemplateAddTo")
    end
  else
    SetArgToString(0, ItemTemplate)
    return ExecuteCall("TemplateAddTo")
  end
end

function TemplateAddToPlayer(ItemTemplate, Count)
  local player = GetHostCharacter()
  return TemplateAddTo(ItemTemplate, player, Count, 1)
end

function GetPosition(Target)--: X: Y: Z
  SetArgToString(0, Target)
  ClearArg(1)
  ClearArg(2)
  ClearArg(3)
  ExecuteCall("GetPosition")
  local x = GetArgAsFloat(1)
  local z = GetArgAsFloat(2)
  local y = GetArgAsFloat(3)
  return x, y, z
end

function GetPositionOfPlayer()
  local player = GetHostCharacter()
  return GetPosition(player)
end

function CreateAt(TemplateId, X, Y, Z, Temporary, PlaySpawn, SpawnFinishEvent)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToFloat(1, X)
  SetArgToFloat(2, Z)
  SetArgToFloat(3, Y)
  SetArgToLong(4, Temporary)
  SetArgToLong(5, PlaySpawn)
  SetArgToLong(6, SpawnFinishEvent)
  ClearArg(7)
  ExecuteCall("CreateAt")
  return GetArgAsString(7)
end

function CreateAtPosition(TemplateId, X, Y, Z)
  if X == nil or Y == nil or Z == nil then
    X, Y, Z = GetPositionOfPlayer()
  end
  return CreateAt(TemplateId, X, Y, Z, 0, 0, 0)
end

function CreateAtObject(TemplateId, Anchor, Temporary, PlaySpawn, SpawnFinishEvent, MatchOrientation)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToString(1, Anchor)
  SetArgToLong(2, Temporary)
  SetArgToLong(3, PlaySpawn)
  SetArgToLong(4, SpawnFinishEvent)
  SetArgToLong(5, MatchOrientation)
  ClearArg(6)
  ExecuteCall("CreateAtObject")
  return GetArgAsString(6)
end

function CreateAtPlayer(TemplateId)
  local player = GetHostCharacter()
  return CreateAtObject(TemplateId, player, 0, 0, 0, 0)
end

function GenerateTreasure(InventoryHolder, TreasureID, Level, Finder)
  SetArgToString(0, InventoryHolder)
  SetArgToString(1, TreasureID)
  SetArgToLong(2, Level)
  SetArgToString(3, Finder)
  ClearArg(4)
  return ExecuteCall("GenerateTreasure")
end

function GenerateTreasureBag(TreasureID)
  local player = GetHostCharacter()
  local bag = "3e6aac21-333b-4812-a554-376c2d157ba9"
  bag = CreateAtObject(bag, player, 0, 0, 0, 0)
  GenerateTreasure(bag, TreasureID, 12, player)
  return bag
end

function GetEquippedWeapon(Character)
  if Character == nil then
    Character = GetHostCharacter()
  end
  SetArgToString(0, Character)
  ClearArg(1)
  ExecuteCall("GetEquippedWeapon")
  return GetArgAsString(1)
end

Slotnames = {
  "Helmet",
  "Breast",
  "Cloak",
  "Melee Main Weapon",
  "Melee Offhand Weapon",
  "Ranged Main Weapon",
  "Ranged Offhand Weapon",
  "Underwear",
  "Boots",
  "Gloves",
  "Amulet",
  "Ring",
  "Ring2",
  "Wings",
  "Horns",
  "Overhead",
  "MusicalInstrument",
  "VanityBody",
  "VanityBoots"
}
for i = 1, #Slotnames do
  Slotnames[ Slotnames[i] ] = true
end
function GetEquippedItem(Character, Slotname)--: Item
  if Slotname == nil then
    Slotname = Character
    Character = GetHostCharacter()
  end
  if Slotname == nil then
    return nil
  end
  if Slotnames[Slotname] ~= true then
    print("Slotname must be one of the following: " .. table.concat(Slotnames, ", "))
    return nil
  end
  SetArgToString(0, Character)
  SetArgToString(1, Slotname)
  ClearArg(2)
  ExecuteCall("GetEquippedItem")
  return GetArgAsString(2)
end

{$asm}
[DISABLE]
just paste into Register Commands :)

That worked!!! Thanks! (Have to use Vulkan, DX11 wont register the "console command")

User avatar
The Doctor
Novice Cheater
Novice Cheater
Posts: 17
Joined: Sun Mar 05, 2017 10:44 pm
Reputation: 2

Re: z Baldur's Gate 3

Post by The Doctor »

I got a Lua error when I tried to activate Register Commands. Save is loaded. I'm already in-game. But the game is modded, so I don't know if that could be the cause.

Image

Edit:
unREAL wrote:
Sat Aug 26, 2023 4:33 pm
Nick8472 wrote:
Sat Aug 26, 2023 4:24 pm

I scrolled and found what you posted but when I copy and paste it says:

Not all code is injectable

Are you sure you want to edit it to this?

Then nothing!

Oh I made a typo .. Im sorry :mellow:

okay to make it easier for everyone, here is the complete code:

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end
local commands = readPointer("cmdList")
if commands == 0 then
  print("plaese load a saved game first")
  return
end
local size = readInteger(commands + 0x2C)
if size <= 0 then
  print("please load a saved game first")
  return
elseif size > 3000 then
  size = 3000 -- just in case
end
commands = readPointer(commands + 0x20)
COMMAND_SELF = {}
for i = 1, size do
  local addr = readPointer(commands)
  if addr > 0 then
    local name = readPointer(addr + 0x08)
    name = readString(name, 256, false)
    local self = readPointer(addr + 0x40)
    addr = readPointer(addr + 0x48)
    COMMAND_SELF[name] = self
    if addr > 0x1000 then
      unregisterSymbol(name)
      registerSymbol(name, addr, true)
    end
  end
  commands = commands + 0x08
end

function PrepareCall(name)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmd = getAddress(name)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[name])
end

function ExecuteCall(FuncName)
  local cmdAddr = getAddress("cmdAddr")
  local cmdSelf = getAddress("cmdSelf")
  local cmdCall = getAddress("cmdCall")
  local cmd = getAddress(FuncName)
  writePointer(cmdAddr, cmd)
  writePointer(cmdSelf, COMMAND_SELF[FuncName])
  return executeCodeEx(0, nil, cmdCall)
end

function GetArgAt(i)
  return getAddress("cmdArgs") + 0x10 * i + 0x08
end

function GetStringAt(i)
  return getAddress("cmdStr"..i)
end

function ClearArg(i)
  SetArgToLong(i, 0)
end

function GetArgAsInteger(i)
  local arg = GetArgAt(i)
  return readInteger(arg)
end

function SetArgToInteger(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsLong(i)
  local arg = GetArgAt(i)
  return readQword(arg)
end

function SetArgToLong(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeQword(arg, value)
end

function GetArgAsFloat(i)
  local arg = GetArgAt(i)
  return readFloat(arg)
end

function SetArgToFloat(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writeFloat(arg, value)
end

function SetArgToPointer(i, value)
  local arg = GetArgAt(i)
  if value == nil then value = 0 end
  writePointer(arg, value)
end

function GetArgAsString(i)
  local arg = GetArgAt(i)
  local value = readPointer(arg)
  if value and value > 0 then
    return readString(value, 256, false)
  end
  return nil
end

function SetArgToString(i, value)
  local str = GetStringAt(i)
  writeString(str, value)
  writeBytes(str + #value, 0)
  SetArgToPointer(i, str)
end

function GetHostCharacter()
  ClearArg(0)
  ExecuteCall("GetHostCharacter")
  return GetArgAsString(0)
end

function AddPassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      SetArgToString(1, PassiveID[i])
      ExecuteCall("AddPassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("AddPassive")
  end
end

function AddPassiveToPlayer(PassiveID)
  local player = GetHostCharacter()
  return AddPassive(player, PassiveID)
end

function AddPassiveToWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return AddPassive(item, PassiveID)
end

function RemovePassive(Entity, PassiveID)
  SetArgToString(0, Entity)
  if type(PassiveID) == "table" then
    for i = 1, #PassiveID do
      local value = PassiveID[i]
      SetArgToString(1, value)
      ExecuteCall("RemovePassive")
    end
  else
    SetArgToString(1, PassiveID)
    return ExecuteCall("RemovePassive")
  end
end

function RemovePassiveFromPlayer(PassiveID)
  local player = GetHostCharacter()
  return RemovePassive(player, PassiveID)
end

function RemovePassiveFromWeapon(PassiveID)
  local item = GetEquippedWeapon()
  return RemovePassive(item, PassiveID)
end

function AddBoosts(Object, Boosts, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, SourceID)
  SetArgToLong(3, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("AddBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("AddBoosts")
  end
end

function AddBoostsToPlayer(Boosts)
  local player = GetHostCharacter()
  return AddBoosts(player, Boosts, 0, 0)
end

function RemoveBoosts(Object, Boosts, RemoveOnlyFirstDescMatch, SourceID, Cause)
  SetArgToString(0, Object)
  SetArgToLong(2, RemoveOnlyFirstDescMatch)
  SetArgToLong(3, SourceID)
  SetArgToLong(4, Cause)
  if type(Boosts) == "table" then
    for i = 1, #Boosts do
      SetArgToString(1, Boosts[i])
      ExecuteCall("RemoveBoosts")
    end
  else
    SetArgToString(1, Boosts)
    return ExecuteCall("RemoveBoosts")
  end
end

function RemoveBoostsFromPlayer(Boosts)
  local player = GetHostCharacter()
  return RemoveBoosts(player, Boosts, 0, 0, 0)
end

function ApplyStatus(Object, Status, Duration, Force, Source)
  if Duration == nil then
    Duration = -1
  end
  SetArgToString(0, Object)
  SetArgToFloat(2, Duration)
  SetArgToLong(3, Force)
  SetArgToLong(4, Source)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("ApplyStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("ApplyStatus")
  end
end

function ApplyStatusToPlayer(Status, Duration)
  local player = GetHostCharacter()
  return ApplyStatus(player, Status, Duration, 1, 0)
end

function ApplyStatusToWeapon(Status)
  local item = GetEquippedWeapon()
  return ApplyStatus(item, Status, Duration, 1, 0)
end

function RemoveStatus(Target, Status, Cause)
  SetArgToString(0, Target)
  SetArgToLong(2, Cause)
  if type(Status) == "table" then
    for i = 1, #Status do
      SetArgToString(1, Status[i])
      ExecuteCall("RemoveStatus")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveStatus")
  end
end

function RemoveStatusFromPlayer(Status)
  local player = GetHostCharacter()
  return RemoveStatus(player, Status, 0)
end

function RemoveStatusFromWeapon(Status)
  local item = GetEquippedWeapon()
  return RemoveStatus(item, Status, 0)
end

function AddSpell(Character, Spell, ShowNotification, AddContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, ShowNotification)
  SetArgToLong(3, AddContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("AddSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("AddSpell")
  end
end

function AddSpellToPlayer(Spell)
  local player = GetHostCharacter()
  return AddSpell(player, Spell, 0, 1)
end

function RemoveSpell(Character, Spell, RemoveContainerSpells)
  SetArgToString(0, Character)
  SetArgToLong(2, RemoveContainerSpells)
  if type(Spell) == "table" then
    for i = 1, #Spell do
      SetArgToString(1, Spell[i])
      ExecuteCall("RemoveSpell")
    end
  else
    SetArgToString(1, Status)
    return ExecuteCall("RemoveSpell")
  end
end

function RemoveSpellFromPlayer(Spell)
  local player = GetHostCharacter()
  return RemoveSpell(player, Spell, 0)
end

function SetTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("SetTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("SetTag")
  end
end

function SetTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return SetTag(player, Tag)
end

function ClearTag(Target, Tag)
  SetArgToString(0, Target)
  if type(Tag) == "table" then
    for i = 1, #Tag do
      SetArgToString(1, Tag[i])
      ExecuteCall("ClearTag")
    end
  else
    SetArgToString(1, Tag)
    return ExecuteCall("ClearTag")
  end
end

function ClearTagOnPlayer(Tag)
  local player = GetHostCharacter()
  return ClearTag(player, Tag)
end

function IsTagged(Target, Tag)
  SetArgToString(0, Target)
  SetArgToString(1, Tag)
  SetArgToLong(2, 0)
  local result = ExecuteCall("IsTagged")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function IsTaggedOnPlayer(Tag)
  local player = GetHostCharacter()
  return IsTagged(player, Tag)
end

function SetFlag(Flag, Object, DialogInstance, SendFlagSetEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagSetEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("SetFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("SetFlag")
  end
end

function SetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return SetFlag(Flag, player, 0, 1)
end

function GetFlag(Flag, Object)--: FlagState
  SetArgToString(0, Flag)
  SetArgToString(1, Object)
  SetArgToLong(2, 0)
  local result = ExecuteCall("GetFlag")
  if result == 1 then
    return GetArgAsInteger(2)
  else
    return nil
  end
end

function GetFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return GetFlag(Flag, player)
end

function ClearFlag(Flag, Object, DialogInstance, SendFlagClearEventIfChanged)
  SetArgToString(1, Object)
  SetArgToLong(2, DialogInstance)
  SetArgToLong(3, SendFlagClearEventIfChanged)
  if type(Flag) == "table" then
    for i = 1, #Flag do
      SetArgToString(0, Flag[i])
      ExecuteCall("ClearFlag")
    end
  else
    SetArgToString(0, Flag)
    return ExecuteCall("ClearFlag")
  end
end

function ClearFlagOnPlayer(Flag)
  local player = GetHostCharacter()
  return ClearFlag(Flag, player, 0, 1)
end

function TemplateAddTo(ItemTemplate, InventoryHolder, Count, ShowNotification)
  if Count == nil then Count = 1 end
  if ShowNotification == nil then ShowNotification = 0 end
  SetArgToString(1, InventoryHolder)
  SetArgToLong(2, Count)
  SetArgToLong(3, ShowNotification)
  ExecuteCall("TemplateAddTo")
  if type(ItemTemplate) == "table" then
    for i = 1, #ItemTemplate do
      SetArgToString(0, ItemTemplate[i])
      ExecuteCall("TemplateAddTo")
    end
  else
    SetArgToString(0, ItemTemplate)
    return ExecuteCall("TemplateAddTo")
  end
end

function TemplateAddToPlayer(ItemTemplate, Count)
  local player = GetHostCharacter()
  return TemplateAddTo(ItemTemplate, player, Count, 1)
end

function GetPosition(Target)--: X: Y: Z
  SetArgToString(0, Target)
  ClearArg(1)
  ClearArg(2)
  ClearArg(3)
  ExecuteCall("GetPosition")
  local x = GetArgAsFloat(1)
  local z = GetArgAsFloat(2)
  local y = GetArgAsFloat(3)
  return x, y, z
end

function GetPositionOfPlayer()
  local player = GetHostCharacter()
  return GetPosition(player)
end

function CreateAt(TemplateId, X, Y, Z, Temporary, PlaySpawn, SpawnFinishEvent)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToFloat(1, X)
  SetArgToFloat(2, Z)
  SetArgToFloat(3, Y)
  SetArgToLong(4, Temporary)
  SetArgToLong(5, PlaySpawn)
  SetArgToLong(6, SpawnFinishEvent)
  ClearArg(7)
  ExecuteCall("CreateAt")
  return GetArgAsString(7)
end

function CreateAtPosition(TemplateId, X, Y, Z)
  if X == nil or Y == nil or Z == nil then
    X, Y, Z = GetPositionOfPlayer()
  end
  return CreateAt(TemplateId, X, Y, Z, 0, 0, 0)
end

function CreateAtObject(TemplateId, Anchor, Temporary, PlaySpawn, SpawnFinishEvent, MatchOrientation)--: CreatedObject
  SetArgToString(0, TemplateId)
  SetArgToString(1, Anchor)
  SetArgToLong(2, Temporary)
  SetArgToLong(3, PlaySpawn)
  SetArgToLong(4, SpawnFinishEvent)
  SetArgToLong(5, MatchOrientation)
  ClearArg(6)
  ExecuteCall("CreateAtObject")
  return GetArgAsString(6)
end

function CreateAtPlayer(TemplateId)
  local player = GetHostCharacter()
  return CreateAtObject(TemplateId, player, 0, 0, 0, 0)
end

function GenerateTreasure(InventoryHolder, TreasureID, Level, Finder)
  SetArgToString(0, InventoryHolder)
  SetArgToString(1, TreasureID)
  SetArgToLong(2, Level)
  SetArgToString(3, Finder)
  ClearArg(4)
  return ExecuteCall("GenerateTreasure")
end

function GenerateTreasureBag(TreasureID)
  local player = GetHostCharacter()
  local bag = "3e6aac21-333b-4812-a554-376c2d157ba9"
  bag = CreateAtObject(bag, player, 0, 0, 0, 0)
  GenerateTreasure(bag, TreasureID, 12, player)
  return bag
end

function GetEquippedWeapon(Character)
  if Character == nil then
    Character = GetHostCharacter()
  end
  SetArgToString(0, Character)
  ClearArg(1)
  ExecuteCall("GetEquippedWeapon")
  return GetArgAsString(1)
end

Slotnames = {
  "Helmet",
  "Breast",
  "Cloak",
  "Melee Main Weapon",
  "Melee Offhand Weapon",
  "Ranged Main Weapon",
  "Ranged Offhand Weapon",
  "Underwear",
  "Boots",
  "Gloves",
  "Amulet",
  "Ring",
  "Ring2",
  "Wings",
  "Horns",
  "Overhead",
  "MusicalInstrument",
  "VanityBody",
  "VanityBoots"
}
for i = 1, #Slotnames do
  Slotnames[ Slotnames[i] ] = true
end
function GetEquippedItem(Character, Slotname)--: Item
  if Slotname == nil then
    Slotname = Character
    Character = GetHostCharacter()
  end
  if Slotname == nil then
    return nil
  end
  if Slotnames[Slotname] ~= true then
    print("Slotname must be one of the following: " .. table.concat(Slotnames, ", "))
    return nil
  end
  SetArgToString(0, Character)
  SetArgToString(1, Slotname)
  ClearArg(2)
  ExecuteCall("GetEquippedItem")
  return GetArgAsString(2)
end

{$asm}
[DISABLE]
just paste into Register Commands :)
this one fixed it for me. thank you.
Last edited by The Doctor on Sat Aug 26, 2023 4:41 pm, edited 1 time in total.

unREAL
Expert Cheater
Expert Cheater
Posts: 159
Joined: Sat May 07, 2022 4:46 pm
Reputation: 67

Re: z Baldur's Gate 3

Post by unREAL »

The Doctor wrote:
Sat Aug 26, 2023 4:38 pm
I got a Lua error when I tried to activate Register Commands. Save is loaded. I'm already in-game. But the game is modded, so I don't know if that could be the cause.

I wonder if it would help if you would look at the post directly above :|

Im out ... the fix is posted and if people are too lazy to read then its their own fault that its not working :)

Letstalk804
Noobzor
Noobzor
Posts: 6
Joined: Sat Aug 26, 2023 3:22 pm
Reputation: 0

Re: z Baldur's Gate 3

Post by Letstalk804 »

Can someone please help me? I’m not good with this stuff.
Is there someway I can spawn a custom ring/armor with +20 sleight of hand so I can have a permanent boost? I was wondering if it’s possible to put a proficiency bonus of any size on armor

Tekrom0
Cheater
Cheater
Posts: 27
Joined: Sun Mar 29, 2020 6:04 pm
Reputation: 6

Re: z Baldur's Gate 3

Post by Tekrom0 »

Would there be a way to spawn corpses? Specifically for the use of spells that require one to be used.
I tried looking at the ID of the last dropped corpse, but I guess it doesn't count as an item, lmao.

Pebyoghmoob
Noobzor
Noobzor
Posts: 10
Joined: Sun Aug 20, 2023 6:02 am
Reputation: 1

Re: z Baldur's Gate 3

Post by Pebyoghmoob »

Letstalk804 wrote:
Sat Aug 26, 2023 5:40 pm
Can someone please help me? I’m not good with this stuff.
Is there someway I can spawn a custom ring/armor with +20 sleight of hand so I can have a permanent boost? I was wondering if it’s possible to put a proficiency bonus of any size on armor
I don't think you can make boost permanent, you will have to mod it.

I had asked a similar question and no answer (if anyone know if its possible to add passive/applied status/boost to armor/camp without modding). Will be much appreciated.

Gothfather
Novice Cheater
Novice Cheater
Posts: 18
Joined: Sat Oct 17, 2020 6:06 am
Reputation: 4

Re: z Baldur's Gate 3

Post by Gothfather »

The table has gain some quirks today. Yesterday I had the game patched and used yesterday's table and these quirks did not exist.

Information of what i am using for my game today
No mods.
GoG version of the game v4.1.1.3669438
table used Game v4.1.1.3669438 --- Table v9

The quirk
When I use console commands I get an error load save game upon clicking on the register commands option. If you load a game and wait around 10 secs you will get this error again. You have about 3 to 5 seconds to click this option or you will get the error again. In my limited experience.

Yesterday this was not an issue and I am talking post patch for myself. I bring this up because people seem to be having issues with the table today. I noticed there was a download today when I went to play. And this was not the patch as i played yesterday and used the patch so this seems like a new download.

But again if you are having troubles with the console commands with the table i recommend F5 quick save then F8 quick load and when the gave first loads try opening up the console commands. The key is right after the game loads open up console commands. Once open they seem to work as you need them.

astaryZIr
What is cheating?
What is cheating?
Posts: 4
Joined: Sat Aug 26, 2023 6:31 am
Reputation: 1

Re: z Baldur's Gate 3

Post by astaryZIr »

astaryZIr wrote:
Sat Aug 26, 2023 7:54 am
Oh dang I found out the problem now. Is not the mods or the cheat engine, apparently if you load a save game that is SAVED from the previous game update (which is Hotfix 4), the cheat tables refuse to work. I started a new character (with Patch 1), save, then reload the save, the register commands work properly now for me. Well at least for me. The rest of yall probably have different problems. Damn I guess I have to start over. shit! Thank you for the tables anyway.
Hey everyone I don't know if this any help to any of you but I'm quoting my own post here if anyone wanted to try my own way of "fixing" it I suppose.

Aeill
What is cheating?
What is cheating?
Posts: 2
Joined: Sat Aug 26, 2023 2:52 pm
Reputation: 0

Re: z Baldur's Gate 3

Post by Aeill »

Noway3 wrote:
Sat Aug 26, 2023 3:41 pm
Aeill wrote:
Sat Aug 26, 2023 2:57 pm
Gameholix wrote:
Sat Aug 26, 2023 2:09 pm


I was able to get it working using these steps, thanks! However, it only worked when I clicked register while the game was loading (as soon as command list is populated).
I need some help... After multiples tentative i'm not able to make the register command working.. anyone have an idea how i can make it work? all other script work except the one i want, register command... if it can help, when i right clic on register command i have a message: lua error in the script at line 2...here what i see when i clic on that message:


[...]

thanks for your help!!!
Ok, I was able to reproduce your issue with an outdated version of the game(v1.1.3648072).
The game was updated by Larian Studios yesterday to version v4.1.1.3669438!

You can verify your game version on the bottom right of the main menu game screen. If it does not match you should let GOG or Steam launcher update it and then you can retry the CT with it.
i have the lastest version... i tried to start a new game and then the register command is working! but i can't figure out how to have it working with my old savefiles even if i tried to save after the update and use the new savefiles... it seems to only work if i restart a new character from the begenning... any idea on what to do?

EDIT: NVM, thx to unREAL it works!!! thanks a lot!!
Last edited by Aeill on Sat Aug 26, 2023 7:11 pm, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: 86sewer, adolink, Bing [Bot], caroline00, Google Adsense [Bot], Jaxtes, kisskhan