Item Spawners

I found an instance of the item spawner entity in one of the older mission BLKs. This can be used to create massive number of pickupable weapons at spawn much easier. It also doesn’t tank FPS.

syntax and example:

entity{
  _template:t="item_spawner"
  transform:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [93.7644, 114.25, 546.82]]
  spawnItemStep:p3=0, 0, 0

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="stg_44_gun_item+item_in_world"
      count:i=100
    }
  }
}

spawnItemStep defines the direction it will place down the items. X,Y,Z respectively.

For tanks
entity{
  _template:t="item_spawner"
  transform:m=[[-1, 0, -1.06581e-14] [0, 1, 0] [1.06581e-14, 0, -1] [86.8096, 114.25, 357.263]]
  spawnItemStep:p3=0, 0, 6

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="germ_sdkfz_251_10+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_sdkfz_234_2+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_III_ausf_N+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_III_ausf_L+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_III_ausf_M+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_IV_ausf_J+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_IV_ausf_J_L42+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_panzerbefelhswagen_IV_ausf_J+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_stug_III_ausf_G+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_IV_ausf_H+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_panzerjager_IV_L_48+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_V_ausf_a_panther+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_pzkpfw_VI_ausf_E_tiger+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="germ_jagdpanther+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="uk_sherman_ic_firefly+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m4a3e2_76w_sherman_jumbo+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m18_hellcat+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m4a1_76w_sherman+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m10_wolverine+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="uk_cromwell_5+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m4a3e2_sherman_jumbo+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m4a2_sherman_1944+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m24_chaffee+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m8_scott+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m8_greyhound+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m5a1_stuart_late+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m5a1_stuart_late_carol_skin_td+dm_debug"
      count:i=1
    }

    "spawnItemList:object"{
      templ:t="us_m5a1_stuart_late_td+dm_debug"
      count:i=1
    }
  }
}

7 Likes

really great to make armories :smiley:

( instead of copying and pasting one single item on top of each other that will make fps worse. which i did :upside_down_face: )

2 Likes

alright so, i made my own armory:

but, i had a few issue.
and i was wondering if it’s possible to make the game / editor recognize that those weapons belongs to a team. so that, everytime players will pick up a weapon, the ammo box constructed by an engineer will allow any players to replenish their ammunition for that said picked up gun.

i also followed @Devenddar great findings to combine the two and eventually release it also on this thread as an advice for everyone, but i couldn’t make it work.

and here is the code:

entity{
  _template:t="item_spawner"
  transform:m=[[-4.37114e-08, -1, -4.37114e-08] [0, -4.37114e-08, 1] [-1, 4.37114e-08, 1.91069e-15] [1579.77, 13.1997, 1623.55]]
  spawnItemStep:p3=0, 0, 0
  team:i=2

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="stg_44_gun_item+item_in_world"
      count:i=60
    }

  "customProps:object"{
    "initialComponents:object"{
      item__ownedByTeam:t="2"
    }
  }
}

though, makes the editor crash.
so my questions are, is my syntax wrong? did i missed some important keys? or it just straight up does not work? / not duable.

because it would be a pity.

( btw, despite my old comment:

fps are still an issue. but that’s whatever.

1 Like

Looks nice. I’m too working on it.
But after that I found way how to edit properties I prefer to do more by manual way.

Not sure. Looks like missing one } in end.
But anyways… As i know it’s not possible to edit properties in item_spawner.

And about refillable ammo from boxes… It’s not only about item__ownedByTeam.
It’s also gun__numReserveAmmo and gun__reserveAmmoTemplate.
If they didn’t set then will be automatically set by game.
And usually they’re wrong.

1 Like

i know.

which, my first ever armory that i did, was essentially spamming one rilfe onto another in one position.
( which you can still see in the gavutu mission file that i sent you )

so, right now, would be really time consuming and straight up boring having to replace one by one rifle and include the InitialComponents one by one. :upside_down_face: :gun:

the other issue that i have with manual placing, are that:

  • they take alot of space both in the blk text chunk and physical ( or rather, digital ) space in the scene if for example, you have more than 5 types of weapons when you can instead use a spawner that will save you both spaces

  • Number Limits
    which also correlate with the first issue. i can’t have the same ammount of rifles like a spawner.

so, at least for me, where people do not have all type of guns for one reason or another ( due being extreame grind needed or the gun it self not being present in the campaign for example, an mp34 in berlin/tunisia/Stalingrad/Moscow etc )

where

gosh darnit.

1 Like

Try it:

entity{
  _template:t="item_spawner"
  transform:m=[[-4.37114e-08, -1, -4.37114e-08] [0, -4.37114e-08, 1] [-1, 4.37114e-08, 1.91069e-15] [1579.77, 13.1997, 1623.55]]
  spawnItemStep:p3=0, 0, 0
  team:i=2

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="stg_44_gun_item+item_in_world"
      count:i=60
    }

    "customProps:object"{
      "initialComponents:object"{
        item__ownedByTeam:t="2"
      }
    }
  }
}

You tried put customProps inside spawnItemList? Then yes. You maybe miss one poor }.
Else you forgot } after spawnItemList.

1 Like

well, i did missed the:

thank you god of the forum for pointing that out.

because i know nothing about coding and stuff so…

yeah, i wouldn’t have got it in a milion years.

so… it does start.

though, unfortunately it still does not replanish ammo from the logistic truck nor constructed ammo cache.

like, it does, but the number is still at 0.

maybe it’s because as you correclty mentioned, i was missing and i am missing the GUN__[…] parts.

i’ll give an update if it will work or still won’t work.

for the moment, thanks :slight_smile:

1 Like

update. unsuccessful.

unfortunately, it does not work for whatever reason.

it still won’t refill ammo despite having the correct Gun__[…] parts:

entity{
  _template:t="item_spawner"
  transform:m=[[-4.37114e-08, -1, -4.37114e-08] [0, -4.37114e-08, 1] [-1, 4.37114e-08, 1.91069e-15] [1579.77, 13.1997, 1623.55]]
  spawnItemStep:p3=0, 0, 0
  team:i=2

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="stg_44_gun_item+item_in_world"
      count:i=60
    }

  "customProps:object"{
    "initialComponents:object"{
      gun__reserveAmmoTemplate:t="stg_44_magazine"
      item__ownedByTeam:t="2"
      gun__numReserveAmmo:t="30"
      }
    }
  }
}
1 Like

What if… customProps outside from spawnItemList box?
Try this?

entity{
  _template:t="item_spawner"
  transform:m=[[-4.37114e-08, -1, -4.37114e-08] [0, -4.37114e-08, 1] [-1, 4.37114e-08, 1.91069e-15] [1579.77, 13.1997, 1623.55]]
  spawnItemStep:p3=0, 0, 0
  team:i=2

  "customProps:object"{
    "initialComponents:object"{
      gun__reserveAmmoTemplate:t="stg_44_magazine"
      item__ownedByTeam:t="2"
      gun__numReserveAmmo:t="30"
      }
    }

  "spawnItemList:array"{
    "spawnItemList:object"{
      templ:t="stg_44_gun_item+item_in_world"
      count:i=60
    }
  }
}

I dunno. But looking to team… I think maaaaaybe around 0.01% change that it will works if put customProps nearbly with team?

unfortunately, it does not work either:


( emptied the whole ammo box but still no bullets )

1 Like

Awww… Sad. Then seems currently time you can’t transfer properties from item_spawner to spawned items.

1 Like

That looks very nice, it has a vibe to it :smiley: Using animChar as a shopkeeper is creative.
I’m still waiting for respawnable weapons; Most players are stupid and they just take all the ammo and die 20 seconds later leaving no weaponary for the rest of the team

2 Likes