Is it possible to build an AI tank that shoots zombie ai tanks and zombies with engineer hammer?

Is it possible to build an AI tank (no path finding needed as it should not move) that shoots zombie ai tanks and zombies with an engineer’s hammer?
I want to like build some kind of tower defense zombie map with friendly AI Pz 4 tanks vs something like Shermans and Stuarts

I’m not sure that currently tank ai can properly target to another tanks. But yeah… You can do tower defense against zombies. You can build these Unknown War/Moon turrets that will shoot to enemies. You also can change animchars for them, but keep in mind that you need also edit nodes names in some node properties.

1 Like

Well i am very tired of those stupid turret that attempt to shoot through a wall and destroy everything. Imagine you got a sandbag wall and a zombie happens to be near it, and then your sabdbag wall just get deleted.

I want to ask if i am able to build a tank vehicle and i think it is possible to force the vehicle to be spawned with crews.

At the very least i want to ask that how i can construct a tank with the hammer. Like are there code samples that you have see before?

Currently I can’t test, but I think you can try to do code similar to gaz_67 that I post in another post. Also using code that you removed for ai tanks will allow you fill tank with ai soldiers (_use:t=“ai_aircraft_crew_ger” will add ger soldiers with team 2 if you didn’t edit ai_aircraft_crew__soldier_template).

1 Like

Oh good
I removed it because it duplicates the crew. I think the zombie tank spanwer thingy just have internally added crews to the tank. Some tanks like m13 mgmc and ta-se still have visible (and shootable) crew without your code.

Seen that before but couldn’t find it so i asked. Thx for your information. I will return the results once it is tested

@Devenddar and anyone seeing this:


In the photo above there are 2 tanks. The Ha-Go is in the trench line, which is a zombie tank i used in other maps. And then the selected one is the ai tank i built with hammer. Its turret moves and it will shoot back at enemies. But only if they attack it

By attacking, i mean harming the gunner who would then get angry at the ha-go and then the ha-go will be evaporated.:slight_smile:

Is there something i did wrong which made the gunner only attack passively? As i said, the tank dont need to move (well if it knows how to angle by default, i wont complain that, but its also not compulsory)


I know that i am missing something because the ha-go is actively (attempting) to kill its enemy.


oh wow never mind, i just lacked patience!
They do afk a lot but when they stop afking, they are as accurate as the ha-gos
The conclusion is that you just need to remove the zombie tag from the ai tank(so that it dont hold the wave when you build one) and its fine already

1 Like

For your interest, the codes are as follows:

// Tank building tool
tank_building_tool_1{
  _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="tertiary"
  }
  "buildingTool:tag"{
  }
  "itemInWeaponSlot:tag"{
  }
  "previewEid:eid"{
}
}
tank_building_tool_1_gun{
  _use:t="tank_building_tool_1"
  _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="tank_building_tool_1_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="pz3n_preview"
  }

  "buildingLimits:list<i>"{
    limit:i=3
  }
}
tank_building_tool_1_item{
  _use:t="item_melee"
  _use:t="tank_building_tool_1_gun"
  collres__res:t="construction_hammer_collision"
  item__userstats__pickupName:t="pickup_building_tool"
}
pz3n_preview{
  _use:t="base_animchar_builder_preview"
  animchar__res:t="pzkpfw_III_ausf_N_char"
  collres__res:t="pzkpfw_III_ausf_N_collision"
  instantiateTemplate:t="germ_pzkpfw_III_ausf_N_ai_vehicle_tank_defense"
  avaliableAngles:p2=-30.0, 30.0
  buildingSoundTag:t="cannon"
  building_menu__text:t="Panzer III N"
  building_menu__image:t="map_icon_tank"
  building_builder__maxTimeToBuild:r=1.0
  building_builder__maxUnderwaterDistance:r=0.5
  requiredSpaceAboveObjectOffset:r=0.5
  requiredSpaceAboveObject:r=5.0
  buildingDistance:r=3.5
  buildingCost:r=5.0
  savePreviewTeam:b=yes
}
//Pz3N
germ_pzkpfw_III_ausf_N_ai_vehicle_tank_defense{
  _use:t="ai_aircraft_crew_ger"
  
  _use:t="ai_vehicle_tank_fixed_objective"
  _use:t="germ_pzkpfw_III_ausf_N_tunis_premium"
  ai_aircraft_crew__soldier_template:t="zombie_ai_vehicle_tank_crew_member"

  bodyCleanupTime:r=5.0 
 
  vehicle_seats__restrictToTeam:i=1

  "dontCreateNphysObstacle:tag"{
  }

  
  destroyIfNoCrewLeft:b=yes
  
  _group{
    _tags:t="server"
    ai_vehicle_tank__allowCrewExiting:b=no
    zombie_ai_vehicle_tank__timeToDestroy:r=900.0
    zombie_ai_vehicle_tank__destroyAtTime:r=0.0
    ai_vehicle_tank__ignoreBattleArea:b=yes
  }

"vehicle_seats__seats:shared:array"{
    "seats:object"{
      name:t="driver"
      locName:t="vehicle_seats/driver"
      seatOwnsEntityControl:b=yes
      attachNode:t="driver"
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.25, -0.25, 0.0]]
      seatComponent:t="isDriver"
      nextSeat:t="main_gunner"
      shouldHideOwner:b=yes
      receiveDamageFromDMPart:t="driver"
      cameraNodeName:t="bone_camera_driver"
      cameraOffset:p3=0.15, -0.0, -0.0
      cockpitTemplate:t="germ_pzkpfw_III_ausf_N_driver_cockpit"
    }
    "seats:object"{
	  directTurretControl:b=yes
      name:t="main_gunner"
      locName:t="vehicle_seats/gunner"
      attachNode:t="gunner"
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.25, -0.5, 0.0]]
      seatComponent:t="isGunner"
      nextSeat:t="driver"
      shouldHideOwner:b=yes
      receiveDamageFromDMPart:t="gunner"
      cameraNodeName:t="bone_camera_gunner"
      cockpitTemplate:t="germ_pzkpfw_III_ausf_N_gunner_cockpit"

      "turretNames:array"{
        turret:t="turret_01"
		turret:t="turret_02"
      }
    }

    

    "seats:object"{
	  directTurretControl:b=yes
      name:t="commander"
      locName:t="vehicle_seats/commander"
      attachNode:t="commander"
      shouldHideOwner:b=yes
      maxPosWithOpenHatch:r=1.2
      hatchRotationAxis:p3=1.7, 0.0, 0.0
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.1, -0.4, 0.05]]
      seatComponent:t="isDriver"
      receiveDamageFromDMPart:t="commander"
      cameraNodeName:t="bone_turret"
      cockpitTemplate:t="germ_pzkpfw_III_ausf_N_commander_cockpit"

      "hatchNodes:array"{
        node:t="hatch_01"
      }

      "TurretNames:array"{
        turret:t="turret_03"
      }
    }
	
	"seats:object"{
      attachNode:t="loader"
      locName:t="vehicle_seats/loader"
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.25, -0.5, 0.0]]
      seatComponent:t="isPassenger"
      shouldHideOwner:b=yes
      receiveDamageFromDMPart:t="loader"
      cameraNodeName:t="bone_camera_driver"

      "loaderTurretNames:array"{
        turret:t="turret_01"
      }
    }

    "seats:object"{
	  directTurretControl:b=yes
      name:t="main_gunner"
      locName:t="vehicle_seats/radioman"
      attachNode:t="machine_gunner"
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.25, -0.5, 0.0]]
      seatComponent:t="isPassenger"
      nextSeat:t="driver"
      shouldHideOwner:b=yes
      receiveDamageFromDMPart:t="machine_gunner"
    }

    
    }
}


pzkpfw_iii_ausf_n_turret_01_75mm_kwk37{
  _override:b=yes

  _group{
    _tags:t="server"
    tank_turret_ai__maxBurstCount:i=0
    tank_turret_ai__longPauseWaitTime:r=0.0
    tank_turret_ai__attackDist:r=100.0
  }
}

pzkpfw_iii_ausf_n_turret_02_7_92mm_mg34{
  _override:b=yes

  _group{
    _tags:t="server"
    tank_turret_ai__maxBurstCount:i=150
    tank_turret_ai__longPauseWaitTime:r=0.0
    tank_turret_ai__attackDist:r=100.0
  }
}

pzkpfw_iii_ausf_n_turret_03_7_92mm_mg34{
  _override:b=yes
  _group{
    _tags:t="server"
    tank_turret_ai__maxBurstCount:i=150
    tank_turret_ai__longPauseWaitTime:r=0.0
    tank_turret_ai__attackDist:r=100.0
  }
}
1 Like

But still @Devenddar, they dont bother attacking zombies. Why??
Do they lack the AI to target enemies since the aircraft crew just afk when their tank got destroyed

Probably. Or maybe it’s because of tank. Currently time I don’t know. I didn’t test enough with ai and ai tanks. Try to check some properties? Maybe some of them will change reaction speed or e.t.c… It also may happends because of crew. Try to use zombie crew, but with different team. Maybe it will work?

After all… Well… As you know… AI tanks unfinished yet. And better to wait when they will be officially added to game.

1 Like

entities.txt (181.6 KB)
scene .txt (51.1 KB)
The files are here so that you can test them easily

If that was going to happen lol. And better to be Soon™

1 Like

Well it wont work if they themselves have the zombie tag because it will stall the waves. But i will look into them shortly

Edit: I lied, it wont stall rounds with zombie tag


zombie_spawn_mode only recognize the 20 zombie_walk_zombie but not the 5 tank crew (I have built 1 tank). Apparently, the zombie tag is needed on the tank itself (which i did not add).

I just noticed an interesting tag on zombie_ai_vehicle_tank_crew_member:
image
But missing in zombie_walk_zombie


But present in base_zombie_armored_soldier (photo below is 3 samurai got melted)
image

Fix is add this to nzombie_base:

"targetForTankAiGunner:tag"{
   }
1 Like

There we go. EZ
image

1 Like

@Devenddar There is a problem. If the gunner cannot see the tank from his cockpit view, he wont target the tank. How can i solve that, to allow the gunners to have like wall hacks

Maybe he don’t target to tank, because enemies are hidden (in seats code)?

Try to edit camera properties. Also you can try to remove cockpit in seat code?


I am testing thing but i finally made the hatch turret work accidentally


    "seats:object"{
	  directTurretControl:b=yes
      name:t="commander"
      locName:t="vehicle_seats/commander"
      attachNode:t="commander"
      shouldHideOwner:b=yes
      maxPosWithOpenHatch:r=1.2
      hatchRotationAxis:p3=1.7, 0.0, 0.0
      ignoreAttachNodeRotation:b=yes
      attachTm:m=[[1.0, 0.0, 0.0] [0.0, 1.0, 0.0] [0.0, 0.0, 1.0] [-0.1, -0.4, 0.05]]
      seatComponent:t="isDriver"
      receiveDamageFromDMPart:t="commander"
      //cameraNodeName:t="bone_turret"
      //cockpitTemplate:t="germ_pzkpfw_III_ausf_N_commander_cockpit"

      "hatchNodes:array"{
        node:t="hatch_01"
      }

      "turretNames:array"{
        turret:t="turret_03"
      }
    }

I changed hatchTurretNames:array to turretNames:array in the commander seat code (it wasn’t working before because i forgot to make the first character a small letter (and it was TurretNames:array which did not work))

1 Like


Bruh i was wondering why i could not change the attack distance with my code below

turret_ai__attackDist:r=50.0

apparently, the devs misspelled “attack” lmao

1 Like