Unlimited Ammo

Ask questions, discuss ideas, get answers
Post Reply
User avatar
SeabeeCA
Posts: 11
Joined: Sun Feb 28, 2010 2:40 am

Unlimited Ammo

Post by SeabeeCA »

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?
Image
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: Unlimited Ammo

Post by Jeronimo »

Hi and welcome to the board. :)

A HandFireArms template for example (=> Stinger) can have the property

Code: Select all

ObjectTemplate.Active Stinger
ObjectTemplate.numOfMag -1
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:

Code: Select all

ObjectTemplate.Active Stinger
ObjectTemplate.addTemplate AmmoboxSupplyDepot
Though this will also reload anything else in the ammobox' radius (3 by default) around the soldier holding the Stinger in his hand.
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Unlimited Ammo

Post by Apache Thunder »

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. :D

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.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Unlimited Ammo

Post by Swaffy »

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.

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™
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: Unlimited Ammo

Post by Jeronimo »

Apache Thunder wrote:My BFH'42 mod [...] You should give it a look over.
That's where I took this line from :D

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?
Image
User avatar
SeabeeCA
Posts: 11
Joined: Sun Feb 28, 2010 2:40 am

Re: Unlimited Ammo

Post by SeabeeCA »

Thanks you guys and actually I have been at this board ever since it was serverside modding but thanks none the less.
Image
User avatar
SeabeeCA
Posts: 11
Joined: Sun Feb 28, 2010 2:40 am

Re: Unlimited Ammo

Post by SeabeeCA »

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.
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Unlimited Ammo

Post by Apache Thunder »

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?
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.

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.

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.
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.
ImageImageImage
I have cameras in your head!
Post Reply