Is it possible to make the engineer's hammer and resources buyables like guns

I am thinking it would be fun if people can build sentry guns (i.e. auto_mg42 entity) in my zombie map but there are a few problems.

  1. The ability to carry 2 weapons would not be possible (if i edit player profile normally to put hammer)
  2. Resources will deplete and no way to get more
  3. I don’t know how exactly i can remove the default things in the build menu(because sandbags and barbed wire will break navmesh of zombies) and add auto_mg42 (i have read the older posts but those don’t work anymore)

Does anyone know how i can do that

1 Like

(because sandbags and barbed wire will break navmesh of zombies)

It won’t break the navmesh. The navmesh is generated before building these obstacles and it won’t affect navmesh. You can simply place the building hammers down like with zombie weapons with (+paid_loot_item) postfix.

The ability to carry 2 weapons would not be possible

All weapons use entity main_weap_slots . If you override that you should be able to equip a weapon to any slot.

main_weap_slots{
 _override:b=yes
  "item__weapSlots:array"{
    slot:t="primary"
    slot:t="secondary"
   slot:t="melee"
  slot:t="tertiary"
//you could add grenade slot too but not recommended:  slot:t="grenade"

  }
}

Resources will deplete and no way to get more

There are multiple ways to do this, you can set the perk which gives the player extra building resources to a very high number is custom profiles OR

You can set the limit for a buildable to a very high number. Remove the lines with it’s limit to remove it from the buildable list.

ussr_building_tool_gun{ 
  _override:b=yes
  _use:t="building_tool_gun"
  item__weapTemplate:t="ussr_building_tool_gun"
  item__template:t="ussr_building_tools_item"

  "previewTemplate:list<t>"{
    template:t="ussr_rallypoint_preview"
    template:t="ammunition_box_a_preview"
    template:t="czech_hedgehog_a_preview"
    template:t="barbedwire_engineer_a_preview"
    template:t="sandbags_wall_2_preview"
    template:t="cannon_ussr_25mm_72k_preview"
    template:t="cannon_ussr_towed_at_pak40_preview"
    template:t="sandbags_wall_maxim_no_shield_preview"
    template:t="sandbags_wall_dshk_1942_preview"
    template:t="sandbags_wall_ampulomet_preview"
  }

  "buildingLimits:list<i>"{
    limit:i=1 //how many times you can build a buildable
    limit:i=3
    limit:i=6
    limit:i=10
    limit:i=10
    limit:i=2
    limit:i=1
    limit:i=1
    limit:i=1
    limit:i=1
  }
}
3 Likes

Is it possible to “buy resources” like item
I mean paid_loot_item cannot trigger things like doors or barricades (i mean we cant resemble the door unlock we have in COD zombies) so non-item stuff(such as building resources) cant be modified?

Anyways thank you for your help. It will be released on the next update of my map (i am not leaving until i have fix the ai tank crashing server issue)

1 Like

Not currently, but we do have a refrigerator with similar functionality in CRSED. . .

Before they import CRSED things to Enlisted.

You may probably make something like this a workaround, such as getting a medkit box gun that can be placed on the ground and then limiting the number of times it can be used or how long it lasts in a scene.


But personally, I recommend simply letting players obtain resources unlimited times through a chest or device (usually they can’t survive for too long)



I recommend using moon turret, it may have better performance and performance

Nevermind, in my map, players can die so their stuff get reset

1 Like

Moon turret?? Huh thats interesting, i haven’t join this community when moon was out so I did not know
I joined right before titan rise

1 Like

builded_auto_turret

Basically it shares similar logic to aircraft carrier turrets.

You need to add ai_target__targetForAiGunner tag to your zombie

"ai_target__targetForAiGunner:tag"{
   }

But I’m not sure if it will work well when there are too many zombies, generally speaking it is more natural when switching targets than auto_mg42

3 Likes

auto_mg42 fires at thin air when no targets and the whole mechanism is kind of weird
I might add both of them but with different building time
Thanks for the answers guys

2 Likes

Erm the target part works but there are 2 problems

  1. It tries to shoot zombies through the wall and spam my log with this error

  2. The bullet it shoots is weaker than peas (i.e. doing 0 damage and 0 stopping power)

1 Like

Btw it is impossible to drop the construction hammer after i have picked it up
Is there a tag of some sort that can be disabled?

you can change its ammo

I couldn’t find the ammo that i can modify, can you show me how?
And that error might indicate that a navmesh is missing from the loadExtraNavMesh thingy in the level (just like with tank navmesh)

assign or make a new turret for it use turret_control__turretInfo or use turretsInitialComponents to patch it

"turret_control__turretInfo:shared:array"{
    "turret_control__turretInfo:object"{
      turretName:t="turret_01"
      gun:t="builded_sg_gun+tankgun_25mm_72k"
   }
}

not formatted …

"turretsInitialComponents:array"{
    "turretsInitialComponents:object"{
        "gun__ammoSetsInfo:shared:array"{

    "defaultSet:array"{

      "shell:object"{
        blk:t="gamedata/gen/weapons/shells/25mm_72k_defaultset_bullet_1.blk"
        name:t="25mm_br_132"
        type:t="ap_t"
      }

      "shell:object"{
        blk:t="gamedata/gen/weapons/shells/25mm_72k_defaultset_bullet_2.blk"
        name:t="25mm_ozr_132"
        type:t="frag_i_t"
      }
    }
}
    }
}
2 Likes

i guess you may have to make a new turret entity to get rid of this error maybe need some test

2 Likes

Yeah. Engineer tools just not visible in weapons/equipment/other items, but you can find it in all and add +item_in_world before creating it (need to use with _item in name).
image
Box with resources works fine if you add medkit paid loot. Here is scene code:

entity{
  _template:t="base_fortification_build+tutorial_engineer_resource_box+paid_medkit_box_use+undestroyable_ri_extra+"
  transform:m=[[-1, 0, -8.74228e-08] [0, 1, 0] [8.74228e-08, 0, -1] [-503.122, 48.3202, 2195.38]]
  ri_extra__name:t="ammunition_box_piles_f"
  useful_box__maxUseCount:i=999999
  animchar_render__enabled:b=no
  paid_box__ressuplyCost:i=125
  useful_box__uiPrice:i=125
  builder_info__team:i=1
  buildingRadius:r=1
  team:i=1
}

Or… Just write +tutorial_engineer_resource_box+paid_medkit_box_use+undestroyable_ri_extra in Template Postfix and create base_fortification_build.

Need to remove tag. In other words… Recreate entities. Here is code:

test_building_tool{
  _use:t="melee_weapon"
  builder__shootPressed:b=no
  nextTryToSetObjectInTime:r=-1.0
  autoTryBuildingObjectInterval:r=3.0
  engineerBuildingSpeedMul:r=2.0
  gun__reloadable:b=no
  animchar__res:t="hammer_char"
  item__iconYaw:r=145.0
  item__name:t="items/building_tool"
  meleeSoundType:t="buildingTool"
  _tracked:t="previewEid"

  "item__weapSlots:array"{
    slot:t="secondary"
  }

  "buildingTool:tag"{
  }

  "itemInWeaponSlot:tag"{
  }

  "previewEid:eid"{
  }
}

test_building_tool_gun{
  _use:t="test_building_tool"
  _use:t="replicating"
  _tracked:t="gun__owner"
  _replicated:t="gun__owner"
  _replicated:t="currentPreviewId"
  buildingInterval:r=0.0
  nextBuildingAtTime:r=0.0
  additionalBuildingTemplate:t="network_fortification_preview"
  currentPreviewId:i=0
  fortification__rayMatId:i=-1
  fortification__rayMatName:t="engineerRay"
  minBuildingRadius:r=1.5
  animchar__res:t="hammer_char"
  gun__blk:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  gun__canAim:b=no
  item__template:t="test_building_tools_item"
  animchar_render__enabled:b=yes
  item__proto:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  item__weapTemplate:t="test_building_tool_gun"
  item__iconRoll:r=43.0
  item__iconYaw:r=0.0
  item__iconPitch:r=83.0
  item__name:t="items/hammer"
  item__weapType:t="building_tool"
  item__weight:r=0.5
  melee_weapon__blk:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  gun__locName:t="Hammer"
  gun__statName:t="melee"
  gun__reloadable:b=no
  weap__sprintLerpFactor:r=1.0
  melee_weapon__attackAt:r=0.4
  melee_weapon__attackTime:r=1.0

  "item__id:i"{
    value:i=0
    _hide:b=yes
  }

  "gun__owner:eid"{
  }

  "net__notInInitialScope:tag"{
  }

  "previewTemplate:list<t>"{
    template:t="ger_rallypoint_preview"
    template:t="ammunition_box_a_preview"
    template:t="czech_hedgehog_a_preview"
    template:t="barbedwire_engineer_a_preview"
    template:t="sandbags_wall_2_preview"
    template:t="cannon_germ_20mm_flak38_preview"
    template:t="cannon_ussr_towed_at_53k_preview"
    template:t="cannon_germ_towed_at_pak38_preview"
    template:t="sandbags_wall_mg_preview"
  }

  "buildingLimits:list<i>"{
    limit:i=1
    limit:i=3
    limit:i=6
    limit:i=10
    limit:i=10
    limit:i=2
    limit:i=1
    limit:i=1
    limit:i=1
  }
}

test_building_tools_item{
  _use:t="item_melee"
  _use:t="test_building_tool_gun"
  collres__res:t="construction_hammer_collision"
  item__userstats__pickupName:t="pickup_building_tool"
}
2 Likes

Thank you @Devenddar , the lord and savior of this community

1 Like

find_vehicle_obstacles: nav obstacle without tile cache enabled
This error still happens with @tommyZZM 's codes added
It happens when the builded_auto_turret tries to shoot zombies through a wall or floor
Also the turret always aim higher than the target after adding the code
Maybe need to ask @Devenddar how to fix both issues

1 Like

It blows my mind that this still works


I changed _extends to _use as i have read before on other posts

1 Like

My code is here. It kind of works for my zombie map. (except the nav error that the moon turret throws)

// Engineer's hammer section
// Forum post: https://forum.enlisted.net/en/t/142979/ (Thank you! @Bazsi37 @tommyZZM @Devenddar)

test_building_tool{
  _use:t="melee_weapon"
  builder__shootPressed:b=no
  nextTryToSetObjectInTime:r=-1.0
  autoTryBuildingObjectInterval:r=3.0
  engineerBuildingSpeedMul:r=2.0
  gun__reloadable:b=no
  animchar__res:t="hammer_char"
  item__iconYaw:r=145.0
  item__name:t="items/building_tool"
  meleeSoundType:t="buildingTool"
  _tracked:t="previewEid"

  "item__weapSlots:array"{
    slot:t="secondary"
  }

  "buildingTool:tag"{
  }

  "itemInWeaponSlot:tag"{
  }

  "previewEid:eid"{
  }
}

test_building_tool_gun{
  _use:t="test_building_tool"
  _use:t="replicating"
  _tracked:t="gun__owner"
  _replicated:t="gun__owner"
  _replicated:t="currentPreviewId"
  buildingInterval:r=0.0
  nextBuildingAtTime:r=0.0
  additionalBuildingTemplate:t="network_fortification_preview"
  currentPreviewId:i=0
  fortification__rayMatId:i=-1
  fortification__rayMatName:t="engineerRay"
  minBuildingRadius:r=1.5
  animchar__res:t="hammer_char"
  gun__blk:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  gun__canAim:b=no
  item__template:t="test_building_tools_item"
  animchar_render__enabled:b=yes
  item__proto:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  item__weapTemplate:t="test_building_tool_gun"
  item__iconRoll:r=43.0
  item__iconYaw:r=0.0
  item__iconPitch:r=83.0
  item__name:t="items/hammer"
  item__weapType:t="building_tool"
  item__weight:r=0.5
  melee_weapon__blk:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  gun__locName:t="Hammer"
  gun__statName:t="melee"
  gun__reloadable:b=no
  weap__sprintLerpFactor:r=1.0
  melee_weapon__attackAt:r=0.4
  melee_weapon__attackTime:r=1.0

  "item__id:i"{
    value:i=0
    _hide:b=yes
  }

  "gun__owner:eid"{
  }

  "net__notInInitialScope:tag"{
  }

  "previewTemplate:list<t>"{
    template:t="auto_mg42_preview"
	template:t="builded_auto_turret_preview"
    template:t="christmas_tree_preview"
    //template:t="ammunition_box_a_preview"
    //template:t="czech_hedgehog_a_preview"
    //template:t="barbedwire_engineer_a_preview"
    //template:t="sandbags_wall_2_preview"
    //template:t="cannon_germ_20mm_flak38_preview"
    //template:t="cannon_ussr_towed_at_53k_preview"
    //template:t="cannon_germ_towed_at_pak38_preview"
    //template:t="sandbags_wall_mg_preview"
  }

  "buildingLimits:list<i>"{
    limit:i=1
	limit:i=1
    limit:i=3
    
  }
}

test_building_tools_item{
  _use:t="item_melee"
  _use:t="test_building_tool_gun"
  collres__res:t="construction_hammer_collision"
  item__userstats__pickupName:t="pickup_building_tool"
}

auto_mg42{
  _override:b=yes
  team:i=1
  auto_gun_controller__targetTeam:i=3
  auto_gun_controller__targetOffset:p3=0, 0, 0
  interactable:b=no
  "ai_target__targetForAiGunner:tag"{
   }
}
auto_mg42_preview{
  _use:t="base_animchar_builder_preview"
  animchar__res:t="mg42_char"
  collres__res:t="mg42_collision"
  instantiateTemplate:t="auto_mg42"
  ri_preview__name:t="auto_mg42"
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=20.0
  building_menu__text:t="Sentry Gun 42"
  building_menu__image:t="machine_gun"
}
auto_mg42{
  _use:t="game_rendinst_decor"
  ri_extra__name:t="auto_mg42"
}

builded_auto_turret_preview{
  _override:b=yes
  building_builder__maxTimeToBuild:r=20.0
  building_menu__text:t="Sentry Gun 42"
  building_menu__image:t="assault_rifle"
}
builded_sg_gun{
  _override:b=yes
  gun__kineticDamageMult:r=20.0
}
//

The following code fixes the moon turret’s 0 damage issue

builded_sg_gun{
  _override:b=yes
  gun__kineticDamageMult:r=20.0
}
1 Like

I don’t know. But I’ll recheck later.

1 Like