Page 1 of 1

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

Posted: Sat Apr 14, 2012 10:19 am
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?

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

Posted: Sat Apr 14, 2012 10:05 pm
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 

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

Posted: Sun Apr 15, 2012 6:06 pm
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. ;)

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

Posted: Sun Apr 15, 2012 11:34 pm
by Dennis|8749236
You can switch Nades' ammo type to -1, which means they will never get resupplied..

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

Posted: Mon Apr 16, 2012 7:13 am
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

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

Posted: Wed Apr 18, 2012 2:03 am
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...

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

Posted: Thu Apr 19, 2012 2:08 pm
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

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

Posted: Tue May 08, 2012 3:28 pm
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: