Jump to content
Sign in to follow this  

Recommended Posts

Hi guys,

I have only found one thread which really has a decent arrest script in it whihc is this one: http://forums.bistudio.com/showthread.php?t=82474

But it is for a specific scenario, i.e. if the man has the bomb you can arrest him, so how would I put an addaction just purely to arrest the person without any variables. I want to arrest him, so he surrenders then for him to join the group he was arrested by so that he can be transported.

Is it also possible to group a team of AI to this man and when he is arrested, said group hunt him down, and essentially kill the captors?

EDIT: How do i make a conversation go on through Direct Chat, on it's own, not through the conversation box.

Cheers

Edited by Morts

Share this post


Link to post
Share on other sites

The arrest script in the thread mentioned previously makes the suspect teleport away, and looks like this

 // Grab a value for the suspect
_suspect = _this select 0;

// Remove all actions from the suspect
_action = _suspect addAction["foo", "foo.sqf"];
while {_action >= 0} do	{
_suspect removeAction _action;
_action = _action - 1;
};

// Stop the current animation and surrender
_suspect switchmove "";
_suspect playActionNow "Surrender";
sleep 3;

// Alert the soldier
hint "You send the suspect to holdover.";

// "Teleport" the suspect to holdover, a GameLogic location pre-placed.
_suspect setPos getPos logic1;

Would i just need to delete the bit where it says teleport, so it looks like

// Grab a value for the suspect
_suspect = _this select 0;

// Remove all actions from the suspect
_action = _suspect addAction["foo", "foo.sqf"];
while {_action >= 0} do	{
_suspect removeAction _action;
_action = _action - 1;
};

// Stop the current animation and surrender
_suspect switchmove "";
_suspect playActionNow "Surrender";
sleep 3;

But then how do i make the player join my group, or the group he was arrested by, on that point, does it require the section commander to arrest them?

Sorry if it sounds a bit nooby but i really dont have a clue about scripting, what is foo.sqf?

Cheers

Share this post


Link to post
Share on other sites

Instead of teleport have the unit join the unit arresting him.

_suspect setCaptive true 
[_suspect] joinSilent player 

I can't test anything right now.

Share this post


Link to post
Share on other sites

It doesn't seem to be working at all.

the unit i want to arrest is a russian officer. Name:Suspect. I've put all the script in and the init line but it's not working. What is catching my attention is foo.sqf. where has this script come from becuase i don't have it and i think that might be a reason why it isn't doing anything.

Edited by Morts

Share this post


Link to post
Share on other sites

I did forget the ; at the end of the lines.

If that doesn't work just go back to basics, forget the previous code and do the following.

put this in the suspect init and save script as arreset.sqf

act = this addaction ["Suspect","Arrest.sqf"]

_suspect = _this select 0;
_suspect setCaptive true; 
[_suspect] joinSilent player;

that will allow you to arrest the unit and have him join the player

Share this post


Link to post
Share on other sites

Wicked, thanks, that works all nice and fine.

Now for the hunting, the script that you wrote in the other thread, i gather it starts immediately, is there anyway to set it so that it only starts when the suspect has been captured.

Something like

 set true = Arrest.sqf complete.

Whether that makes any sense or not i haven't got a clue, any help will be much appreciated.

Share this post


Link to post
Share on other sites

Maybe this would work. pack1 being the name of the chasing group and prey being the suspects group name.

_suspect = _this select 0;
_suspect setCaptive true; 
[_suspect] joinSilent player;
nul=[prey,pack1] execvm "hunt.sqf";

Share this post


Link to post
Share on other sites

So using this in conjunction with the hunt.sqf will make the chasing group only chase when the suspect has been captured?

I would also have to delete pack 2?

Share this post


Link to post
Share on other sites
So using this in conjunction with the hunt.sqf will make the chasing group only chase when the suspect has been captured?

I would also have to delete pack 2?

Yes I posted it before I'd finished editing it, now corrected.

As it's untested I can't say it will do what you want but it should.

Share this post


Link to post
Share on other sites

Okay the hunting isn't working the way i've got the script is:

_hunted = _this select 0;
_hunter = _this select 1;

while {{alive _suspect} count units _hunter  >= 1  and {alive _suspect} count units _hunted  >= 1 } do {
_leader = leader _hunted;
  _leadpos = getpos leader _leader;
   _hunter move getpos _leader;
sleep 30;
};

I'm not sure if that's exactly how it should be, i tried the default one as well and I've tried naming it differently but the pack1 don't want to hunt. They stay in there positions.

Also a little sub question, is it possible for the suspect to STAY in the "surrender" position instead of going in it then coming out when he walks?

Share this post


Link to post
Share on other sites

You just need to define the suspect in the call, I'm not really sure why as you don't have to do it for the pack.

_suspect = _this select 0;
_suspect setCaptive true; 
[_suspect] joinSilent player;
nul=[_suspect,pack1] execvm "hunt.sqf";

Leave the hunt script as I had it as it seems to work without changes.

_hunted = _this select 0;
_hunter = _this select 1;

while {{alive _x} count units _hunter  >= 1  and {alive _x} count units _hunted  >= 1 } do {
_leader = leader _hunted;
  _leadpos = getpos leader _leader;
   _hunter move getpos _leader;
sleep 10+random 10;
};

They may stand idle at first for 10-20 seconds

As for raising hands I wouldn't know as I'm not clued up on animations.

Share this post


Link to post
Share on other sites

For some reason it's still not working.

I've put the scripts in exactly like them, i arrest the suspect but the hunters don't move. Does the type of group matter, they are in vehicles does it make a difference?

Share this post


Link to post
Share on other sites

It shouldn't matter, they still come in vehicles when testing.

I've copied the scripts back and they still work.

Check that the group chasing is setup correctly in the units init put pack1 = group this

Share this post


Link to post
Share on other sites

That is in the Group Leaders init field, does it have to be in every members to make them chase, because the leader probably wont be the driver?

Share this post


Link to post
Share on other sites

If your men get in an empty vehicle as long as pack1 = group this is in the init of the leader it seems to work ok.

Share this post


Link to post
Share on other sites

Right I put it in the init field of all of them and they do move to my position, they're not firing, although i'm guessing it's because i'm testing as a civillian. All seems to be good :D

Thankyou!

Share this post


Link to post
Share on other sites

Great, you'll have to let me know if they don't fire. You shouldn't have to put it in all inits though.

I think a distance check may be a good idea so the chasing group don't get to close,

If they have units onboard they could get out and chase them down on foot as well.

I don't have time today though.

Share this post


Link to post
Share on other sites

Hey again, was wondering if it's possible to hand over the suspect, to another player or AI, so it gives an Addaction like "Hand Over" and the suspect leaves your group to join the other players?

Share this post


Link to post
Share on other sites

I don't see why not, it's just a matter of deciding how you go about it.

When do you want the handover action to appear on a specific player or any player you choose.

If it's for a specific unit then put this in his

act = this addaction ["Handover","Handover.sqf"]

handover script

_guard = _this select 0;
//_suspect setCaptive true; 
[suspectname] joinSilent _guard;

This is a guess and not tested, you will have to name the suspect in his init and use that name .

If you don't know who you will hand the suspect to then you could use cursortarget to select the player/AI and add the addaction to the arrest script.

But as I don't have time to test I can't go into details.

Share this post


Link to post
Share on other sites

It will be handed over to a specific unit.

So the script would look lie this?

_guard = _this select 0;
//_suspect setCaptive true; 
[suspect] joinSilent _guard;

I'll give it a test now

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  

×