Page 1 of 1

DeAcceleration bullet in bf2?

Posted: Mon Apr 04, 2011 5:12 am
by velosong
Hi,everyone,i`m new here.
Recently i try to modify the bullet in bf2 which is simple and unreal. First of all i want add de-Acceleration factor to projectiles but get trouble.
I can make the bullet reduce speed by setting an engine, but just imagine how slow it could be, the cpu probablely die for that. So , i have to look for other code that can de-accelerate the projectile.

So, i have tested the DeAcceleration code, Unfortunately it dosent work.

Code: Select all

ObjectTemplate.UseDeAcceleration 1
ObjectTemplate.DeAcceleration 50
or

Code: Select all

ObjectTemplate.setUseDeAcceleration 1
ObjectTemplate.setDeAcceleration 50/50/50
they failed to reduce the bullet speed. For experiment,i set Acceleration instead, it works fine. Just DeAcceleration can not work.

i dont kown what is wrong with that, here s my experimental bullet tweak, please have a look. Any help will be appreciated.

by the way, the projectlie velocity defined in rifle tweak is

Code: Select all

ObjectTemplate.velocity 10
projectile live time is 20, if there is no deacceleration it should end at 200m.

Code: Select all

ObjectTemplate.create GenericProjectile Projectile_DeAcceleration_Tester

rem-----------------------------
ObjectTemplate.material 9999
ObjectTemplate.damage 50
rem-----------------------------

ObjectTemplate.gravityModifier 0

rem didnt work** ObjectTemplate.setUseDeAcceleration 1
rem didnt work** ObjectTemplate.setDeAcceleration 50/50/50

ObjectTemplate.UseDeAcceleration 1
ObjectTemplate.DeAcceleration 50

ObjectTemplate.createNotInGrid 1
rem ---BeginComp:DefaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
rem ---EndComp ---
rem ---BeginComp:DefaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 9998
ObjectTemplate.detonation.explosionRadius 3
ObjectTemplate.detonation.explosionForce 0
ObjectTemplate.detonation.explosionDamage 25
ObjectTemplate.detonation.detectionRadius 1
ObjectTemplate.detonation.maxDepthForExplosion 2
ObjectTemplate.detonation.detonateOnWaterCollision 0
ObjectTemplate.detonation.timeUntilCanDetonate 0.08
rem ---EndComp ---
rem ---BeginComp:DefaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp:DefaultRicochetComp ---
ObjectTemplate.createComponent DefaultRicochetComp
rem ---EndComp ---
rem ---BeginComp:DefaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 1
ObjectTemplate.penetrate.allowLiquidPenetration 0
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.collisionGroups 8
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.timeToLive CRD_NONE/20/0/0


Re: DeAcceleration bullet in bf2?

Posted: Mon Apr 04, 2011 3:37 pm
by Dennis|8749236
deacceleration code don't work in projectile i think..

Re: DeAcceleration bullet in bf2?

Posted: Mon Apr 04, 2011 8:13 pm
by Apache Thunder
Does adding drag to the bullet help? You may need to remove point physics from the bullet as well. But my understanding on how BF2 projectiles work is a bit limited. They don't behave quite the same as BF1942. Case in point, I can't get koopa shells to behave the same in BF2 as they did in my BF1942 Mario Kart mod. :(

Re: DeAcceleration bullet in bf2?

Posted: Mon Apr 04, 2011 11:08 pm
by freddy
velosong wrote: For experiment,i set Acceleration instead, it works fine.
try a negative value for acceleration, with any luck it work

Re: DeAcceleration bullet in bf2?

Posted: Tue Apr 05, 2011 1:53 am
by velosong
Apache Thunder wrote:Does adding drag to the bullet help? You may need to remove point physics from the bullet as well. But my understanding on how BF2 projectiles work is a bit limited. They don't behave quite the same as BF1942. Case in point, I can't get koopa shells to behave the same in BF2 as they did in my BF1942 Mario Kart mod. :(
freddy wrote:
velosong wrote: For experiment,i set Acceleration instead, it works fine.
try a negative value for acceleration, with any luck it work
yes, i have tested it with drag before. The problem is that drag effects the velocity in total, which means in the moment of projectile leave rifle barrel, it is slowed by the drag already, it is a constant value rather than reduce speed meter by meter. Once it is added, the speed of projectile shold be change from "10--10--10--10" to "5--5--5--5", but what i want is "10-8-6-4".

to,Freddy. no, negative value dosent work at all. I have tested that many times, i think it is illegel in BF2. Only positive value works fine)
see my code

Code: Select all

ObjectTemplate.Acceleration -100

Re: DeAcceleration bullet in bf2?

Posted: Thu Apr 07, 2011 2:35 am
by Apache Thunder
Did you try adding a force object that applies thrust in the opposite direction the bullet is going? If done correctly it could have the same effect. ForceObjects are something new starting in BF2. They aren't as complex as engine coding thus it shouldn't lag too much if bullets have them.

Re: DeAcceleration bullet in bf2?

Posted: Wed Apr 13, 2011 10:13 pm
by Dennis|8749236
add a wing to deaccelerate?
i use wings to make my AirDrop tank in BF1942 to fall slower, so it can land safely..