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

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
    }
  }
}
2 Likes

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

Well it should act like those we place with hands
Kills the owner when it blows up but not any teammates (neither squadmates of owner nor other teammates but only enemies and owner)

1 Like

Btw guys i am going to go test ai tanks again and seek the issue
I will share my findings here (if i find any):

Hi,

Sorry to revive this topic. I managed to get this working for my mod and it’s flawless when testing locally. But when hosted in multiplayer, the placed mines are invisible. What can be done to fix this?

Thanks

This is also the problem i am facing.
I can try fixing it since i know a lot more now

1 Like

Were you able to get anywhere with it?

Sorry my friend, i haven’t got time to investigate the problem
(In fact, i struggle to keep up with my school work that i cannot sleep long enough)