Jump to content
Sign in to follow this  
dimdic

Commands to make an AI fire at a specific position with a specific weapon

Recommended Posts

Hi there! I want to make an AI unit (having only RPG7 as a weapon) fire at a specific position. Are there any scripting commands to do it ? Thank you.

p.s. I can't understand why i can't set the RPG7 weapon as a primary weapon !!

Edited by dimdic

Share this post


Link to post
Share on other sites

Agree with above with a caveat: This is actually a very difficult thing to achieve, especially if you want to have it at a set time (ie. fire at a target immediately on a trigger firing) and not at an enemy (ie. at a position rather than 'that enemy')

Unfortunately a search of the forums would lead to many dead ends.... for now at least; hopefully patches will fix some of the commands!

Share this post


Link to post
Share on other sites
Try these, and pick the one suitable for your situation.

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

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

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

ps.: get used to searching on the wiki when you need specific commands

Tajin, before creating a new thread in this forum, i used both the commands dofire and commandfire and the AI unit did nothing !! I also checked the command fire but with this command i can't fire at a specific unit (or position).

Share this post


Link to post
Share on other sites
Tajin, before creating a new thread in this forum, i used both the commands dofire and commandfire and the AI unit did nothing !! I also checked the command fire but with this command i can't fire at a specific unit (or position).

Ok cool, that wasn't apparent from your first post though.

I'd try something like this, if you want it to fire at a specific position, not at a unit:

person selectWeapon "RPG7V";
person lookAt markerPos "targetmarker";
person fire ["RPG7V","RPG7V"];

I'm not sure if the "fire" command is currently functional.

Alternately, try this: http://community.bistudio.com/wiki/ArmA:_Actions#USEWEAPON

Using invisible targets can also be helpful, when the unit doesn't want to target a specific position by itself.

Edited by Tajin

Share this post


Link to post
Share on other sites

Thanks a lot Tajin :) !!! I had the same thought about the looAt command one minute before you write to me :) !!! your code seems to be working !! Thank you a lot for your help !!!

Share this post


Link to post
Share on other sites

You're welcome. Glad it worked.

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  

×