Jump to content
Sign in to follow this  
jostapo

Adding a light to a laser guided bomb (issues)

Recommended Posts

Hi folks. I was wondering if anyone out there has had success with adding a light to an laser guided bomb.

It seems that setting the thrusttime to 0 on ammo with the shotmissile simulation TURNS ON the LGB simulation which allows 2 minutes of flight time (important for MLRS).

Unfortunately, turning this simulation on turns OFF the innate lighting effect that rockets and missiles normally get.

Does anyone out there know how to:

a) attach a permanent light source to a missile regardless of the simulation it uses?

b) how to use the drop command to create the flare (NOT FIRE) effect? What model do flares use? and do they generate their fire when dropped?

The end goal is, I need to be able to light up the countryside as the rocket takes off. If we haven't any luck with this, we'll likely have to settle for rocket takeoffs without ambient lighting, as the solution we have is 100% ballistic (ie, the way it oughta be).

Thanks in advance.

Share this post


Link to post
Share on other sites

As I remember the flare effect model is cl_flare, but it didn't work with drop for me.

You should rather make your own flare with type=decal and lighting=shining in O2 vertex settings, and createVehicle your flare after your rocket has been shot (use the eventhandler fired).

As per light creating; it seems as if we can make lights only with custom Fire objects.

Another idea would be:

You could createVehicle a rocket (with no model) that you setPos behind your LGB-type rocket; so your rocket makes all that dammage and the ballistic curve, and the second rocket makes the visual part!

Share this post


Link to post
Share on other sites
Guest jacobaby

None of the P3D's or models make any ambient lighting.

The lights are only attached via the simulation, which we dont have a lot of control of.

You will want the light streaking across the landscape, so use SHOTMISSILE in the manner Bigpoppa described.

TJ

Share this post


Link to post
Share on other sites

actually its 'maxControlRange=0' that determines if a weapon

is guided or freefall. 'Thrusttime' determines how long it will

fire its engines and produce the flare effect. 'Thrust'

determines how much of a boost the weapon will get when

the engine is on. So if you want a laser guided bomb with

a flare, try setting it to:

maxControlRange=2000;

ThrustTime=200;

Thrust=0;

that way the engines come on but don't actually make the

weapon go any faster. Unfortunatly this will also cause the

weapon to leave a smoke trail. Just a thought smile.gif

Share this post


Link to post
Share on other sites

That's interesting AXE. I played with the CPP extensively last night, and referenced the commented CPP on the laserguidedbomb class.

Changing thrusttime to anything but 0 caused the missile to die after 9.8 seconds or so. Setting it to zero allowed the missile to travel much longer than that.

The maxcontrol range of LGB in the commented config is set to 10,000 with the comment (unlimited control range).

I'm not saying you are wrong. I will test and repost on this shortly.

-Joel

Share this post


Link to post
Share on other sites

Here are my cpp settings for our MLRS rocket as setup to test AXE's assertion:

maxControlRange=0;

inittime=0.0;

thrustTime=2.7;

thrust=0;

simulation=shotMissile;

The rocket flies WITH a light, but self destructs after 9.8 seconds.

Changing the thrustime to 0 allows the missile to fly for 2 minutes.

It's pretty clear that thrustime is the setting that 'turns on' the LGB simulation.

Share this post


Link to post
Share on other sites

if you have maxcontrolrange set to 0, then it isn't a laser

guided bomb, it is just a freefall bomb. Also, you might

try shotrocket instead of shotmissile. I just noticed that

your making a MLRS system, (guided i assume) so maybe

you should try this.

cfgammo section

laserLock=true; //allows it to lock onto laser targets

maxControlRange=10000;

initTime=0.5;

maneuvrability=10.0; // It will hit target but won't

track like a sidewinder does

maxSpeed=400;

simulation=shotmissile;

sideAirFriction=0.40;

thrust=300;

cfgweapon section

initSpeed=10; //speed the rocket will start at, should

give the rocket the effect of

accelerating from the launcher

Ok give this a try, it might work. you can of course edit any

of the speeds to make it work right. there is no special LGB

simulation, the weapon simply targets the laser target made

by the laser target designator. this is activated by

laserLock=true. Also from what i've heard, the AI doesn't

use the LGBs very well, it has to be done through scripting sad.gif

Share this post


Link to post
Share on other sites

I'm not sure that will work.

The MLRS unit we are working on isn't your standard OFP vehicle. Player's cannot directly fire the rockets. Dinger and I are working on a true ballistic weapon that can fire out to 33km.

The rockets themselves are 100% unguided. By using ballistic flight tables, we impart velocity into the rocket via setvelocity, and then a fuze time. Once the fuze runs out, the rocket explodes whereever it happens to be (usually on target).

So whether the rocket can track anything at all doesn't matter, since once it is setvelocity'd, there is no guidance whatsoever.

All we need is something capable of lasting 2 minutes and that can be fired from a turret mounted launcher.

Through my testing, I've found the only way to get something to last 2 minutes, is to set the Thrusttime to 0. Regardless of the simulation (shotmissile, shotrocket,etc), setting this to ANY value other than zero results in the rocket self destructing after about 10 seconds (about 3.2km). This isn't even within the minimum range of MLRS.

The addon is almost 100% completely working at this point. While setting thrustime to zero allows the rockets to last long enough to get out to 28km or so, the down side is, the plamen memory point does not light up.

This fine for day missions, but in night missions, it's not so great as the M26 rockets really do light up the country side and our sustained smoke trails. See http://www.ostapowich.com/joel/gaming/ofp/mlrs/ for some shots.

While we could just setvelocity ANY object, and have no problem with it lasting sufficiently long, we want the rocket to lethal along it's full flight path. So buzzing an MLRS battery in your chopper while they are firing would be unwise. Ditto being near the landing point. If struck, it will not deploy the submunition field, but odds are, will take out of the heaviest of airborne targets (as the missiles weigh quite a bit).

That brings me back to the original question.

How to make a 'shot' glow regardless of it's thrust time value. (i'm still convinced that setting thrustime to anythign but 0 causes the rocket to explode prematurely).

Thus far I think the solution either lays in

1) Finding out if DROP can be used to spawn a brilliant particle with ambient lighting effects. The beauty of this is, the particle could then be bound to the arse end of the missile and would work seamlessly regardless of how laggy your machine is.

2) Create a static light object with high ambient effect and setvelocity it after the missile trailing by ~1 meter. So far I haven't been having too much luck with this, as it would appear as though you cannot setvelocity something using a lightsource with ambient effects. Aka, something using the "fire" simulation. Basically I created a jeep shell, as I know you can toss jeeps around with ease. Changed the simulation to "fire" and added a light source. Prior to making these changes, I could toss the 'dummy rocket' around to my hearts content. Changing the simulation broke that.

I would setpos the illumination effect (which does work), but because of varying machine speeds, this isn't an option. The rockets at moving at 600m/s and it would create a very annoying stuttered light movement.

Share this post


Link to post
Share on other sites

hmm, that does sound like a problem.

Share this post


Link to post
Share on other sites

I tinkered around with some of the possible solutions.

Drop was out, as it would seem none of the particle system particles create any ambient light.

the fire and shotillumination simulations were out. Specifically, objects using the fire simulation seem not to take well to setvelocity. You CAN setpos, but trying to keep up with an object moving 600m/s wouldn't do the trick.

Ultimately, the solution I've come up with is to create a 1cm rocket with a plamen component. You can't see it during the day or night, and it lights up bright as can be at night. The pertinent details are thrust = 0, thrustime = 3 (approx burn time of an MLRS rocket),simulation = missile.

We are currently tracking each fired rocket via an event handler, for the create of the smoke effect. I plan to name the first dropped particle (outside of a loop), and do a getpos on it. This will give me the arse end coordinates of the rocket with proper elevation adjustments (the smoke particles re drop'd and bound to the rocket with a -y). I will camcreate the CoC_RocketFlare at that position, and then give it the same setvelocity vector as the missile. The net effect will be a 'rocket' (lgb) being chased by a rocket (the dud).

I'm not sure how convincing it will be at this point, but it's the solution that ought to yield the ride balance between few lines of script code (to write and execute), and appearance.

There shouldn't be any MP concerns as the eh fires on all clients (a bonus if you ask me).

Share this post


Link to post
Share on other sites

What is a "plamen component"? Is it a memory point that

defines where a missiles flare and smoke emminates from?

BTW are you part of the "Project UK forces" mod team?

cause looks like they have a pretty sweet looking MLRS

MLRS5L.jpg

MLRS1L.jpg

Share this post


Link to post
Share on other sites

Plamen is indeed a named memory point applied to the flare of the rocket. As of patch 1.85 (I believe) this flare stops burning after thrustime is ellasped... so for an LGB, plamen is ineffective.

As for the addon itself, it is a joint project between UKF and CoC (Chain Of Command). Presently we have limited modelling 'skillz' at CoC, and Jonno of UKF graciously agreed to do the MLRS truck modelling for us.

The screen shots of rocket launches and DPICM field effects are based upon the scripting that CoC is doing for the addon. With UKF's help, we're hoping to make the MLRS picture perfect.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×