[ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Ask questions, discuss ideas, get answers
Post Reply
Pigauchiu
Posts: 31
Joined: Fri Mar 30, 2012 1:00 pm

[ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Pigauchiu »

yes, my question is about stop nade spammings again, the complete code that i added in ObjectSpawnTemplates.con was:

Code: Select all

rem *** stop nade spammings ***
ObjectTemplate.Active AmmoboxSupplyDepot
ObjectTemplate.addAmmoType 2 0 -1 0
I know that there's a known working approach like:

Code: Select all

rem *** stop nade spammings ***
ObjectTemplate.Active GrenadeAllies
ObjectTemplate.AmmoType 4

ObjectTemplate.Active GrenadeAxis
ObjectTemplate.AmmoType 4
but I still want to know what's the problem of the former method?
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by freddy »

if i recall correctly -1 means unlimited supply.

to make a slow reload (if i remember correctly). where the 0.5 is units per second

Code: Select all

ObjectTemplate.Active AmmoboxSupplyDepot
ObjectTemplate.addAmmoType 2 0 0.5 0
if you want to block the nade all together you can switch the input key for the grenade.

Code: Select all

ObjectTemplate.Active GrenadeAllies
ObjectTemplate.setInputFire c_PINone 
Pigauchiu
Posts: 31
Joined: Fri Mar 30, 2012 1:00 pm

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Pigauchiu »

freddy wrote:if i recall correctly -1 means unlimited supply.

to make a slow reload (if i remember correctly). where the 0.5 is units per second

Code: Select all

ObjectTemplate.Active AmmoboxSupplyDepot
ObjectTemplate.addAmmoType 2 0 0.5 0
you recall correctly...but only if -1 is put into the second argument. :idea:
then i tried putting a very small number (0.0001) into the second and third argument. Both no luck.
freddy wrote:if you want to block the nade all together you can switch the input key for the grenade.

Code: Select all

ObjectTemplate.Active GrenadeAllies
ObjectTemplate.setInputFire c_PINone 
negative, i still want 3 nades per kit. ;)
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Dennis|8749236 »

You can switch Nades' ammo type to -1, which means they will never get resupplied..
What is the meaning of Life?? (Don't think about it!)
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by freddy »

youré right, the first method should work. if we look at the original code for ammo 2 the -1 thats in there means the amount of ammo that can be handed out by the supply (infinity), as you have set the amount to 0 it shouldnt give out anything at all.

just for the hell of it what about setting it all to 0?

Code: Select all

ObjectTemplate.addAmmoType 2 0 0 0
if it still doesnt apply i cant think of anything else then that somehow the code isnt being read by the game
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Dennis|8749236 »

is possible that he didn't run the file...
if he added a new .con file..
he need to run it in order to make his code works...
What is the meaning of Life?? (Don't think about it!)
Pigauchiu
Posts: 31
Joined: Fri Mar 30, 2012 1:00 pm

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Pigauchiu »

freddy wrote:youré right, the first method should work. if we look at the original code for ammo 2 the -1 thats in there means the amount of ammo that can be handed out by the supply (infinity), as you have set the amount to 0 it shouldnt give out anything at all.

just for the hell of it what about setting it all to 0?

Code: Select all

ObjectTemplate.addAmmoType 2 0 0 0
if it still doesnt apply i cant think of anything else then that somehow the code isnt being read by the game
no luck too.
Dennis|8749236 wrote:is possible that he didn't run the file...
if he added a new .con file..
he need to run it in order to make his code works...
not the reason neither. The file i'm working on is bocage_003, "run Conquest/ObjectSpawnTemplates" exists in Conquest.con
Pigauchiu
Posts: 31
Joined: Fri Mar 30, 2012 1:00 pm

Re: [ssm]ObjectTemplate.addAmmoType 2 0 -1 0 not working

Post by Pigauchiu »

latest test result: I removed the line "ObjectTemplate.addAmmoType 2 -1 1.2 0" in objects.rfa, then added the following in ObjectSpawnTemplates.con of bocage_003.rfa

Code: Select all

ObjectTemplate.Active AmmoboxSupplyDepot
ObjectTemplate.addAmmoType 2 -1 1.2 0
I loaded bocage and then battle of britain. i can get nades supplies from ammobox in bocage but not in bob, ie everything worked perfectly as expected. wt the **** is going on? :roll:
Post Reply