Jump to content

Sign in to follow this  
redstar90

How do I make my soldiers shoot enemies on sight ?

Recommended Posts

Hello.

I'm a new-comer, I'm trying to learn how to make proper missions :). Please forgive me if this question has been asked before.

I want my unit to immediately start shooting a group of targets, finish them off, and then advance to activate a trigger which will bring target reinforcements.

How can get my unit to shoot the targets on sight, without waiting for orders or radio messages ? I've tried to select "Open fire" option from the waypoints, but it didn't help.

Thanks in advance.

---------- Post added at 09:11 ---------- Previous post was at 09:08 ----------

Here's a picture of the map :

http://tinypic.com/view.php?pic=k13ouo&s=5#.UkP3oNKnrxQ

Basically what I want is to let my soldiers stay at the red circle and engage targets from there.

Share this post


Link to post
Share on other sites
  ProfTournesol said:
Well, that's what they normally do...

They don't unfortunately. They just stare at the targets. They won't shoot unless I put a MOVE waypoint and get them really close to the targets.

Share this post


Link to post
Share on other sites

I tried different waypoints "seek", "seek and destroy"... None of them helped.

Share this post


Link to post
Share on other sites

It contains custom made addons (flags, textures ..etc). Forgive me if I'm wrong, but I think that it doesn't work unless you have the same addons, does it ?

Share this post


Link to post
Share on other sites
  redstar90 said:
It contains custom made addons (flags, textures ..etc). Forgive me if I'm wrong, but I think that it doesn't work unless you have the same addons, does it ?

Nope it won't work.

Edited by ProfTournesol

Share this post


Link to post
Share on other sites

Two more images to demonstrate this issue :

1- You can see the the targets are almost right in front of my soldiers, but they aren't shooting !

http://tinypic.com/view.php?pic=ff7lte&s=5#.UkQA1dKnrxQ

2- A closer look with binoculars.

http://tinypic.com/view.php?pic=2qmiu0w&s=5

Edited by redstar90

Share this post


Link to post
Share on other sites

Yep, maybe it's a little too far for the AI to notice their enemies. What's happening if you take binoculars, aim at an enemy soldier - as in your picture - and double right click on him ?

Share this post


Link to post
Share on other sites

It works, but I want them to immediately shoot at them without waiting for my orders. Is that possible ?

Share this post


Link to post
Share on other sites
  redstar90 said:
It works, but I want them to immediately shoot at them without waiting for my orders

So that's because they are too far from the target to recognize them (sometimes it's related your view distance settings, or to the time of the day or weather conditions).

Another way is to reveal to the AI the presence of their enemies with the reveal command, or add a sniper to the team.

Share this post


Link to post
Share on other sites

Ok. Thanks for help. One final question : Can I have all the targets revealed at once ? Or should I add a command for each one of the targets ?

Share this post


Link to post
Share on other sites

To reveal all units of a group to the player's group :

{group player reveal _x} foreach units enemy_group_name

To reveal individual units to the player's group :

{group player reveal _x} foreach [unit1,unit2,unit3]

Share this post


Link to post
Share on other sites

Before trying the 'reveal' thing, you can also try commands like 'doTarget' and 'doFire'.

Share this post


Link to post
Share on other sites
  vitamin said:
Before trying the 'reveal' thing, you can also try commands like 'doTarget' and 'doFire'.

Nope, cause it won't make them engage target autonomously, but simply fire at designated target.

Share this post


Link to post
Share on other sites

And that's what the OP wants I guess - 'shoot on sight'.

Edited by vitamin
spelling

Share this post


Link to post
Share on other sites

hi,

As Prof said with the reveal command but only one unit in the player's group have to reveal the targets array, it should do the trick and save a bit performance. The info will be shared automaticly between all player's group members.

{unitName reveal _x} forEach [unit1,unit2,unit3]

You can also increase the viewDistance to 1600 so the AI will spot enemies from farer away.

setViewDistance 1600

cya.

Nikiller.

Share this post


Link to post
Share on other sites
  Nikiller said:
hi,

As Prof said with the reveal command but only one unit in the player's group have to reveal the targets array, it should do the trick and save a bit performance. The info will be shared automaticly between all player's group members.

{unitName reveal _x} forEach [unit1,unit2,unit3]

You can also increase the viewDistance to 1600 so the AI will spot enemies from farer away.

setViewDistance 1600

cya.

Nikiller.

Thanks, but excuse me for my ignorance (I'm a newbie) : Where should I put the "setViewDistance" code ?

Share this post


Link to post
Share on other sites

hi,

  redstar90 said:
Thanks, but excuse me for my ignorance (I'm a newbie) : Where should I put the "setViewDistance" code ?

Open the notepad and write setViewDistance 1600 in it, save it as init.sqs (be carefull to don't save it as a txt file) and put it in your mission folder. the init.sqs will be loaded automatically when the mission begins.

More in fo about the init.sqs here: https://community.bistudio.com/wiki/Init.sqs

cya.

Nikiller.

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  

×