OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Drozdov on 30 Sep 2003, 12:56:23

Title: Stopping a unit firing
Post by: Drozdov on 30 Sep 2003, 12:56:23
How can you stop a unit while it's firing on something? I have a cutscene in which three GIM Tossers are told to chuck their rocks at a guy. I want them to stop once they've hit him or until about 10 seconds have elapsed. There doesn't seem to be any 'holdfire' command and 'setcombatmode blue' has no effect. How do I stop them targetting their target?
Title: Re:Stopping a unit firing
Post by: KyleSarnik on 30 Sep 2003, 13:06:57
Try setcaptive true if hes an enemy. Or removeallweapons on the GIM Tossers.  You could also try WPs.
Title: Re:Stopping a unit firing
Post by: Komuna on 30 Sep 2003, 16:17:37
Theorically, _Unit setCombatMode "BLUE" (ALLCAPS), should work.

There's also the removeMagazines command (_unit removeMagazines "Rocks") and the disableAI:

_Unit disableAI "TARGET"
_Unit disableAI "AUTO TARGET"


--- Edit ---

I've just noticed that you, Drozdov, have missed the quotes on the "BLUE" (String). It should solve your problem.
Title: Re:Stopping a unit firing
Post by: ACF on 30 Sep 2003, 18:22:31
SetCombatMode "BLUE" should work, but takes time before it kicks in.  CfgVehicles has an intriguing variable MinFireTime.  If this is the minimum period a unit will fire on its current target, (a reasonable guess?) the 20 seconds it's set to is a l-o-n-g time to be under fire.  The next command doesn't seem to  initiate until tht 20 seconds is up.  A target might survive rocks for that period, but not much else.

DisableAI might be a bit severe as it can't be re-enabled and removing weapons/mags seems clumsy, but probably OK for a cutscene.

SetCaptive true is perhaps the neatest solution if it has an instant effect - wish I'd thought of that one, want to get home and try it now . . .
Title: Re:Stopping a unit firing
Post by: Kaliyuga on 30 Sep 2003, 21:10:50
CfgVehicles has an intriguing variable MinFireTime.  If this is the minimum period a unit will fire on its current target, (a reasonable guess?)


Code: [Select]
minFireTime=20; // minimal time spent firing on single target

indeed it is ;)
Title: Re:Stopping a unit firing
Post by: Drozdov on 01 Oct 2003, 20:05:42
I didn't miss out the "" when I wrote it in my mission, just when I wrote the post. But the setCaptive true would work... don't know why I didn't think of that myself...