[Code] Flare bug work-around

Making or wanting help making your own asset? Check in here
Post Reply
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

[Code] Flare bug work-around

Post by rPoXoTauJIo »

Being tired of flarebug that still not fixed from darken ages, made some quick work-around to tweak&hud.

Currently we getting flarebugs due to 1 mag of 60 flares and maglinked weapons(flares and counter are seperate weapons), bf2 can't into logic :(
My idea was to create another system that won't suffer from 1 mag effect even in theory, so the most simply solution were to get 10 mags of 6 flares. Also HUD.

heli flares&counter component in .tweak file(applies to all helis)
\vehicles\air\cf_the_chinook\cf_the_chinook.tweak

Code: Select all

rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
[color=red]ObjectTemplate.ammo.nrOfMags 10
ObjectTemplate.ammo.magSize 6
ObjectTemplate.ammo.reloadTime 0.01[/color]
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.reloadWithoutPlayer 1
ObjectTemplate.ammo.magLinkWeapon cf_the_chinook_flare_group_the_counter
rem ---EndComp ---
hudelements for chinook
hud\hudsetup\vehicles\air\hudelementsuh60.con

Code: Select all

rem -------------------------------------- Flares --------------------------------------

hudBuilder.createTextNode			Uh60Hud Uh60FlaresText 254 420 40 10
hudBuilder.setTextNodeStyle			Fonts/vehicleHudFont_6.dif 0
hudBuilder.setTextNodeString	"FLARES"
hudBuilder.setNodeColor		 		0 1 0 1

hudBuilder.createTextNode			Uh60Hud Uh60FlaresCount 285 420 40 10
hudBuilder.setTextNodeStyle			Fonts/vehicleHudFont_6.dif 0
hudBuilder.setTextNodeStringVariable		PrimaryAmmoString
hudBuilder.setNodeColor		 		0 1 0 1

[color=red]hudBuilder.createTextNode			Uh60Hud Uh60FlareMagsCount 315 420 40 10
hudBuilder.setTextNodeStyle			Fonts/vehicleHudFont_6.dif 2
hudBuilder.setTextNodeStringVariable		PrimaryClipString
hudBuilder.setNodeColor		 		0 1 0 1[/color]
Same can be applied to other jets&helis.

Here is an example how it works:
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
ElshanF
Posts: 357
Joined: 2008-07-22 12:34

Re: [Code] Flare bug work-around

Post by ElshanF »

This man right here DEV's.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Code] Flare bug work-around

Post by Mats391 »

rPoXoTauJIo wrote: Currently we getting flarebugs due to 1 mag of 60 flares and maglinked weapons(flares and counter are seperate weapons), bf2 can't into logic :(
My idea was to create another system that won't suffer from 1 mag effect even in theory, so the most simply solution were to get 10 mags of 6 flares. Also HUD.
Nice idea, but the 1 magazine is likely not the cause of the bug. The bug occurs since weapons on the flare slot (PIFlareFire as input) do NOT rearm. They either need to unlimited or maglinked to a weapon on primary or secondary slot (PIFire, PIAltFire). When they are maglinked the flare weapon rearms since the weapon on the other slot rearms.

Why does the bug happen? Most likely it comes down to a maglink bug where the maglink breaks in one or another way. Similar things happened also to MGs and thats why different firemodes had to be removed from them.

What did we try to fix the bug? In the last patch we attempted to fix it in a similar way it got fixed for the MGs. We set flare weapon and flare counter (which is what actually rearms) to have the same firemodes, burstsize, etc hopeing that this would stop the weapons from unlinking. Sadly it did not have the desired effect :(

What will we try now? Our current approach is to make every flare weapon and flare counter full auto instead of burst, so to drop lots of flares you will have to hold X. This is what a lot of jets use and those seem to not suffer from the bug. However this more or less another shot in the dark as we are yet to find a way to reproduce this bug.

How can you help? First stop complaining about it on forums, we know it is there and are trying to fix it.
Next you can help to find a way to reproduce this bug. Make notes when the bug appears, focus on some of these questions:
-What vehicle are you using?
-How long did you fly before it bugged?
-How many flares did you drop?
-How often did you empty the magazine?
-How often did you switch away from the flare counter? (Any HUD that does not show you the amount of flares counts, so the POV weapons count too)
-How often did you drop flares while not having the counter active?
-Did you spam flares on the rearm point?
-How full was the server?
-How often did the crew/passenger change?

These are just some to look for, take note of whatever you might think is relevant.

Again thanks for the effort, we might give your approach a try, but i cant promise anything.
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: [Code] Flare bug work-around

Post by rPoXoTauJIo »

'[R-CON wrote:Mats391;2009515']Why does the bug happen? Most likely it comes down to a maglink bug where the maglink breaks in one or another way. Similar things happened also to MGs and thats why different firemodes had to be removed from them.
EDIT: On handheld weapons you can at least get rid of bug by reloading weapon, on helis... :(
That's why i'm proposed this change - i know that it's the same cheap and dirt trick just like firemodes on MGs\DMRs, but it's better than rely to unstable system(ask any cas\trans whore\pilot).
But you're DEV's - you decide :)
'[R-CON wrote:Mats391;2009515']How can you help? First stop complaining about it on forums, we know it is there and are trying to fix it.
Well, the last time i just wrote bug report under emotions after 6x flarebugs in a row, sry for that useless spam.
'[R-CON wrote:Mats391;2009515']Next you can help to find a way to reproduce this bug. Make notes when the bug appears, focus on some of these questions:
-What vehicle are you using?
1. Mostly it happening with all transport helis except USMC UH1N. As for me, most bugged helis are chinook and mi8.
-How long did you fly before it bugged?
2. There are two cases - you have flarebug from a first entry, and random time - probably when maglinking breaking due to Refractor??? logic?.
-How many flares did you drop?
3. Doesn't matter. When helicopter is not bugged, you can easily drop all your flares and reload.
-How often did you empty the magazine?
4. 40% of time of my flights.
-How often did you switch away from the flare counter? (Any HUD that does not show you the amount of flares counts, so the POV weapons count too)
5. I'm using POV cameras quite a lot, don't think that causes a bug.
-How often did you drop flares while not having the counter active?
6. Mostly never except few rare cases.
-Did you spam flares on the rearm point?
7. Both on helipad\air to check if flarebug represented. Trying to drop flares in air only so counter wont un-link.
-How full was the server?
8. Regardless of population, happened even with 3 players represented on servers.
-How often did the crew/passenger change?
9. All the time - mostly i'm flying trans heli.
[R-CON]Mats391 wrote: Again thanks for the effort, we might give your approach a try, but i cant promise anything.
Again - you're DEV's, you decide :)
Last edited by rPoXoTauJIo on 2014-05-28 16:07, edited 1 time in total.
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Code] Flare bug work-around

Post by Mats391 »

Does the UH1N not bug currently or only in the past? He got changed as well in 1.2
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: [Code] Flare bug work-around

Post by rPoXoTauJIo »

I've never experienced flarebug with UH1N in 1.1.6.0 when we were able to drop flares by 1 at time.
Still didn't flied much enough in 1.2 with huey.
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Code] Flare bug work-around

Post by Mats391 »

Thats why we are going to test this now on all choppers. If you get more time in the current huey w/o flare bug, please let us know. It would greatly help us to be even more confused about the whole situation :p
atom9[CH]
Posts: 117
Joined: 2011-06-25 08:52

Re: [Code] Flare bug work-around

Post by atom9[CH] »

Why do we have flare bug in 1.0/1.1/1.2 and not in 0.973/0.981? Whad did you change from 0.9 to 1.0? Can't you return to the old system?
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: [Code] Flare bug work-around

Post by rPoXoTauJIo »

@Atom
Flarebug still were represented in 0.9x. Mostly the chances were lower.
My though is that additional load on servers in 1.x causing un-link a lot more.
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
StevePl4y5
Posts: 385
Joined: 2014-02-02 14:33

Re: [Code] Flare bug work-around

Post by StevePl4y5 »

[R-CON]Mats391 wrote:Thats why we are going to test this now on all choppers. If you get more time in the current huey w/o flare bug, please let us know. It would greatly help us to be even more confused about the whole situation :p
In v1.1.6.0, I played alot with the Hueys, never got flarebug on it, with the automatic flare mode. Haven't had the chance to play PR since the last update though.
K4on
Retired PR Developer
Posts: 5055
Joined: 2009-05-08 19:48

Re: [Code] Flare bug work-around

Post by K4on »

In v1.1.6.0, I played alot with the Hueys, never got flarebug on it
yes, thats why we are going to introduce it to all choppers next version now. as that seemed to work properly.
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: [Code] Flare bug work-around

Post by rPoXoTauJIo »

[R-DEV]K4on wrote:yes, thats why we are going to introduce it to all choppers next version now. as that seemed to work properly.
Yay! However it would be funny if bug still will exist(cause UH1N most unbugged heli regardless of flare system) :)
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
User avatar
Daniel
Posts: 2225
Joined: 2010-04-15 16:28
Contact:

Re: [Code] Flare bug work-around

Post by Daniel »

Discovered flare bug for first time yesterday in Eurocopter on Xiangshan, after several sorties in which I dropped few flares each, and everytime loading full, once it would not reload the flares anymore... ?
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [Code] Flare bug work-around

Post by Mats391 »

Found out how to re-produce the flare bug:
Empty your flares while you hold down primary or secondary fire button. So if you go for a hydra dive and pop your last flares, you will get the bug.
Found this out while looking for a solution for another bug. A fix for this is unlikely to happen as it requires quite some editing of binaries :(
Image

Mineral: TIL that Wire-guided missiles actually use wire
FFG
Forum Moderator
Posts: 1468
Joined: 2014-03-18 04:47

Post by FFG »

I haven't had a flare bug since 1.21. If it's a case of firing and popping flares. Just rtb when you get to 18 so you have enough to rtb.

Sent from my MotoE2(4G-LTE) using Tapatalk
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: [Code] Flare bug work-around

Post by Fastjack »

Could it be, that the flarebug (maglink bug) happens because of to much weapons and fakeweapons in the Helos?

I mean, the looking up, down, upper left, upper right etc. (POV fakeweapons).

I remember long longtime ago that i had a problem with rearming (not flares, other weapon) by adding to much weapons systems. I mean i saw a post in the BFSP or BFEditor.org forum about bugging weapons in helos but it's long time ago.
|HBD|Bad_santa12345
Posts: 23
Joined: 2011-11-30 11:35

Re: [Code] Flare bug work-around

Post by |HBD|Bad_santa12345 »

[R-DEV]Mats391 wrote:Found out how to re-produce the flare bug:
Empty your flares while you hold down primary or secondary fire button. So if you go for a hydra dive and pop your last flares, you will get the bug.
Found this out while looking for a solution for another bug. A fix for this is unlikely to happen as it requires quite some editing of binaries :(
If that is the only case when the bug occurs I see two possible and very simple solutions

Code: Select all

// Block PI_Flare when using PI_Fire or PI_AltFire
if (inputBuffer[PI_Fire] || inputBuffer[PI_AltFire])
{
	inputBuffer[PI_Flare] = 0.0f;
}

Code: Select all

// Block PI_Fire and PI_AltFire when using PI_Flare
if (inputBuffer[PI_Flare])
{
	inputBuffer[PI_Fire] = 0.0f;
	inputBuffer[PI_AltFire] = 0.0f;
}
Adding this code to PR shouldn't be that hard as PR is stand alone anyway.
Post Reply

Return to “PR:BF2 Community Modding”