OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: LimeCordial on 23 Aug 2002, 18:25:56

Title: forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 18:25:56
i want to have 2 snipers who are a group of their own, overlooking the airport on nogova. they are in the right place and everything, but i want them to start lying down and stay down throughout the mission. also, i only want them to start shooting when i give them a radio command to do so. the group is called 'snipe'.
Title: Re:forcing a unit to lie down and stay down
Post by: Messiah on 23 Aug 2002, 18:30:44
unitname setunitpos "down"

that will keep em prone

unitname setcombatmode "red"

start them on 'never fire' and then use that (i think red lets the fire and engage at will)

:thumbsup:
Title: Re:forcing a unit to lie down and stay down
Post by: Artak on 23 Aug 2002, 18:32:28
Hi Lime!

Try putting this in the snipers init field:

this setunitpos "down"
Title: Re:forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 18:34:28
can i put the groupname there or will it only work with units? because if i put the name of the commander, will the other sniper actually get down as well..?
Title: Re:forcing a unit to lie down and stay down
Post by: Messiah on 23 Aug 2002, 18:38:41
i reckon they should - since if u are prone when u are commander all yor men go prone

try it and see :thumbsup:
Title: Re:forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 19:08:12
ok, that seems to have worked...... but now i have a problem. there are enemy infantry at the base, within the sniper's LOS. but when i give them the signal they dont shoot at them. why??  ???
Title: Re:forcing a unit to lie down and stay down
Post by: Artak on 23 Aug 2002, 19:13:59
they're too far away?

try with the dotarget or dofire command. If the snipers still won't fire then they should move closer.

that'll be: unit1 dofire unit2

the setcombatmode "red" is right, I double checked it  :)
Title: Re:forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 19:17:52
they shouldnt be too far away, i gave myself a rifle and looked at the enemies, and i could see them clearly. ill try the dofire.

hmmmmmmmmm, that dont work so maybe they are too far away..........i wanted them on this hill beacuase it overlooked the airport and there is just barren land in between.

i spose ill have to look for a diffrent spot. >:( :-\
Title: Re:forcing a unit to lie down and stay down
Post by: Bremmer on 23 Aug 2002, 19:24:05
Getting AI snipers to engage from distance can be a real pain. This might help ->

Put a trigger over all the units you want the sniper to shoot at. Make it east/west present (whichever type the units are). Leave the condition as this, and make On Activation snipertargets = thislist.

Now when you want the sniper to open fire use "sniper1 reveal _x" foreach snipertargets. This lets the sniper know about all the units in the trigger, and he should now engage them.

Cheers
Title: Re:forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 19:28:16
ok i moved them and it works..........but how do i make them stay where they are?? they crawl around.........i dont want them to. :-\
Title: Re:forcing a unit to lie down and stay down
Post by: Artak on 23 Aug 2002, 19:38:27
to the init fields of the snipers:

this disableai "move"

guaranteed satisfaction with this command  ;)
Title: Re:forcing a unit to lie down and stay down
Post by: whiplash2000a on 23 Aug 2002, 19:50:08
That's one of the most helpful threads I've ever seen.

Could someone make a quick desert island mission for me with the same information from this thread. I'd like to see it work like this:

1. Player is commander.
2. The commander has two snipers under his control.
3. The snipers are set up on the ground in the prone position.
4. There is a group of unarmed east soldiers that are reasonably far away.
5. The commander gives the radio order for the snipers to fire.
6. They do.

I'm sure others could use this sample mission as well.
Title: Re:forcing a unit to lie down and stay down
Post by: LimeCordial on 23 Aug 2002, 19:51:52
YAY!  :D

it works, cheers for the help!  :)

*whispers* now, does anyone know where i can contact capt. moore?