Fast lasers

Making or wanting help making your own asset? Check in here
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Fast lasers

Post by Mats391 »

I managed to speed up the laser projectile with out it jumping off the target (or atleast not more than it does currently)
Video:
[XFIRE]6100ac[/XFIRE]
My projectile flys at 1450+ m/s where as the current one only at 250m/s.
Changed Code:

Code: Select all

rem For weapon:
ObjectTemplate.projectileTemplate simrad_Projectile
ObjectTemplate.keepProjectiles 15
ObjectTemplate.velocity 1450
ObjectTemplate.itemIndex 7
ObjectTemplate.delayToUse 1.5

rem for projectile:
ObjectTemplate.create GenericProjectile simrad_Projectile
ObjectTemplate.createNotInGrid 1
ObjectTemplate.setNetworkableInfo BasicInfo
rem ---BeginComp:StickyCollisionComp ---
ObjectTemplate.createComponent StickyCollisionComp
ObjectTemplate.collision.bouncing 1
ObjectTemplate.collision.maxStickAngle 360
ObjectTemplate.collision.stickToStaticObjects 1
ObjectTemplate.collision.stickToVehicles 1
ObjectTemplate.collision.stickToTerrain 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
ObjectTemplate.penetrate.allowLiquidPenetration 0
rem ---EndComp ---
ObjectTemplate.mass 9999
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.gravityModifier 1
ObjectTemplate.physicsType RotationalPoint
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 0
ObjectTemplate.acceleration 10
ObjectTemplate.maxSpeed 1500
rem -------------------------------------
ObjectTemplate.addTemplate S_laser_gun_Projectile_Looping
ObjectTemplate.addTemplate LaserTarget_simrad
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/15/0/0
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.localPredictOnClient 1
ObjectTemplate.damage 0
I stumbled across this by accident while trying to make realistic gtld that requires you to keep aim over the target. My approach for that was to have a wireguided projectile that doesnt explode on impact, but it always lost the guiding when it hit the ground. Does someone have an idea how to make it work?
Image

Mineral: TIL that Wire-guided missiles actually use wire
Rudd
Retired PR Developer
Posts: 21225
Joined: 2007-08-15 14:32

Re: Fast lasers

Post by Rudd »

was this on a dedicated or local server?
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Fast lasers

Post by Rhino »

looks good, but have you tested it on dedicated?

EDIT: damn ninja
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

[R-DEV]Rudd wrote:was this on a dedicated or local server?
video is from local, but i also tested it successfully on dedicated.
After bit more experimenting it turns out you only need to change the physics type from Point to RotationalPoint and it works for all speeds.
I also made sure the laser actually sticks to the vehicle, but i did not try shooting it onto moving targets.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Fast lasers

Post by Rhino »

Sounds awesome :D

From what I could tell from watching your video is that it also bounced off the vehicles less than it dose now too which should really help, nice work! :D
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

[R-DEV]Rhino wrote:Sounds awesome :D

From what I could tell from watching your video is that it also bounced off the vehicles less than it dose now too which should really help, nice work! :D
It still trys to jump of but gets put back into place causing it to jitter a bit. Very visible at the first lase, it jumps of and back on. Also sometimes it doesnt stick and i cant find the laser anywhere, i guess in those cases it fly somewhere into the sky.
Anyway from testing on ground, slopes, statics and vehicles it seems to be equal or better than the current system.
I will try it on coop later to see how it reacts to moving targets.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Wheres_my_chili
Posts: 240
Joined: 2011-07-31 23:35

Re: Fast lasers

Post by Wheres_my_chili »

Mats, you're so cool.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

Works fine with moving targets. Maybe even too good as i was able to lase a flying chopper :p
[XFIRE]610118[/XFIRE]
This is also from a dedicated server.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Pvt.LHeureux
Posts: 4796
Joined: 2009-04-03 15:45

Re: Fast lasers

Post by Pvt.LHeureux »

It's because this is a chopper piloted by a bot, slow as hell :razz:
Image

Chuva_RD : You want to remove bugged thing but dont tell how to fill formed void.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

Pvt.LHeureux wrote:It's because this is a chopper piloted by a bot, slow as hell :razz:
the difficulty of hitting mid air choppers is comparable to shooting them with tanks, just that you have way better angle/faster aiming.

since i dont want to see choppers getting bombed out of mid air, i tried fixing this by making the projectile explode when it comes close to an aircraft. I just copied the code from an AA missile and adjusted the damage values, but it doesnt work :(

added detonation comp from stinger missle:

Code: Select all

rem ---BeginComp :D efaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 0
ObjectTemplate.detonation.explosionRadius 0
ObjectTemplate.detonation.explosionForce 0
ObjectTemplate.detonation.explosionDamage 0
ObjectTemplate.detonation.detonateDistanceToTarget 22
rem ObjectTemplate.detonation.endEffectTemplate e_exp_air
ObjectTemplate.detonation.useMMOnEndEffect 1
ObjectTemplate.detonation.detectionRadius 100
ObjectTemplate.detonation.maxDepthForExplosion 2
ObjectTemplate.detonation.triggerRadius 40
ObjectTemplate.detonation.triggerType MTYVehicle
ObjectTemplate.detonation.triggerVictimMinSpeed 10
ObjectTemplate.detonation.radiusDetonateWithAirVehicles 32
rem ---EndComp ---
Image

Mineral: TIL that Wire-guided missiles actually use wire
M42 Zwilling
Retired PR Developer
Posts: 613
Joined: 2012-06-10 11:27

Re: Fast lasers

Post by M42 Zwilling »

Why would you want to do that? You know, an F-15E shot down a helicopter with a laser-guided bomb in the Gulf War... :-P
Image


"How many posts have there been about how much better PR was back in 0.X? The fact is that if we played the older versions we would start to remember the shortcomings, but we tend to hold onto the good memories tighter than the bad ones." - Murphy
Jafar Ironclad
Retired PR Developer
Posts: 2203
Joined: 2008-11-26 00:45

Re: Fast lasers

Post by Jafar Ironclad »

Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).
Moszeusz6Pl
Retired PR Developer
Posts: 939
Joined: 2010-06-24 13:41

Re: Fast lasers

Post by Moszeusz6Pl »

The problem is, if lase disappear when missile/bomb is already in air, it might lose lock during critical phase and miss target. It need to be enough for CAS to come, launch missile and to missile hit target. If we reduce it, it can cause problems if CAS is called by another squad and all coms goes through FAC, because they will need more time to prepare strike.

Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

[R-DEV]Jafar Ironclad wrote:Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).
one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.
Edit: and the gravity modifier should be removed, so even w/o new lase it lands where the last laser was instead of going into the sky.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Celestial1
Posts: 1124
Joined: 2007-08-07 19:14

Re: Fast lasers

Post by Celestial1 »

Is it possible to trigger the destruction of the laze object when the operator leaves the GLTDs (as in, right clicks)?
Jafar Ironclad
Retired PR Developer
Posts: 2203
Joined: 2008-11-26 00:45

Re: Fast lasers

Post by Jafar Ironclad »

Mats391 wrote:one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.
Edit: and the gravity modifier should be removed, so even w/o new lase it lands where the last laser was instead of going into the sky.
I don't see any problems with that. The relock delay might be to prevent wild laze jumps on expiration, but removing grav modifier shouldn't be an issue; its already done on jet AGM's anyway.
chrisweb89
Posts: 972
Joined: 2008-06-16 05:08

Re: Fast lasers

Post by chrisweb89 »

Reducing the lase time to 100 seconds even with these changes would make doing CAS for people not in your squad way more difficult than it already is, and depending on the team getting a lase to stick at the proper time on a target is very difficult for a lot of people.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Fast lasers

Post by Mats391 »

[R-DEV]Jafar Ironclad wrote:I don't see any problems with that. The relock delay might be to prevent wild laze jumps on expiration, but removing grav modifier shouldn't be an issue; its already done on jet AGM's anyway.
then get to it :p
Reducing the lase time to 10 seconds even with these changes would make doing CAS for people not in your squad way more difficult than it already is, and depending on the team getting a lase to stick at the proper time on a target is very difficult for a lot of people.
The only thing that should change is that you keep eyes on the target and relaze when needed. Relasing before the attack so it stays during the attack should no longer be required.

I also found one bug with this, when you hit the target in a very sharp angle (seen from surface) on short distances it wont stick and simply disappear.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Fast lasers

Post by Rhino »

[quote=""'[R-DEV"]Jafar Ironclad;1949323']Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).[/quote]
[R-DEV]Moszeusz6Pl wrote:The problem is, if lase disappear when missile/bomb is already in air, it might lose lock during critical phase and miss target. It need to be enough for CAS to come, launch missile and to missile hit target. If we reduce it, it can cause problems if CAS is called by another squad and all coms goes through FAC, because they will need more time to prepare strike.
The main problem is locking onto the laser in the first place. Like if a jet pops flares when trying to lock on with missiles, if the lock is interrupted by a new target coming closer, the locking timer starts all over again from scratch. The same is true for locking onto ground targets.

This can only change if we make the lock on time 0, or super short, but then you don't need to spend any time trying to get a lock, unless we change the entire way we lock onto ground targets from the air, which might be something to consider.

[quote="Mats391""]one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.[/quote]

Ye the relock time of an "armed" weapon that's already flying should be made to 0, at least for most Air to Ground weapons but that code might be the lock time for when your trying to lock onto a target, before launch.
Image
Post Reply

Return to “PR:BF2 Community Modding”