Is it possible to attach an "auto_mg42" or a "zombie_spawn_zone" onto the head of a zombie and how is it done?

I am kind of obsessed with the idea of attach a template to entities so I am attempting to make the zombie mode become more chaotic. I first try to use the following code to stick a custom auto_mg42 onto the zombie.

auto_mg42_head{
  _use:t="auto_mg42"
  team:i=3
  auto_gun_controller__targetTeam:i=1
  interactable:b=no
}
zombie_auto_mg42{
  _use:t="zombie_walk_zombie"
  "attach_decorators__entities:list<eid>"{ 
  }

  "attach_decorators__templates:array"{
    "attach_decorators__templates:object"{
      relativeTm:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [0,0,0]]
      template:t="auto_mg42_head"
      nodeName:t="Bip01 Head"
    } 
}
}

But it clearly wasn’t that simple, was it?

I’m not an expert at attaching stuff to other stuff but i don’t think the auto_mg42 is a decorator.

Why not just give the MG-42 to the armoured_zombie?

I want the zombie to still run at you while the sentey gun on his head shoots you down automatically(i reduced the damage so it is not melting players)
The AI just suck and cant even shoot before they are dead.

Also this is a prove of concept. The thing i actually want is the rally point zombie. It will act as a mobile respawn point while its alive.

I see you didn’t add extends/use base_vehicle_decor. So… When zombie will die then turret will stay on map probably foever.

Would be nice to see more details/info about problems. Well… Anyways I’ll check it a bit later. IIRC your code should work fine.

It just dont appear on the zombie head and no bullets are shot.
So it is successfully attached
Though there are no errors on the log

I used your code, but added base_vehicle_decor to auto_mg42_head. And it works fine? Except that the bullets don’t hit the players and zombies are killed instead. Probably need a bit rotate/move mg42?


You can move/scale it in editor.

But then you need edit attach_decorators__templates. Just need remove any symbol, apply changes and add it again. Sphere nearbly property should be visible:

And then save map → open scene.blk → find your zombie and use him relativeTm.

Well… It still kills zombies sometimes, but works…


I also edit it in mg42:

  auto_gun_controller__targetOffset:p3=0,0,0
  auto_gun_controller__traceTime:r=0.0
1 Like