Page 1 of 1

Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-24 12:27
by Manekk
Hello guys,

thank you for accepting me to your community.
I am not a PR player. I play vanilla BF2 and love the **** out of it.
I would like to say hello to you guys from the vanilla community.

I come here, seeking knowledge. I am trying to fix grenade spam in BF2. We have tried solutions like reducing the amount of nades you get to two or even getting rid of nades.
The first solution did not solve the problem. You could still resupply your own two grenades and throw them infinitely. The 2nd solution is not for everyone. It creates other problems like (roof) camping and a much less dynamic gameplay.

I have seen other people add changes to the mods\bf2\python\game\gamemodes\gpm_cq.py scrypt on the server and was thinking that it might be possible to apply a fix as mentioned in the forum title. Another thing I could think of, is maybe increasing the time it takes to resupply nades to a rather high number.

I am asking you guys, because you seem so much more knowledgeable of the game in general. I have asked others from my scene, done some research but couldn't tackle the problem on my own.

I would be very happy to get some advice from our brothers here in Project Reality.

Keep up the good work!

Thank you,

Manekk

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-24 16:41
by Frontliner
I was about to write that there is no way to do this, but then I remembered that the game has code to distinguish between vehicle and air ammo as well as infantry munitions. If it's possible to mark grenades as vehicle/air ammo, then it would not be possible to replenish grenades with the support's ammo bag, hence minimizing the spam.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 01:56
by Manekk
This sounds very interesting. How do you think this is possible? I have been searching the code for a solution for days, but I could not find anything that solved my problem. Thanks!

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 11:48
by Mats391
Its not. Soldiers are soldiers and all weapons used by them are considered soldier weapons. Selective disabling of reloading is not possible else we would do it in PR.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 12:15
by MaxP
Mats391 wrote:Its not. Soldiers are soldiers and all weapons used by them are considered soldier weapons. Selective disabling of reloading is not possible else we would do it in PR.
Mats391, is there any explaining of resupply mechanics?
I.e., I can't clearly understand, what is the StorageSize, and how is it refers to the amount of replenished ammo.
The only things I've found out is that the ammo replenishing by percentage - i.e. if the the supplyobject resupply 200 rounds from total of 300, it will also resupply 2 of 3 grenades. But how is it calculated? :confused:

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 12:40
by Fastjack
Wouldn't fix a high reload time the nadespamming?

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 13:54
by Manekk
I am trying to work with these values:

ObjectTemplate.activeSafe GenericFireArm ushgr_m67

ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 0.5
ObjectTemplate.ammo.minimumTimeUntilReload 0.5
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.instantReloadOnEnable 1
ObjectTemplate.ammo.toggleWhenNoAmmo 1


I bumped up the reload time via rcon command, but it just makes the nades buggy. You can still throw them without animation. It seems like a modded server meets an unmodded client, creating these bugs. Unfortunately modding the client is not an option, because I would like to make a server side mod without the need of players modifying their game and in that way splitting the community even further.

I have also tried fiddling with this:

Objects_server.zip\Weapons\Handheld\ammokit

ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 0.7
ObjectTemplate.ammo.minimumTimeUntilReload 0.6
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.instantReloadOnEnable 1
ObjectTemplate.ammo.toggleWhenNoAmmo 1
ObjectTemplate.ammo.abilityDrain 0.05
ObjectTemplate.ammo.abilityRadius 4
ObjectTemplate.ammo.abilityStrength 5.3
ObjectTemplate.ammo.abilityCost 0.25
ObjectTemplate.ammo.abilityMaterial 91

But I do not fully grasp the code, since I have no background in coding, except in R :D

Also I would like the change to only affect grenade resupply and not resupply in general.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 15:00
by Fastjack
Than i see only the option to reduce the amount of mags from the grenades.

ObjectTemplate.ammo.nrOfMags 4 - to a lower value

Sofar i understand serverside modding you can only change numbers/values but you cannot change things like adding codelines to a tweakfile.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 17:20
by Mats391
MaxP wrote:Mats391, is there any explaining of resupply mechanics?
I.e., I can't clearly understand, what is the StorageSize, and how is it refers to the amount of replenished ammo.
The only things I've found out is that the ammo replenishing by percentage - i.e. if the the supplyobject resupply 200 rounds from total of 300, it will also resupply 2 of 3 grenades. But how is it calculated? :confused:
Each weapons requires 100 supply points to rearm to 100%. So a weapon with 1 magazine requires 100 supply points to rearm one magazine and a weapon with 4 magazines requires 100 supply points to rearm 4 magazines. That means if a weapons has more magazines it requires less supply points per magazine and also less time to rearm a single magazine (still same time required to rearm to 100%).

With that you could do these to make a weapon less spammable:
  1. reduce the amount of magazines in the weapon so each magazine becomes more expensive and takes longer to reload
  2. reduce the total amount of supply points in the supply source to reduce amount of magazines you are able to rearm
  3. reduce the rearm rate of the supply source to slow down the rearming
In PR we used the 3. option to make spamming from ammocaches harder.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 17:38
by Manekk
You guys are amazing. Thank you so much for trying to help me with my problem!
I will definitely leave you guys a donation for your project, should I be able to tackle the issue with your help!

So do you think changing

ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1

to

ObjectTemplate.ammo.nrOfMags 1
ObjectTemplate.ammo.magSize 4

will give me the possibility to reduce either one of those two

ObjectTemplate.ammo.reloadTime 0.5
ObjectTemplate.ammo.minimumTimeUntilReload 0.5

so I can achieve a slower reload?

I am at work at the moment, so I cannot test it. Will do it, when I come home.

Maybe I made a mistake while changing it in rcon, but I remember changing this

ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1

to this

ObjectTemplate.ammo.nrOfMags 1
ObjectTemplate.ammo.magSize 4


only changed the ammo count while I could still throw four nades, just without proper animation.
The client seems to refuse some changes I make to the server :(

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 20:04
by MaxP
Mats391 wrote:Each weapons requires 100 supply points to rearm to 100%. So a weapon with 1 magazine requires 100 supply points to rearm one magazine and a weapon with 4 magazines requires 100 supply points to rearm 4 magazines. That means if a weapons has more magazines it requires less supply points per magazine and also less time to rearm a single magazine (still same time required to rearm to 100%).
Thank you. But how it works for multiple weapons?
I.e., I have 3 grenades at 1, 9 pistol mags at 2 and 10 rifle mags at 3.
The supply source has 100 supply points. Will I rearm all my weapons, or just only 1/3 of each?

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 21:32
by Mats391
Manekk wrote:You guys are amazing. Thank you so much for trying to help me with my problem!
I will definitely leave you guys a donation for your project, should I be able to tackle the issue with your help!

So do you think changing

ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1

to

ObjectTemplate.ammo.nrOfMags 1
ObjectTemplate.ammo.magSize 4

will give me the possibility to reduce either one of those two

ObjectTemplate.ammo.reloadTime 0.5
ObjectTemplate.ammo.minimumTimeUntilReload 0.5

so I can achieve a slower reload?

I am at work at the moment, so I cannot test it. Will do it, when I come home.

Maybe I made a mistake while changing it in rcon, but I remember changing this

ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1

to this

ObjectTemplate.ammo.nrOfMags 1
ObjectTemplate.ammo.magSize 4


only changed the ammo count while I could still throw four nades, just without proper animation.
The client seems to refuse some changes I make to the server :(
reloadTime and mimimumReloadTime are the time to reload, not the time to rearm. So it is the time when you still have an additional magazine to reload that magazine. For grenadiers you want to keep magSize at 1 else you wont get reloading between firing.
MaxP wrote:Thank you. But how it works for multiple weapons?
I.e., I have 3 grenades at 1, 9 pistol mags at 2 and 10 rifle mags at 3.
The supply source has 100 supply points. Will I rearm all my weapons, or just only 1/3 of each?
All weapon rearm at once, so each gets 1/3 of the supply. In your case that is enough for 1 grenade, 3 pistol mags and 3.33 rifle mags. The 0.33 rifle mags will get lost tho.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 22:17
by Manekk
Mats391 wrote:reloadTime and mimimumReloadTime are the time to reload, not the time to rearm. So it is the time when you still have an additional magazine to reload that magazine. For grenadiers you want to keep magSize at 1 else you wont get reloading between firing.
All I find are these lines:

rem ---BeginComp:ThrownFireComp ---
ObjectTemplate.createComponent ThrownFireComp
ObjectTemplate.fire.fireLaunchDelay 0.39
ObjectTemplate.fire.altFireInput PIAltFire
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.projectileStartPosition 0/0/0.2
ObjectTemplate.fire.fireLaunchDelaySoft 0.8
ObjectTemplate.fire.showWeaponAfterReloadDelay 0.1
ObjectTemplate.fire.pullBackTime 0.45
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.ammoType 1
ObjectTemplate.ammo.nrOfMags 4
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 0.5
ObjectTemplate.ammo.minimumTimeUntilReload 0.5
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.instantReloadOnEnable 1
ObjectTemplate.ammo.toggleWhenNoAmmo 1
rem ---EndComp ---

Any idea where I can alter the rearm time? Or ist it the wrong file?

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 23:03
by MaxP
Manekk wrote: Any idea where I can alter the rearm time? Or ist it the wrong file?
In SupplyObject itself.
I.e. for stock supply:
ObjectTemplate.healSpeed 3
ObjectTemplate.refillAmmoSpeed 7

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 23:20
by Manekk
Sounds pretty interesting!
And in what file can I find that? Or how can I enter it into rcon?
Does it affect all soldiers or can I change it only for the support class?
Pretty lost at the moment, sorry.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-09-29 23:45
by MaxP
Manekk wrote:Sounds pretty interesting!
And in what file can I find that? Or how can I enter it into rcon?
Does it affect all soldiers or can I change it only for the support class?
Pretty lost at the moment, sorry.
Can't say about rcon, but you can search in your server archives with advanced file managers, like Total Commander (search by text SupplyObject in this case). It will find all the files containing this text.
But you have to know already what object you want to edit.
I.e., stock BF2 has only supply_crate object (airdrop).
This changes will affect all soldier classes, and it is not soldier depedent.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-11-04 23:26
by Manekk
A small update from me:
I tried all the suggestions made in this thread and am very thankful for what you provided so far. Your enthusiasm and helpfulness is heartwaming!
However I still have not found a solution for my problem. I am sure there is a way. I just can't figure it out, since I really lack knowledge of the deeper game mechanics.

I offer to make a donation to your project, should anyone find a solution to this problem.
At the moment the state of the game is simply saddening.

I would be very happy for any suggestion.

Thanks, Manekk

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-11-05 08:55
by Rhino
I very much doubt you can stop resupply for just grenades without modifying the engine itself.

Re: Disabling grenade resupply in vanilla BF2.

Posted: 2018-11-05 15:04
by AlonTavor
Hello.
If you are serious about this, contact me on Discord.
I have some unusual tricks...

-Alon