Unborrow Flag - Antlion Guard on Spawn

As I’ve seen on the Valve Developer Wiki here and here:

The antlion has a function to unborrow itself when spawned; how can I trigger this via Lua? I’m trying to make an Antlion Guard spawn and unborrow itself from the ground when it does to create a smooth transition. I couldn’t find any documentation on the Wiki or previous threads here.

[lua]ent:Fire(‘Unborrow’)[/lua]

[editline]24th January 2014[/editline]

I might have read your post wrong, perhaps this might work?

[lua]ent:SetKeyValue( “spawnflags”, 2048 )[/lua]

2048 corresponds to “Template NPC: This entity is a template for the npc_template_maker. It will not spawn automatically and cannot be used with point_template.”, as mentioned on the wiki page.

Both don’t work.

Andlion guard has a KEYVALUE for start burrowed, not a spawnflag, so you go to hl2 or base.fgd, check whatever string valve use for “Start Burrowed” keyvalue and use Ent:SetKeyValue( k, v ) and then fire “Unborrow”.

Found the correct keyvalue, firing Unborrow doesn’t work.

Wouldn’t it be Unburrow?

Still doesn’t work, although you’re right.

You are doing it wrong. Show your code.

[lua]
local function InitalizeBeast()
local beast = ents.Create( “npc_antlionguard” )
–local spawn = table.Random(ents.FindByClass(“info_player_deathmatch”)):GetPos()
beast:SetPos( Vector(25.577255, 1233.858154, 128.031250) )
beast:SetHealth( 1000 )
beast:SetKeyValue( “startburrowed”, 1 )
beast:Fire( “Unburrow” )
beast:Spawn()
end
[/lua]

I’ve also tried reordering where I fire Unburrow. As it stands, when I execute this function with startburrowed set to one nothing happens and I don’t see the antlion. When I set startburrowed to 0 it spawns in instantly like normal.

You gotta fire the input after you spawn it.

I tried that as well no joy.

Have you tried to add a timer that fires the input like half a second to a second after it spawns?