Page 2 of 2

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Tue Jun 11, 2013 1:21 pm
by dudejo
From what I can gather, the reason you're limited to 3 bombs is because of the rate of fire. The moment I set my personal files to your rate of fire of 10, I got the same problem as you. It's most likely causing a conflict with the Firedelay setting.

As for the ExpPacks setting the mines off, I couldn't get it to happen using your settings but I can confirm that what Vilespring said about the differences in mass is true. A heavier ExpPack will set off the mines under normal circumstances.

The best I can say is that a setting, somewhere, is preventing the landmine from registering its own mass.

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Tue Jun 11, 2013 1:32 pm
by Vilespring
Throw a mine at an Expack. I really think that might help me. If the Expack goes boom, then we got something funny.

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Tue Jun 11, 2013 2:48 pm
by dudejo
Something would indeed be fishy, considering his ExpPack doesn't have any code for proximity explosions. Unless proximity explosions can be triggered simply by giving damage mods to the weapon's materials.

Also, I noticed that his mines don't stick to the ground. Could it be the geometry files?

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Tue Jun 11, 2013 3:13 pm
by Swaffy
Well, the whole "mines sticking to the ground" thing is because I increased the velocity for the FireArms on the ExpPack. Usually it has a very low velocity and thus the pack just drops. But I wanted players to be able to throw it a bit further.

Bugs fixed! It WAS the fire rate. And it WAS the mass that caused the landmines to explode, though it wasn't very important problem.

I will make a hotfix for my mod as soon as I figure out any other smallish bugs that might exist.

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Wed Jun 12, 2013 7:34 pm
by Apache Thunder
You can make the expack have more mass but not detonate the mines. Two things are required to trigger mines. A larger mass then the projectile, and having armor turned on.

Simply set "ObjectTemplate.hasAmor" to 0 on your exppacks and you can now make them as heavy as you want without causing mines to detonate. ;)

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Wed Jun 12, 2013 8:01 pm
by dudejo
Are there any side effects to deactivating armor on the ExpPack?

Or is that simply a vestigial function from the early versions of BF1942?

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Wed Jun 12, 2013 9:01 pm
by Vilespring
The "hasArmor" oddly enough, makes minimap icons not work. It doesn't take damage, and, as odd as it sounds, makes AI not "see" you. In my debug modding days, I changed that code on the T34 tank, so that is how I know. Funny, because you are a stealth tank to the AI, for all they know, they are just dieing to nothing! :lol:

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Thu Jun 13, 2013 12:51 pm
by dudejo
I did notice that the AI tries to avoid landmines when they're not driving at full speed. The way I see it, disabling hasArmor on the ExpPacks and the Landmines will most likely make them entirely invisible to the AI.

Re: Swaffy'sMod Bug: ExpPack and Landmine

Posted: Wed Jul 25, 2018 10:43 am
by russ
Apache Thunder wrote:You can make the expack have more mass but not detonate the mines. Two things are required to trigger mines. A larger mass then the projectile, and having armor turned on.

Simply set "ObjectTemplate.hasAmor" to 0 on your exppacks and you can now make them as heavy as you want without causing mines to detonate. ;)
Just resurrecting this thread to add additional detonation rules so they are documented somewhere. The rules apply to any projectiles with an explodeNearEnemyDistance (landmines, flak, sea mines, depth charges).

* ProximityFusePrimer time must have passed (if present).
* The object must have hasArmor set.
* The object cannot be a BFSoldier, even if hasArmor is set.
* The object must have a physics node.

If above water:

* The object must weigh more than the projectile.
* The center of the object must be within explodeNearEnemyDistance of the center of the projectile.
* The object must be less than or equal to 100000.0 in mass.
* The object must be moving at 2.5m/s or faster.

If under water:

* The object must weigh more than 50000.0
* The grid distance between object centers must be less than or equal to explodeNearEnemyDistance
* The Z distance between object centers must be less than explodeNearEnemyDistance

The second two rules may be a bit confusing, the object culling code pulls in objects by doing an approximate distance calculation. In the above water case, any collected objects will be accurately measured using Pythagorean. For underwater objects, only the Z distance is tested. This is also why placing mines with the PT boat is so damned dangerous, it doesn't matter how slow you are moving, if you get too close, boom. Also, if you place a mine near a ship that isn't moving, it will instaboom.

So a few notes, yes you can drive slowly to avoid mines. You can also drive with a mine on your vehicle as long as you do not exceed 2.5m/s. You can also drive slowly to avoid proximity flak. You cannot proximity flak a stationary vehicle.