I have this code that when I run it in Lua console, it works perfectly. The entity is spawned, equipped, etc… and it moves and attacks my guys, etc… Fine.
local nina = radiant.entities.create_entity("swamp_goblins:humans:nina", {owner = ctx.npc_player_id})
nina:get_component('stonehearth:job'):promote_to("stonehearth:jobs:footman")
local equips = nina:add_component('stonehearth:equipment')
equips:equip_item("stonehearth:trapper:knife")
equips:equip_item("/stonehearth/jobs/cleric/cleric_abilities/cleric_abilities.json")
radiant.terrain.place_entity(nina, ctx["firefly_human_encounter"].boss_location)
Now, the exact same code, with not a single character difference, but run from a campaign script instead of console, it does not work! The character is spawned but has no a.i., the only movement he does is the idle breath (because it was set in the json) but it is not even idle, as it has no a.i. Opening the ai debug view it is empty, no idle, no top, etc…
Why?