OpenXcom Forum

Modding => Work In Progress => Topic started by: The Reaver of Darkness on February 17, 2017, 08:14:05 am

Title: [SOLVED] Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: The Reaver of Darkness on February 17, 2017, 08:14:05 am
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?
Title: Re: Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: ohartenstein23 on February 17, 2017, 02:52:22 pm
Another solution would be to manufacture tank ammo, with 1 elerium giving multiple plasma charges.
Title: Re: Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: The Reaver of Darkness 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?
Title: Re: Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: Solarius Scorch 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
Title: Re: Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: The Reaver of Darkness on February 18, 2017, 02:14:46 am
Thanks!!
Title: Re: Ammo for tanks: how do I make it more than 1 ammo per item?
Post by: R1dO 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