Jump to content
Sign in to follow this  
commiejoe

Question concerning dofire

Recommended Posts

Hello,

I am trying to get a unit (p0) to fire on a target (t0)

p0 initline: p0 commandtarget t0; p0 doFire t0

resulting action unit targets t0 but does not fire

How do I make the unit fire on the given target?

thank you

Share this post


Link to post
Share on other sites

Look into the Fire command. You can force a unit to fire a single shot.

Cheers

GC

Share this post


Link to post
Share on other sites

I tried this and it doesn't want to work, even if I use a trigger...

Share this post


Link to post
Share on other sites

Have you tried other combinations?

dotarget + (do)fire

comandtarget + comandfire

Is your target valid? The a.i. might refuse to atack a T72 with a handgun...

Share this post


Link to post
Share on other sites

Yes I have tried all those combinations

At the moment I am just trying to get a soldier to shoot at a barrel and even that won't work.

Share this post


Link to post
Share on other sites

A barrel is no valid target for AI.

You can use

unitname1 fire "M4AIM"

where you replace the "M4AIM" with your respective Muzzlename of the weapon used by your unit but the fire will be undirected and even if you let your unit target the barrel first the unit will fire into the air only with this command.

One way to achieve what you want is to use the setfriend command as objects are empty side and empty side = civillian. So if you set civillians hostile to your units side it will be attacked. Unfortunally this will change the status of all custom placed map object at once, so if you got more empty objects placed around they will all get attacked once the setfriend status is changed.

Share this post


Link to post
Share on other sites

Not only that but i believe that killing barrels gives you negative rating (like shooting friendly units, vehicles or civilians) so the a.i. wont atack barrels..

You can test this in the editor, kill some barrels and see if friendly a.i. get pissed and come after you.

Basically the a.i. considers anyone atacking oil barrels to be an insurgent pistols.gif .

More on topic:

I think these comands work just like ingame, even if you are group leader and order the a.i. under your comand to target and fire at a target they wont atack invalid targets.

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  

×