Jump to content

Recommended Posts

Hi all,

earlier somebody asked about a "Firing Drill" for AI to shoot at a target/area. I also noticed several other people over time have asked about this and got little response.

I've created this simple to use script to allow the above, it could also be used to make ambient shots at a target or for a cinematic if you needed something specific.

WHAT YOU NEED

- A game logic named "nofireobject"

- A named Target to shoot at

-WH_Firing_Drill.sqf http://puu.sh/mUJyf/a02e876d1a.txt (Also below in spoiler)

HOW TO USE

// Place into INIT field of unit you want to use the script with.null = [this,TARGETNAME,timebetweentriggerpull,#OFBULLETSTOSHOOT,waittimeafterallroundsfired]; EXAMPLES:null = [this,TARG1,0.5,6,15] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG1 every 0.5 seconds, unit fires 6 shots and waits 15 seconds to repeat after the 6 shots were fired.null = [this,TARG2,3,2,6] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG2 every 0.3 seconds, unit fires 2 shots and waits 6 seconds to repeat after the 2 shots were fired.null = [this,TARG1,2.5,30,10] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG1 every 2.5 seconds, unit fires 30 shots and waits 10 seconds to repeat after the 30 shots were fired.
TO DO:

- Allow complete end of script, so unit no longer shoots at targets.

- Ability to choose what weapon type to shoot instead of just what is currently held. [iE Missiles or Miniguns in a Pawnee] [Or a mixture?]

ISSUES:

- After firing loop, AI looks around for other threats

Share this post


Link to post
Share on other sites

Hey cool script,

 

However, I noticed that you never force the AI to reload, or give them ammo. Eventually they will run out. It might be a good idea to keep track of how many shots the unit has fired, and check if they need to reload after each shot. Then you can give them a full magazine and order a reload

Share this post


Link to post
Share on other sites

I notice another thing, that Automatic Rifleman wont fire... Otherwise, cool script!

Share this post


Link to post
Share on other sites

I notice another thing, that Automatic Rifleman wont fire... Otherwise, cool script!

By this do you mean the classtype?

Share this post


Link to post
Share on other sites

UPDATE:

- Added Infinite Ammo Loop
- Added sleep to target check to give unit time to face target
 

NEWEST VERSION FOUND:

HERE

Share this post


Link to post
Share on other sites

By this do you mean the classtype?

Yeah, even tried Heavy Gunner.

Share this post


Link to post
Share on other sites

Yeah, even tried Heavy Gunner.

Have you tried the newer version? I have tried with Autorifleman on all 3 factions and not had any troubles haven't tried Heavy Gunner as of yet.

Share this post


Link to post
Share on other sites

Have you tried the newer version? I have tried with Autorifleman on all 3 factions and not had any troubles haven't tried Heavy Gunner as of yet.

Going to test out the new version now!

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

×