Unlimited Ammo
Unlimited Ammo
I have looked all over this board and cant find a post on this subject. I have been modding BF42 for a year now and I have learned so much from this board. Is there a code to make a specific weapon with unlimited ammo such as the stinger?
Re: Unlimited Ammo
Hi and welcome to the board.
A HandFireArms template for example (=> Stinger) can have the property
This will let you reaload it infinitely often. However, changing this value will not work serverside. In this case you could addTemplate an ammo crate to the Stinger, like so:
Though this will also reload anything else in the ammobox' radius (3 by default) around the soldier holding the Stinger in his hand.

A HandFireArms template for example (=> Stinger) can have the property
Code: Select all
ObjectTemplate.Active Stinger
ObjectTemplate.numOfMag -1
Code: Select all
ObjectTemplate.Active Stinger
ObjectTemplate.addTemplate AmmoboxSupplyDepot
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Unlimited Ammo
My BFH'42 mod has unlimited ammo on everything. Along with the correct vehicle icon type for the vehicles as well. You should give it a look over. 
However be aware that you will need to remove network info from projectiles that have it if you make their host weapon have unlimited ammo. Like grenades/landmines/C4 for example. If you make one of those have unlimited ammo without removing the network info from the projectile, the game will CTD the moment you try to fire said weapon.

However be aware that you will need to remove network info from projectiles that have it if you make their host weapon have unlimited ammo. Like grenades/landmines/C4 for example. If you make one of those have unlimited ammo without removing the network info from the projectile, the game will CTD the moment you try to fire said weapon.



I have cameras in your head!
Re: Unlimited Ammo
I don't know the way that they use regarding setting things "Active," so I'll go ahead and show you the way I do this.
[Objects.rfa\Objects\Handweapons\BrenLMG\Objects.con]
Notice the line "ObjectTemplate.numOfMag -1"
This will give you infinite reloads.
Notice the line "ObjectTemplate.magSize 30"
CHange the 30 to a -1 to have a bottomless clip.
[Objects.rfa\Objects\Handweapons\BrenLMG\Objects.con]
Notice the line "ObjectTemplate.numOfMag -1"
This will give you infinite reloads.
Notice the line "ObjectTemplate.magSize 30"
CHange the 30 to a -1 to have a bottomless clip.
Code: Select all
ObjectTemplate.create HandFireArms BrenLMG
ObjectTemplate.itemIndex 3
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.projectileTemplate barProjectile
rem ObjectTemplate.setTracerTemplate Tracer_Projectile CRD_UNIFORM/2/4/0
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.magSize 30
ObjectTemplate.numOfMag -1
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 4.3
ObjectTemplate.roundOfFire 9
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Unlimited Ammo
That's where I took this line fromApache Thunder wrote:My BFH'42 mod [...] You should give it a look over.

Can you explain btw how those networkableInfos work and what the difference is when leaving them away, or perhaps give me a good link where I can look this up?
Re: Unlimited Ammo
Thanks you guys and actually I have been at this board ever since it was serverside modding but thanks none the less.
Re: Unlimited Ammo
BTW Does anyone know where to download 242. The links provided on this say flagged my anti virus and said there was a password stealer in them.
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Unlimited Ammo
Network info when used on projectiles, serves two main purposes. One is that when it is added, it tells the game to limit the amount of projectiles you can fire onto the map. Landmines for example. The game lets you place twice your mag count and then anything after results in the older projectiles being removed.Jeronimo wrote: Can you explain btw how those networkableInfos work and what the difference is when leaving them away, or perhaps give me a good link where I can look this up?
The second purpose is to allow C4/Exppack to be remote detonated. Without network info, the C4 won't remote detonate.
Also note that random detonation times don't seem to work on networked projectiles (the grenades for example). There is also the side effect that a networked projectile will disappear after the kit that it was fired from gets removed from the map. (aka soldier dies and leaves kit on ground. 20 seconds later, kit vanishes). Unless the soldier died in a vehicle, then his networked projectiles still on the map vanish immediately. (typically landmines and C4)
Also note that the isSticky command causes CTDs when used on networked projectiles. Only use it on projectiles without network info. Unless you are modding BFV. Sticky command works fully in that game engine.
Hmm....Your virus scanner likely has a false positive. My virus scanner didn't flag anything when I made the installer for the mod. You can download WinRAR and use it to extract the exe without running the EXE. This means you can't have it install automatically anymore, but if your worried about trojens/viruses, then it's the best method as the mod itself contains no exes and the installer would not be executed with a manual extraction.SeabeeCA wrote:BTW Does anyone know where to download 242. The links provided on this say flagged my anti virus and said there was a password stealer in them.



I have cameras in your head!