aliens

Author Topic: [SOLVED] Ammo for tanks: how do I make it more than 1 ammo per item?  (Read 3129 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
I'm running into a problem with modding tanks. I want the plasma tanks to cost elerium to fire, so I gave them an ammo type. But it doesn't seem like I can set an amount of ammo on the clip. While the clipSize function on soldier weapon clips determines how much ammo is in the clip, for tank ammo it instead determines how many shots the tank can hold.

Can anyone tell me how to make tank clips that give more than 1 ammo?
« Last Edit: February 27, 2017, 06:22:21 pm by The Reaver of Darkness »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Ammo for tanks: how do I make it more than 1 ammo per item?
« Reply #1 on: February 17, 2017, 02:52:22 pm »
Another solution would be to manufacture tank ammo, with 1 elerium giving multiple plasma charges.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: Ammo for tanks: how do I make it more than 1 ammo per item?
« Reply #2 on: February 17, 2017, 08:46:18 pm »
Another solution would be to manufacture tank ammo, with 1 elerium giving multiple plasma charges.
I can accept that, but how do I give a project multiple units of output?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Ammo for tanks: how do I make it more than 1 ammo per item?
« Reply #3 on: February 17, 2017, 08:47:46 pm »
Here:

Code: [Select]

  - name: STR_PLASMA_TANK_AMMO_(x50)
    space: 1
    time: 1
    cost: 1
    requiredItems:
      STR_ELERIUM_115: 1
    producedItems:
      STR_PLASMA_TANK_AMMO: 50
« Last Edit: February 17, 2017, 08:50:19 pm by Solarius Scorch »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: Ammo for tanks: how do I make it more than 1 ammo per item?
« Reply #4 on: February 18, 2017, 02:14:46 am »
Thanks!!

Offline R1dO

  • Colonel
  • ****
  • Posts: 436
    • View Profile
Re: Ammo for tanks: how do I make it more than 1 ammo per item?
« Reply #5 on: February 18, 2017, 03:15:31 am »
... it doesn't seem like I can set an amount of ammo on the clip. While the clipSize function on soldier weapon clips determines how much ammo is in the clip, for tank ammo it instead determines how many shots the tank can hold.

Can anyone tell me how to make tank clips that give more than 1 ammo?

Thanks to TFTD vanilla behavior this is already supported by oxc, albeit it needs a slightly different thinking compared to normal weapons (it's the nature of the beast called HWPs ;-)).
What is needed is defining the clipsize on both the tank AND the ammunition.

Below is the relevant snippet (edited to only show relevant parts) from TFTD items.rul, to help you get started:

Code: [Select]
  - type: STR_GAUSS_CANNON_AMMO                                                                       
    clipSize: 1                                                                                       
  - type: STR_COELACANTH_GAUSS                                                                         
    # special behaviour here: for a HWP with compatible ammo, setting a clipsize                       
    # defines the max ammo for the HWP, and the clipsize on the weapon dictates                       
    # how many rounds it adds.                                                                         
    compatibleAmmo:                                                                                   
      - STR_GAUSS_CANNON_AMMO                                                                         
    clipSize: 50   

Have fun modding