Home   Help Search Login Register  

Author Topic: Switch setcaptive if holding a weapon  (Read 1167 times)

0 Members and 1 Guest are viewing this topic.

Baphomet

  • Guest
Switch setcaptive if holding a weapon
« 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?

Kammak

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #1 on: 10 May 2004, 06:44:30 »

Trigger Condition=

Code: [Select]
behaviour player != "SAFE"

On Activation=

Code: [Select]
player setcaptive false

Tried it myself and seems to work as you wanted.


Baphomet

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #2 on: 10 May 2004, 20:45:05 »
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.

« Last Edit: 10 May 2004, 20:45:39 by Baphomet »

Kammak

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #3 on: 10 May 2004, 22:57:59 »
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).



Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Switch setcaptive if holding a weapon
« Reply #4 on: 13 May 2004, 13:04:58 »
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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Baphomet

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #5 on: 13 May 2004, 21:07:39 »
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.
« Last Edit: 13 May 2004, 21:13:08 by Baphomet »

Baphomet

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #6 on: 13 May 2004, 21:38:54 »
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?

« Last Edit: 13 May 2004, 21:39:50 by Baphomet »

Offline Blanco

  • Former Staff
  • ****
Re:Switch setcaptive if holding a weapon
« Reply #7 on: 14 May 2004, 20:45:39 »
Search or search or search before you ask.

Baphomet

  • Guest
Re:Switch setcaptive if holding a weapon
« Reply #8 on: 16 May 2004, 05:53:48 »
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.
« Last Edit: 16 May 2004, 06:00:56 by Baphomet »