Jump to content
Sign in to follow this  
zootia

Can I get AI to laze targets?

Recommended Posts

I'm working on a map where you can practice bombing targets with the GBUs.

So far I had a human do the job, but my clan mates are getting bored of just standing there holding the laser painter up.

So, I plan to replace them with a AI recon guy. However, the question arises, How can you make AI laze targets and is it even possible? Should I use waypoints?

Help me out fellow mapper!

Share this post


Link to post
Share on other sites

If he can see the target he should do it automaticly. Does for me anyways...

Share this post


Link to post
Share on other sites

Make sure the AI can see the target, Put a trigger in the area that will encompasses the AI from where he sits to laze the target and in the "On Activation" field put...

AI name DoTarget "name of target";AI name DoFire "Laserdesignator"

Group the trigger to the AI and set it to vehicle present.

This should work.

Share this post


Link to post
Share on other sites

I dunno, if I put in

recon DoTarget "tank"; recon DoFire "Laserdesignator"

in the space I get an error. "Dotarget type any expected array, object"

This is my first time scripting so could you be more specific?

and whats vehicle present?

Share this post


Link to post
Share on other sites

Okay, I got rid of the "" at the names and it works now.

However, the dude just targets it for a second and puts his designator away. How can I have him hold it up?

Share this post


Link to post
Share on other sites

copy this to notepad and save it as laze.sqs.

You will need to add the unit and taget names to the commands.

~.5

AI name dotarget target1

#loop

~.5

AI name dofire weapon name

?alive target1 : goto "loop"

?!alive target1 : goto "next"

#next

exit

You can add more targets by copying the contense below #loop and changing the target names to the #next section. If you do remove the exit and make a #next1 and put the exit there. If you want 50 targets make a #next51 and add the exit. You will also have to change the #loop to #loop1 etc.

In the trigger you made for the AI remove the commands from the on activation and add [AI name] exec "laze.sqs"

Put the sqs file in the mission folder.

Share this post


Link to post
Share on other sites

Okay, using that script, the dude lazes the target for a second, puts the designator away, pulls it back out, and then lazes it again for a second. * repeat infinitely.

Is there no way to keep a prolonged laser painted on the target?

Share this post


Link to post
Share on other sites

You could try using disableAI to take away his "free will". He will still target objects and fire weapons if you give him the doTarget and fire commands.

Share this post


Link to post
Share on other sites
how do I "disableAI"?

Put this code before you make him laze something:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">aiSoldierName disableAI "AUTOTARGET"

aiSoldierName disableAI "MOVE"

I'm pretty sure that should do the trick, but I can't test it myself right now.

Share this post


Link to post
Share on other sites

Nope, that didnt work either sad_o.gif

Is there any way I can take away all his weapons so he only has a laser designator? that way he wont keep changing to his primary

Share this post


Link to post
Share on other sites

removeallweapons this;this addmagazine "Laserbatteries"; this addweapon "Laserdesignator";

give this to any soldier type.

Group the harrier to an officer on ground with ai laser designator guy,always works.3 man team always works for me.

Share this post


Link to post
Share on other sites

could you elaborate on that doc? Do I have to use a laze.sqs script or what?

specific step by step would be nice. Like I said, I m new to this whole mapping thing but everybody is kinda replying thinking I can follow all this

Share this post


Link to post
Share on other sites

If you don't need to see the AI using the designator, you could just create the laser target object, when and where you need it with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Target="LaserTargetW" CreateVehicle _TargetPos

Although you will have to handle the targets yourself with a trigger or script.

Share this post


Link to post
Share on other sites

lol dallas. that works. tanks for all you guys that helped out

Share this post


Link to post
Share on other sites

Lol zootia, what on earth were you trying to do before that?

Share this post


Link to post
Share on other sites

I was messing with scripts and triggers and waypoints sad_o.gif

Share this post


Link to post
Share on other sites

Thats true, I didnt think of that. Just change the script I put up, to make a lazer dot on the target until its destroyed.

Share this post


Link to post
Share on other sites

I tried to make laser target with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">laser="LaserTargetW" CreateVehicle getpos target

but the laser target disappears 8 seconds after it has been created. Can anyone tell me how to make the laser target to stay until I remove it? Or is this a bug?

Share this post


Link to post
Share on other sites

talking about weapons and scripts.. maybe some OT but.. whats the name for the GBU?

made a trigger, where some planes flyed through, with the trigger:

this dofire GBU but got error message when they flyed into.. what is the name of the ammo?

Share this post


Link to post
Share on other sites
Quote[/b] ]but the laser target disappears 8 seconds after it has been created

Yeah sorry, I forgot about that. You have to keep setposing the target above ground. Something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Pos=GetPos _Target;

_Pos Set [2,(_Pos Select 2)+3];

_Laser="LaserTargetW" CreateVehicle _Pos;

WaitUntil

     {

     _Laser SetPos _Pos;

     !(Alive _Target);

     };

DeleteVehicle _Laser;

Quote[/b] ]this dofire GBU   but got error message when they flyed into.. what is the name of the ammo

You need to use the fire command instead.

Use this line in the vehicles init field, if you don't know what the weapons are called.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Hint Format ["Weapons %1",Weapons This]

Share this post


Link to post
Share on other sites

Has this method been confirmed working UNN? smile_o.gif

Thanks,

ARMAVIDZ

Share this post


Link to post
Share on other sites
I tried to make laser target with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">laser="LaserTargetW" CreateVehicle getpos target

but the laser target disappears 8 seconds after it has been created. Can anyone tell me how to make the laser target to stay until I remove it? Or is this a bug?

http://community.bistudio.com/wiki/Target

This is all info I could find about "Target". Where did you come up with this "LaserTargetW" thingy?

Are there other types of target objects available?

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  

×