OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: baikie on 13 Feb 2005, 13:10:53

Title: Gun on shoulder setcaptive true
Post by: baikie on 13 Feb 2005, 13:10:53
i want it so when anyone on a game has their gun on their backs setcaptive = true. what do i need to do (with a script of ingame) so that when a players guns out, they are not captive and when a players gun is on back they are captive.
Title: Re:Gun on shoulder setcaptive true
Post by: DBR_ONIX on 13 Feb 2005, 15:29:39
_unit = _this select 0

#loop
?(_unit combatmode = safe):_unit setcaptive true
?!(_unit combatmode = safe):_unit setcaptive false
#1
goto "loop"

;)
Not totaly sure of combatmode= bit.. There is the correct command which is...  ::)
- Ben
Title: Re:Gun on shoulder setcaptive true
Post by: RujiK on 13 Feb 2005, 18:46:08
better recheck your scripting Onix.
You only put in one "=" sign (equals), so this tells the game Combatmode=safe so that it is NOT checking the combatmode but actually setting it!

I would suggest this:

Code: [Select]
_homieG = _this select 0

#reset
@(behaviour _homieG == "safe" or behaviour _HomieG == "Careless")
_homieG setcaptive true
@(behaviour _homieG != "safe" or behaviour _HomieG != "Careless")
_homieG setcaptive false
goto"reset"

The only problem with this is that it wil not work with the player because sometimes even when you have your gun on your back your behaviour is still "Combat"!
Title: Re:Gun on shoulder setcaptive true
Post by: baikie on 14 Feb 2005, 02:36:40
thanks guys for the help, but i do want them for the player aswell as the AI, if anyone else or you guys know how to do it can you help. would setting a trigger in a script when a person select action put m16 in hand = setcaptive false and when selects action put m16 on back = setcaptive true?
Title: Re:Gun on shoulder setcaptive true
Post by: Blanco on 17 Feb 2005, 09:23:57
There was a script long time ago that did this...

I think the name of the topic was "spies" (http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=14272;start=0), nhaaa I'm sure
Well..., it's not exactly the same, but it could help...