Jump to content
Sign in to follow this  
NickThissen

Play as civilian prisoners and escape

Recommended Posts

Hi,

I want to make a co-op mission where players play as Civilian people and are taken captive in an enemy camp. The objective is to escape the camp, which they'll likely have to do by finding weapons, silently killing guards and taking their clothes and weapons, etc.

How would I set this up? I have tried various things but none seem to work. By default, enemies (opfor) don't react to civilians at all. I found a trick to make them hostile against civilians: group a blufor player to the civilian group and then set his probability of presence to 0. That works, the opfor AI is now hostile against me, but that's not very realistic for a prisoner either as they shoot me on sight. So I used setCaptive to make myself a captive player. That basically brings me back to square one, they don't even react to me. I can steal a gun right in front of their eyes, shoot their buddies, strip down and steal their clothes and they will just stand there looking at me like it's ok :confused:

What I want in detail:

- Start out as captive so enemy does not shoot on sight, but is hostile.

- When I do something suspicious, such as picking up a weapon, lift the captivity and make them attack me.

Is this possible? Thanks!

Share this post


Link to post
Share on other sites

You'll probably have to use triggers with setCaptive. You can change it to false when ever you want and the opfor units will start engaging.

Share this post


Link to post
Share on other sites

How do I fire a trigger on "doing something suspicious" though? I was hoping there was a good way / trick to let the game figure that out, just like you can trigger on 'detected' I was hoping you can trigger on 'being suspicious'. I suppose I'm asking for too much though...

Anyway I would not have a clue on what trigger to set the captivity in this case.

Share this post


Link to post
Share on other sites

You have to define what 'suspicious' means in the game, A3 won't do it on it's own. You can do so by creating a couple of functions. For example, a prisoner with a weapon is definitely 'suspicious', so you could put this in your init.sqf:

Check_Weapon = {
private ["_unit","_return"];
_unit = _this select 0;
_return = false;
if (count weapons _unit > 0) then {_return = true};
_return;
};

-> that is heavily simplified. Anyways, this way you created a function to determine if a unit has a weapon, it will return true or false if you use it like this:

if ([unitname] call Check_Weapon) then {unitname setcaptive false};

You can either create a bunch of these functions or even create just one with a bunch of parameters. For example, I guess a prisoner not being in a certain spot (cells etc) would also not be in the interest of a guarding enemy, etc.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×