OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Baphomet on 10 May 2004, 00:50:05
-
I want to make a mission where as soon as you have a gun in your hand your setcaptive status goes from true to false.
Sort of for a civilian resistance type stealth mission.
Anyone know?
-
Trigger Condition=
behaviour player != "SAFE"
On Activation=
player setcaptive false
Tried it myself and seems to work as you wanted.
-
It does? I tried setting an unarmed west soldier inside a trigger to your specification and I'd just get killed (yes I put "this setcaptive true" in the soldier's initstring). I also placed a soviet squad in front of him to test the results.
Right off the bat. I had no weapon whatsoever. Bang. Dead.
I remember a mission I played had something similar to what I need. I don't know what it was called again. Oh well. Thanks anyhow.
-
In the player's init field add
this setbehaviour "SAFE"
Even if he doesn't have a weapon, he starts the game out in an "AWARE" stance...I assumed you already had him starting out in "SAFE" so he looked like he was unarmed and just walking. My mistake. :)
If you want a more robust trigger, change the trigger condition to this and see how it works:
(behaviour player !="SAFE") && (count weapons player > 0)
The problem I found with this is - if the player is in SAFE, but then pulls a *pistol*, OFP doesn't regard that as a change behaviour. But if he is in SAFE and unslings his rifle, OFP does regard that as a behavior change. If the player pulls his pistol AND then kneels or goes prone, then OFP changes his behaviour too and the trigger will fire.
So it will work best with primary weapons only (no pistols).
-
And btw - OFP should also regard a behaviour change
in case the player has no weapon but goes prone.
tho still not tested yet
~S~ CD
-
Thanks for expounding a bit more on that Kammak.
I think I'll just toss the whole behavior state bit and...
Well I was looking at that forum thread in which it discussed the knowsabout command.
I'm assuming with this command I could create two criteria in which first the entities in the array must know enough about the target (player and cohorts) and the player must be armed. This would be much more immersive than say just picking up a weapon and being shot at by enemies who haven't even seen you yet.
I suppose for what I'd need I would probably have to create a script and an array of units for each element then use the knowsabout command for each group of units. Then reference them in such a way that can be used by the command. Ie _Guard-NW knowsabout _goodguys > x
I really want to try and make a multiplayer mission where you move about town and try to avoid being sighted by troops with weapons on your person.
The knowsabout command looks like it'd be the ticket. Only I'm not sure how to go about it.
-
Ok...
I tried a test of it. The concept works to my satisfaction.
Only with my limited knowledge I could only simulate it with one group.
Basically I put in the leader of the group's initstring
"kilo = group this"
Then set my guy to captive.
Placed in the trigger the additional criteria:
(kilo knowsabout player > 1) && (count weapons player > 0)
This way they sort of have to get a good look at the guy before they realise. "Hey! He's got a gun and he's not one of us! Shoot him!".
Only thing is. The mission I'm making involves many groups of units. Is there any simple way of including them all into one generic trigger or am I in for a lot of work?
Anyone?
-
why don't you use Chrashdome's spies script?
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=14272
-
I didn't know they had something like this. It's cool. Thanks for pointing it out. However I still think the knowsabout query would be useful. Even to his script. Because I tried it and you can pull out a gun and even if the soldier's back is turned to you he'll immediately pull out his weapon and shoot.
At least with the knowsabout command you can set a higher limit to which they must know about you before they decide you're a hazard to their health.