Jump to content
Sign in to follow this  
Skagget

AI and shot stuff, ex doFire command, is it broken command ?

Recommended Posts

Ive tried alot with the diffrent dofire inputs. Ive done some searching through the web and this forum..

This is the setup Ive seen people saying work, but they just do a standoff and point their weapons but no fire:

badboy1 doTarget civ; badboy1 doFire civ;

have tried selectWeapon, given them weapons with addWeapon and using secweapon command, I get them pointing with firearm then but no go.. Have tried the same and with objects as per thought if they "bad guys" loves civs ;) but they mostly just point their guns on the object and hope that they can stare it to death...

Is it impossible at this update to use the doFire code, do I have to use Fire command or script events to make AI shot things ?

Im using Steam/OA and 1.56 and ACE as addon.

Share this post


Link to post
Share on other sites

I commend you on your idea because I have wanted to use this command reliably just like you. I found it took alot of effort to get the AI to fire on things in a reliable consistent fashion so I will tell you what I know to spare you the aggravation and frustration I encountered when trying this.

The problem with dofire (aside from the claim that its broken since second latest patch *not confirmed*) is that it relies on the AI "wanting" to fire on a target. So dofire will and should work if the AI "thinks" it should fire on the target, meaning an enemy/target object and close enough and other vague factors no one seems to know about. If it is too far away or if the AI is somehow not wanting to fire on the target (who knows why) then they simply IGNORE the command. Nice isnt it to see a nice scripting command and you try to use it and the stupid bot just ignores it? Haw haw right?

There were addons that used to offer invisible target objects that would make the AI fire at it and dofire would work and that was a good method for its time. Now we can use hideobject command with a popup target object close to the unit and it will seem to dofire reliably enough with no addon dependency (yay :| ). You could make a script that uses the invisible target as a close "reticule" object between the unit and a target position but it can get over complicated. I speak from experience here.

How did using the fire command work out for you? Every time Ive used it on infantry since OFP the stupid bot raises the barrel up in the air and fires and then returns to its dotarget position. Nice isnt it how you find an alternate command after finding the horrid lack of consistency with dofire to find this brand new problem....DOUBLE WHAMMY!!! By the way, vehicles dont seem to have an issue with fire command and barrel raising up, they only do it if the command is "spammed" and the AI is allready firing the last round and getting the fire command too fast, go figure....

So try to look into the useweapon action (unless that is broken as well after latest patches ha ha haaa!)

Search about useweapon in this forum and you should find a post that describes how to use it. The good thing about useweapon is that the soldier fires without moving the barrel up in the air. The bad thing is that the soldier will fire the weapon even if its slung on its back and not aimed at the target. Verifying if the unit is aiming its weapon to target (or close enough) would be the perfect thing but I havent figured that out yet and usually if I issue a dotarget and or lookat command to the unit and wait a couple seconds they seem to be aimed at the target reliably enough.

http://community.bistudio.com/wiki/Armed_Assault:_Actions_List#USEWEAPON

So there you have it. A nice wordy, ranty, vague suggestion to look into the action useweapon. I can dig up a link to the post where its use is described. Im in the thread cheering on the discovery of it because it made the whole problem alot simpler. Dont tear your hair out relying on simple methods in this. Expect alot of testing and research and after alot of effort you should get close to your goal.

Share this post


Link to post
Share on other sites

Well I solved it, so now I can have Opfor shoot objects civs or certain named things if I want without scripts or addons...

..and Im a happy camper again ;)

Share this post


Link to post
Share on other sites

Care to share your methods with the group?

Hi Im TJ72 and Im a script-a-holic......

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  

×