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

try add this to your turret and any vehicels entity (in entities.blk)

"moveable_obstacle:tag"{
  }
2 Likes

It worked!!
Add the code there is fine enough (I had the code on all 3 entities at first which caused no error somehow)
image

1 Like

I tried using this to create a mine that you can build with the hammer but it disappears after build complete

custom_antipersonnel_mine_preview{
  _use:t="base_animchar_builder_preview"
  animchar__res:t="type_3_mine_char"
  collres__res:t="type_3_mine_collision"
  instantiateTemplate:t="jp_antipersonnel_mine"
  ri_preview__name:t="jp_antipersonnel_mine"
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=3.0
  building_menu__text:t="Anti-personnel Mine"
  building_menu__image:t="killlog/kill_explosion"
  buildingCost:r=1.0
}

How do i properly add a anti-personnel mine (preferably the kill count towards the builder but its not necessary)
1 Like

maybe should be mine+placed item in world

template name not found

1 Like

I tried jp_antipersonnel_mine+placed_item_in_world
But it did not work and throws template incorrect error

1 Like

Yes yes, i am going to investigate now (after finishing the event for gold order ofc)

There no placed_item_in_world and it’s placeable_item_in_world. Any item_in_world postfix templates should work on mines.

It seems that you need to use unique entity with predefined teams.

1 Like

let me try
and is it possible to make the auto_mg42, autocannon and antipersonnel mine kills count towards the builder?

1 Like

Kind of worked but missing stuff…

image

1 Like

image
but if i do this then it only work for team 1

1 Like

image
bruh it even kills my teammate

1 Like

image
Doesn’t help with this.
How can i set owner eid to the builder

1 Like

Weird, because placeable_item__ownerTeam should work. Are you use that you use custom_antipersonnel_mine?

1 Like
custom_antipersonnel_mine_preview{
  _use:t="base_animchar_builder_preview"
  animchar__res:t="type_3_mine_char"
  collres__res:t="type_3_mine_collision"
  instantiateTemplate:t="custom_antipersonnel_mine+placeable_item_in_world"
  ri_preview__name:t="jp_antipersonnel_mine"
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=3.0
  building_menu__text:t="Anti-personnel Mine"
  building_menu__image:t="killlog/kill_explosion"
  buildingCost:r=1.0
}
custom_antipersonnel_mine{
  _use:t="jp_antipersonnel_mine"
  placeable_item__ownerTeam:i=1
  team:i=1
}
1 Like

Works fine?


Are you sure that you use team 1 soldiers?

1 Like

I mean when it blows up it kill you and your teammate
It wont trigger when team 1 walk near but it kills both team

Aah… Well… It’s because that they have friendly fire tag:

  "allow_friendly_damage:tag"{
  }

Here is code without it:

base_custom_mine_item_gun{
  _use:t="melee_weapon"
  _use:t="placeable_item"
  _use:t="base_mine_item_gun_sound"
  _use:t="replicating"
  _use:t="base_hitpoints"
  _use:t="base_dm_parts"
  weap__sprintLerpFactor:r=1.0
  animchar__res:t="antitank_mine_char"
  collres__res:t="antitank_mine_collision"
  animchar_render__enabled:b=yes
  item__template:t="base_mine_item_gun"
  item__weapTemplate:t="base_mine_item_gun"
  item__name:t="items/antitank_mine"
  item__weapType:t="mine"
  item__weight:r=0.5
  melee_weapon__blk:t="content/enlisted/gamedata/weapons/building_tool_gun.blk"
  gun__locName:t="antitank_mine"
  gun__reloadable:b=no
  _tracked:t="gun__owner"
  _tracked:t="mine__activated"
  _tracked:t="mine__blockedToTime"
  _replicated:t="gun__owner"
  _replicated:t="mine__activated"
  _replicated:t="mine__blockedToTime"
  mineActivatorTemplate:t="antipersonnel_mine_activator"
  mine_activator__offset:p3=0.0, 0.15, 0.0
  activationRadius:r=1.5
  mine__installBlockTime:r=5.0
  mine__blockedToTime:r=-1.0
  mine__activated:b=no
  nextCheckTriggerAtTime:r=-1.0
  checkTriggerInterval:r=0.1
  material:t="steel"
  needsBlood:b=no
  meleeSoundType:t=""
  hitpoints__hp:r=10.0
  hitpoints__maxHp:r=10.0
  hitpoints__hpRecoverySpd:r=0.0
  hitpoints__hpThreshold:r=0.0
  hitpoints__stoppingPower:r=0.0
  hitpoints__shellDmgMult:r=0.075
  hitpoints__shellSplashDmgMult:r=0.075

  "disableDestroyWithRi:tag"{
  }

  "build_attach__riexHandle:u64"{
    value:i64=-1
    _tags:t="server"
  }

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

  "itemInWeaponSlot:tag"{
  }

  collres{
  }

  "gun__owner:eid"{
  }

  "net__notInInitialScope:tag"{
  }

  "specialWeapItem:tag"{
  }

  "disableMelee:tag"{
  }

  "mine_activation_zone__initEids:list<eid>"{
  }

  "engeneer_mine:tag"{
  }

  "dm_parts__parts:object"{

    "mine_b_collision04:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }

    "mine_b_collision05:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }

    "mine_b_collision06:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }
  }

  "killer:eid"{
  }

  _group{
    ui__geom_node_idx:i=-1
    ui__node_pos:p3=0.0, 0.0, 0.0
    ui__geom_node_name:t="weaponRoot"
    _tags:t="ui"
  }

  "animchar__noUpdateOnDedicated:tag"{
  }
}

custom_antipersonnel_mine_item_gun{
  _use:t="base_custom_mine_item_gun"
  animchar__res:t="sprengmine_35_char"
  collres__res:t="sprengmine_35_collision"
  mineActivatorTemplate:t="antipersonnel_mine_activator"
  melee_weapon__blk:t="content/enlisted/gamedata/weapons/mines/antipersonnel_mine_item_gun.blk"
  gun__locName:t="antipersonnel_mine"
  item__name:t="items/antipersonnel_mine"
  item__template:t="antipersonnel_mine_item_gun"
  item__weapTemplate:t="antipersonnel_mine_item_gun"
  item__mineType:t="antipersonnel_mine"
  item__weight:r=4.0
  activationRadius:r=1.4
  shell_explosion_fx__infoTemplate:t="hit_effect_group_antipersonel_mine_explosion"
  shell__waterImpactFx:t="hit_water_medium_effect"

  "ui__placeableItemMarker:tag"{
    _tags:t="ui"
  }

  "mine_activation__delay:r"{
    _tags:t="server"
    value:r=0.5
  }

  "vehicleTriggerable:tag"{
  }

  "humanTriggerable:tag"{
  }

  "dm_parts__parts:object"{

    "volumeBox_1:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }

    "volumeBox_2:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }
  }
}

jp_custom_antipersonnel_mine{
  _use:t="custom_antipersonnel_mine_item_gun"
  animchar__res:t="type_3_mine_char"
  collres__res:t="type_3_mine_collision"
  melee_weapon__blk:t="content/enlisted/gamedata/weapons/mines/jp_antipersonnel_mine.blk"
  item__template:t="jp_antipersonnel_mine"
  item__weapTemplate:t="jp_antipersonnel_mine"
  placeable_item__additionalHeight:r=0.015
  item__weight:r=4.0

  "dm_parts__parts:object"{

    "volumebox_01:object"{
      dmgMult:r=1.0
      armor:r=0.0
    }
  }
}
1 Like

I can never get these codes correct without you

Nope it still kills teammate

it should only kills who destroy it? just like grenades kills who throw it

1 Like