@anon41658148 posted a new topic, subject "Unborrow Flag - Antlion Guard on Spawn". It read:

   As I've seen on the Valve Developer Wiki here and here:
    
    developer.valvesoftware.com
    
    ### npc_antlionguard - Valve Developer Community
    
    developer.valvesoftware.com
    
    ### Mapping with Antlions - Valve Developer Community
    
    > To make an antlion that unburrows on spawn, check the _Start Burrowed_ flag on the antlion, configure the npc_template_maker normally with the antlion in the template and then add the following output:  
    >  OnSpawnNpc, (your antlion), Unburrow
    
    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.

After which, @samm5506-legacy (samm5506) added

    [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.

@anon41658148 replied

    samm5506:
    
    > [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.

To which @Rubat (Rubat) replied

    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”.

Then @anon41658148 said

    Robotboy655:
    
    > 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.

So @Jeezy-legacy (Jeezy) replied

    Wouldn't it be Unburrow?

So @anon41658148 replied

    Jeezy:
    
    > Wouldn't it be Unburrow?
    
    Still doesn't work, although you're right.

After which, @Rubat (Rubat) added

    You are doing it wrong. Show your code.

To which @anon41658148 replied

    [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.

@Rubat (Rubat) replied

    You gotta fire the input after you spawn it.

After which, @anon41658148 added

    Robotboy655:
    
    > You gotta fire the input after you spawn it.
    
    I tried that as well no joy.

So @Jeezy-legacy (Jeezy) replied

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


{'source': 'discourse', 'url': 'https://forum.facepunch.com/t/unborrow-flag-antlion-guard-on-spawn/159271', 'title': 'Unborrow Flag - Antlion Guard on Spawn', 'views': 550, 'has_accepted_answer': False, 'word_count': 501, 'like_count': 0, 'reply_count': 11, 'participant_count': 4, 'posts': 12, 'tags': '', 'author': '@anon41658148', 'participants': '@anon41658148, @samm5506-legacy (samm5506), @Rubat (Rubat), @Jeezy-legacy (Jeezy)', 'image_url': [None], 'created_at': '2014-01-25T01:29:49.000Z', 'last_posted_at': '2014-01-25T21:25:59.000Z'}