Jump to content
Sign in to follow this  
sweofp

Tricky!

Recommended Posts

Hello!

I´ve been searching for a couple of days here and at ofpec and so on...

Here we go!

I want the player (east) to have the choice of surrendering (addaction?), but if he takes any weapons he after he has surrender he will be treated as the enemy again?

Any ideas of how to solve this?

confused_o.gif

Share this post


Link to post
Share on other sites

i am not sure what exactly youre after, or what you acomplished so far - could you be more specific?

You want to make the player captive when he puts down all weapons?

You can create a switch for that, or a script loop, whatever, which will do "player setCaptive true" when it detects the player has no weapons.

If i understand it correctly, you did that already, yes?

But the problem is, when the player pickups any weapon, he will automaticaly loose his 'captive' attribute???

Then you probably did something wrong, i have just tried it to be 100% sure, and by simply picking up a weapon AND even killing whole group of soldiers, wont break the captivity.

You must have some logical error, because of which, the unit is set back to setCaptive false.

Post the script you are using.

Share this post


Link to post
Share on other sites

I read your post again, and i think i understand it now.

You actually want it to set player captive when he puts down all his weapons, and when he is captive and he pickups any weapons, you want him to loose his captivity.

Then do this:

Create a trigger of type "SWITCH", activated "Repeatedly", and put the following into its condition field:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count weapons player > 0) or ("HandGrenadeTimed" in magazines player) or ("HandGrenade" in magazines player)

...then put "player setCaptive false" (without quotes) into the 'On Activation' field, and "player setCaptive true" (again, without quotes) into the 'On Deactivation' field.

Share this post


Link to post
Share on other sites

Tanks for the help now it works.

If I now want the the player (after surrendering) to be captive with an enemy squad?

He needs to follow them somewere and so on, and if he gets further away then say 25 meters from his guards he will be setcaptive false.

Any ideas?

Share this post


Link to post
Share on other sites

Check out the distance command, not quite sure when you want the distance to be checked. If you want the player to be captive the moment he has no weapons AND is less then 25 meters to the squad leader then you could fit it into the trigger.

Replace the current condition with the following...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(count weapons player > 0) or ("HandGrenadeTimed" in magazines player) or ("HandGrenade" in magazines player) and player distance (leader groupEnemy1) > 25

Make sure you put groupEnemy1 = group this, into the enemys leaders init field and then the moment the player is less then 25 meters from the enemy leader and has no weapons then he is a captive.

Depends on how you want things to work really.

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  

×