arcanjl wrote: ↑Sun Apr 20, 2025 1:50 pm
... Is there a way to spawn a monster/creature/bad guy?
You can
spawn any number of entities (ie make copies) from a
template. Template uuids can be found for both characters and items. You can also
summon the actual
local/global entity you would encounter in game. Summoning a character this way carries quest breaking risks because it is the actual character associated with triggers and flags.
You can find all entity uuids thanks to data dumps from Noway3 or even Norbytes browser page mentioned a few posts back:
Noway3 wrote: ↑Sat Nov 09, 2024 5:16 pm
[*] BG3 Data files and data search pages:
- Noway3 - BG3 Data files exports (json, excel, sqlite) Forum link [Link]
- Norbyte - BG3 Search Engine [Link]
- blueneuron - BG3 Data Browser Forum link [Link]
[*]
How to search in this forum: [Link] <-
add your own keywords in this Google's search box
Once you've picked the uuid of the entity/character you want, paste it into one of these two codes below (where appropriate). I think it's important to reiterate for clarity because it's often misunderstood. By using a
template uuid in this first code you will generate a
spawn. Spawns are new entities with their own unique uuids.
This first code uses a template to create a spawn at your location in which you are the anchor. I wrote this code so it will also
print the spawn's uuid to manipulate further if you want: Freeze and Unfreeze it. Make it a Follower. Make it a Companion. Give it Boosts, Statuses, and Passives. Make it Invisible. Make it run Offstage or back Onstage. Transform it into another entity. Force it to Equip items. Change its Faction. Heal it. Kill it. Revive it. etc...
Code: Select all
{$lua}
if syntaxcheck then return end
--------------------------------------------------------------------------------
anchor = GetHostCharacter()
--------------------------------------------------------------------------------
template = "ca796a60-ab2c-43f2-a2d4-d688750e46cc"--Intellect_Devourer_CIN
--------------------------------------------------------------------------------
[ENABLE]
SetArgToString(0,template)
SetArgToString(1,anchor)
SetArgToInteger(2,1)
SetArgToInteger(3,1)
SetArgToInteger(4,0)
SetArgToInteger(5,1)
ClearArg(6)
ExecuteCall("CreateAtObject")
--------------------------------------------------------------------------------
uuid = GetArgAsString(6)
print("spawn: " .. uuid)
--------------------------------------------------------------------------------
[DISABLE]
As stated before, BG3 has unique
local/global characters too. This is the
actual character you encounter in game. They are quest dependent and almost always have their own triggers and flags. There are several templates of the Emperor (for cinematic reasons etc) but there is only one that is the actual character:
S_GLO_Emperor. Another potential roadblock when summoning characters is that if it's a
local character it is Act dependent and cannot be summoned outside of the Act their character resides.
Global characters can be summoned in any Act because they're in every Act.
S_GLO_Emperor happens to be a global character so it can be summoned in any Act. This is in contrast to templates which can always be used to create spawns whenever or wherever.
Use this code to summon a local/global character at your location in which you are the anchor:
Code: Select all
{$lua}
if syntaxcheck then return end
--------------------------------------------------------------------------------
anchor = GetHostCharacter()
--------------------------------------------------------------------------------
summon = "73d49dc5-8b8b-45dc-a98c-927bb4e3169b"--S_GLO_Emperor
--------------------------------------------------------------------------------
[ENABLE]
SetArgToString(0,summon)
SetArgToString(1,anchor)
SetArgToLong(2,0)
SetArgToLong(3,1)
SetArgToLong(4,1)
SetArgToLong(5,1)
SetArgToLong(6,1)
SetArgToLong(7,1)
ExecuteCall("TeleportTo")
--------------------------------------------------------------------------------
[DISABLE]