Jump to content
Sign in to follow this  
Ronin[NR]

How to... Individual Ability to captue Officer.

Recommended Posts

Heya ppl..

I could do with a little Help with an Idea that I have and would like to implement.

I have 2 MP groups - Alpha and Bravo - Alpha is a 9-man Ranger team, and Bravo is a 4 man recon team. I have a small communications outpost, patrolled by a small enemy unit, with an officer @ the Outpost.

When the attack starts, The officer will start to make a run for it (gets in jeep and Flees). Their are a couple of things I would like to be able to do.

First off, If the officer manages to get in the Jeep, and the jeep is damaged (Shoot out Tyres), How would I get him to abandon the Jeep and start to run on foot?

Secondly, If I find a solution to the above, How would I give the ability for any member of both Alpha and Bravo squads to capture the officer while hes on foot, so he can spill the beans with Intel which can be used (Which I got Covered)

I know how to do this for a specific member of a group, but I want anybody to b able to capture this Guy and give him a good kicking   MP stuff like this is abit difficult for my Dumbass to fathom heh  

As always, your help would be much Appreciated..

Thanx in Advance.

Share this post


Link to post
Share on other sites
Quote[/b] ]First off, If the officer manages to get in the Jeep, and the jeep is damaged (Shoot out Tyres), How would I get him to abandon the Jeep and start to run on foot?

I believe this will happen automatically.

If you put into the Officer's INIT line (in the mission editor):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setCaptive true

will cause all AI friendlies to not open fire on the Officer (and thus ruin the mission)

THEN

create a trigger and put in condition line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(player distance officer < 1)

put in activation line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">doStop officer

The officer will stop moving once a player has come within 1m of Officer (for about 3 seconds). You can change the distance by changing the 1 to some other number.

Also, replace officer with the variable name you gave the officer in the mission editor. If you didn't give him one... just use "officer" ;)

Share this post


Link to post
Share on other sites

Thank you for your Quick and informative Reply...

The above solution is a really good idea and it would work - But would it work for MP players? I do have a small trigger, activated by West tht is effectively stuck onto the Officer, so tht any west player who gets within 2 metres of the officer, would activate the trigger. What I need to know is How do I activate this script with an action command? From this I would then like to script the officer with anims so tht he cowardly tells his captore Information we require.

After this, has been done, I would then like this officer to follow the captor to a pre-arranged holding point for extraction.

Can this be done?

Share this post


Link to post
Share on other sites

I'll try and make it abit more clear...

I making the mission MP and need to have any unit from both Groups - Alpha and Bravo - to be able to have this officer follow them to the holding area.

The distance thing won't work because I am not specifing a single unit who will capture this Guy. The officer is called rebeloff1 and I have a west present trigger tracking the officer, so tht if any west guy gets near him he will surrender, But..I have no idea of how to get the officer (rebeloff1) to follow the captor (Playable Dude who activates the trigger), be him from either Alpha or Bravo Squad...

Share this post


Link to post
Share on other sites

Can you script?

Instead of using a distance check, you can use 'addAction' to add a capture action. It's got about a 5m radius and would work well because it has the action caller as a parameter.

Share this post


Link to post
Share on other sites

I can script, pretty novice stuff and not very well, but I know alittle...

Could you provide an example of how to implement what your saying please?

I'm assuming the action would be added to the officer and then the Playable Guy would be able to select this action once he gets within the action radius, consequently executing the surrender script, What I can't figure out though is how OFP is gonna know who has activated either the trigger or the action command and have the officer follow this person in an MP environment...

And another thing I having difficutly with, If the officer is killed by a human player(accidently biggrin_o.gif ), I don't want the surrender to take place, I have tried:-

?!alive rebeloff1:goto "exit"

*rest of the script tht would take place if officer still alive*

#exit

exit

Is this right? If not, could somebody clarify this for me please..

Also, How do i check if the officer is in the jeep, so tht if the surrender script is activated, either by West present trigger of Action command, he will get out of the jeep and then carry out the rest of the surrender script...

And Thank you soo much for your input, Much appreciated - Thank you..

Share this post


Link to post
Share on other sites

OK... you must do the following:

Init line of officer:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setCaptive true;actionID = this addaction ["Capture Officer","capture.sqs"]; this addEventHandler ["killed",{rebeloff1 removeaction actionID}];

script capture.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

rebeloff1 removeaction (_this select 2)

your surrender stuff.....

[rebeloff1] join group (_this select 1)

exit

This will add an action to the officer where players can activate an action on their menu when they get close enough to the officer. Once that happens the action goes away (for that player only) and joins that player's squad. The player can then order them around like one of their units. The benefit to leaving the action on other players menus is if the first player dies after capture for some reason... the other players can re-capture the officer into their squad and continue the mission.

The action will not be available while the officer is in a vehicle (I think) so the players will need to force the officer out of the vehicle to capture him (a bit more realistic... no?). Simply shoot out the tires as you originally wanted (or smash his vehicle off the road)  smile_o.gif

If the officer is for some reason killed by a player... the action will be removed by the "killed" eventhandler.

Share this post


Link to post
Share on other sites

Oh tht is Just Sweet biggrin_o.gif

Thank you so much Crash Dome - Will Send it to you when I finished the mission, or maybe you can join us for a game on our Server some time...

wink_o.gif

C soon m88 and Thanx again..

blues.gif

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  

×