OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ding on 25 Jun 2005, 12:09:33

Title: Yet Another Question
Post by: Ding on 25 Jun 2005, 12:09:33
is there any possible way for a triggerto be activated the second a player takes the gun off his back?
Title: Re:Yet Another Question
Post by: OFPfreak on 25 Jun 2005, 12:45:29
I'm not sure but I think this should be possible. In the first mission in the American campaign of OFP you will have to get back in line with your gun on your back after running to the truck. The only thing is, I don't know the command.
Title: Re:Yet Another Question
Post by: bedges on 25 Jun 2005, 13:10:02
@ofpfeak - posts like that are less than helpful.

@ding - use the behaviour (http://www.ofpec.com/editors/comref.php?letter=B#behaviour) command. gun on back is "safe", gun in hands is "aware/combat". to check it in a trigger, use this in the condition field -

Code: [Select]
((behaviour player == "aware") or (behaviour player == "combat"))
that should do the trick.
Title: Re:Yet Another Question
Post by: CrashnBurn on 25 Jun 2005, 13:52:52
or alternatively-

(behaviour player != "safe")
Title: Re:Yet Another Question
Post by: Ding on 25 Jun 2005, 14:23:22
hmm no.. it dosnt seem to work properly. here is the scenario:

i start in a little coartyard in Lipany, there is a Cop in the street, i buy a glock from a guy at a gun stall in the coart yard, i put the gun on my back, i walk out into the street.. now what i want to do here is to when i take my gun off my back he starts shooting at me, but while i do have my gun on my back he dose nothing.

so i have made the trigger in the street with:
((behaviour player == "aware") or (behaviour player == "combat")) && this
in it, i walk out into the stret with gun on back and get shot :(, happens when i dont have a gun too, same thing with:
(behaviour player != "safe") && this
the player always even without a weapon seems to be either aware or safe
Title: Re:Yet Another Question
Post by: bedges on 25 Jun 2005, 14:51:56
okay, i take it you're using 'setcaptive' to make the player invulnerable until the weapon comes out?

i've just tested this and it does seem that the player's behaviour mode won't go from 'aware' to 'safe' when the weapon goes on the back.

i would suggest explicitly setting the player's behaviour to 'safe' when you buy the weapon - that way you have a guaranteed starting point.

as an aside, it may not matter much, but i'd put the 'this and' before the other stuff in the trigger's condition field, not after...
Title: Re:Yet Another Question
Post by: Ding on 25 Jun 2005, 17:13:49
well what actually is happening is that the Player is a friendly until he activates the trigger which causes a script which sets his rating to -9999 and adds a weapon + ammo to the police officer, so i dont use the setcaptive command
Title: Re:Yet Another Question
Post by: Planck on 25 Jun 2005, 18:34:48
I think a rating of -9999 will just about guarantee you will get shot.


Planck
Title: Re:Yet Another Question
Post by: Ding on 25 Jun 2005, 21:01:05
but it only happens when the trigger is activated, and i dont want the trigger to be activated until the player has there weapon out