Jump to content
Sign in to follow this  
00dc15

I Would like help with the laser designator & AI

Recommended Posts

So here is what I'm trying to do, I need to know if a non player controlled AI can see an object or not, after 1 weeks testing (I exaggerate not) and multiple spreadsheets/ line graphs of Knowabout values vs distance vs building positions I've not come up with a good enough method.

My next line of approach is to give the AI a laser designator (as the laser dot is stopped by obstructions) & have him target the object (which at present is just under the surface (ie Hidden), now this part works but what I can't do is get him to turn it on (unless the target object is an enemy armoured vehicle). Now it seemed to me to be a simple case of getting him to fire it, but no, firstly when I fire it an eventhandler "fired" doesn't even trigger & secondly I've tried both giving him a fire command using laserdesignator, binocular & nothing as the muzzle, then laserdesignator, binocular & nothing as the mode, then laserbatteries as the magazine & also a dofire command.

So my question is how or even is it possible to have him turn it on, before any suggestions are made of setting an enemy armoured vehicle below the ground, I've tried it & he won't target it in the first place & the hide command has the same problem.

I've searched most forums for information about this & also looked into the config.bin file in weapons & found a laserdesignator section, but this still doesn't help me much.

Thanks for any help.

Regards

James

Share this post


Link to post
Share on other sites

You gave him batteries for the LD right? :) Nm, you did. Is the object you're trying to get him to lase a valid target?

Share this post


Link to post
Share on other sites

The lack of an invisible target is a pain in the backside and I usually like to have a bit of a moan about it now and again, BIS don't seem to want us to have one.

We did have a way around this using deletecolletion however the way in which it functioned was changed and a new command hideobject true was introduced but lacked the same functionality.

delletcollection made an object invisible but left it targetable, hideobject lacks that option. :mad:

I don't think it's possible for the AI to target none threatening objects.

The only thing I can think of which I haven't tried yet is to see if the AI with a laser designator will target a spawned lasertarget. I know it's back to front but it may work for them as it does for pilots.

Share this post


Link to post
Share on other sites

Hi Kylania,

Well possibly not, at present it's a Danger sign, but what I've got so far is get him to target it, select his laser designator then when he's looking at the sign through it, I've disabled his animations. Then all I need is a way to tell him to turn the thing on (which for me is 1 very simple mouse click, perhaps he needs a mouse but I can't find one under objects).

Hi, F2K Sel,

Thanks for your answers, I thought I could do it with the hide command but it didn't work how I thought it did. I have to hope there is a way to do something (puts his knows nothing about game mechanics hat on) so simple when as above I said it's 1 simple mouse click for me.

The only last resort I could think of would be to have a 2nd designator that does not need switching on but is on all the time. However I have no idea if thats possible let alone where to start with addon making.

Regards

James

Share this post


Link to post
Share on other sites

If you can animate the AI to use his LD then why not just spawn the dot on whatever target you like. I know that works, I use it when bombing a city.

I first place a pallet named targ as you can attach a LT to it and then place it in the air a little so it can be seen easily. You wont see the pallet just the dot.

lase = "LaserTargetWstatic" createVehicle [getpos targ select 0,getpos targ select 1,0];lase attachto[targ,[0,0,4]];targ hideobject true;plane dotarget lase

It's the only way I can get them to correctly bomb whatever I tell them to without using complex scripting.

"LaserTargetW" is an invisible target not seen by the player.

The plane won't fire on the first fly past unless told of the target plane dotarget lase improves the chance of a first time attack even then it still needs to see the target so if it's climbing it will till not fire on the first run. Try and have the plane doing a little dive and it will fire more readily.

To delete the target you could group a trigger to the building or vehicle set to static oblejct not present and then in the on act box put deletevehicle targ;deletevehicle lase

Edited by F2k Sel

Share this post


Link to post
Share on other sites

@ F2k Sel,

I think I've not explained myself correctly, I don't what him to use it for that purpose, what I'm trying to do is find out if an AI can see a certain object & I'm only using the laser designator because I know a) the dot doesn't go through buildings (so LOS is not possible) and b) I can find out with nearestobjects if the laser dot is near the object I'm trying to see that he has LOS to.

Sorry I'm not really sure I've explained it any better but hopefully I have.

But thanks for your input & example.

Regards

James

Share this post


Link to post
Share on other sites

@ Kylania,

Perfect, thanks alot for the link, I somehow missed this thread. All I need to do now is see how it works and run some tests with it, once again thanks for your help.

Regards

James

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  

×