Jump to content
Sign in to follow this  
icfhoop

Hunted

Recommended Posts

Hello all, I am making an Escape and Evasion mission called hunted. Now I was wondering if there is a way where i can make it to were OPFOR are chasing/hunting the BLUFOR SF squad. Is there a way to do this? Thanks.

Share this post


Link to post
Share on other sites

Sure you can do that.

You can for example check the position of the hunted group's leader and sent the hunting team to that location. This is called "cheating" by the way. Make the call periodically. It's simple but will achieve a feeling that the one team is determined to hunt the other team down.

If you want more sophisticated, for example to hunt individual team members at the same time by separate units of the hunting team, then I think you understand now how to do that too. You can check each unit's position and send the hunters after them as you wish. But remember, this is "cheating" and has often nothing to do with the AI "detecting" where the hunted units are.

For OFP there is a script pack called "Group Link II" which does a good job. For ArmA someone did a conversion of that work, you could check if it works.

Also you should maybe make sure that the hunting team doesn't start to retreat (assuming it is AI team). allowFleeing.

Share this post


Link to post
Share on other sites

Now how exactly do I check the postition of the group leader, then send the hunters to that position ?

Share this post


Link to post
Share on other sites

Some scripting commands which are useful:

To get position of an object such as a soldier:

http://community.bistudio.com/wiki/getPos

Example: getPos ( leader BDO_huntedGroup )

To make the hunting group move to the new position:

http://community.bistudio.com/wiki/move

Example: BDO_huntingGroup move ( getPos ( leader BDO_huntedGroup ) )

The two groups can be named by doing this:

To initialization field of a unit in the hunting team:

BDO_huntingGroup = group this

To initialization field of a unit in the hunted team:

BDO_huntedGroup = group this

To prevent units from fleeing (if you want to make the hunting team tougher):

http://community.bistudio.com/wiki/allowFleeing

Example (to soldier's initialization field): (group this) allowFleeing 0

This will get you started I think. Ask for more help if needed. You will need to learn a little bit of scripting in order to get it done. Don't be afraid of the task, there's plenty of help available here.

Share this post


Link to post
Share on other sites

You could try this:

[NameOftheUnitOrGroup,Player] exec "scripts\hunter.sqs"

Hunter.sqs:

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

_hunter = _this select 0

_target = _this select 1

?((_hunter distance _target) >= 600) : exit

_hunter setBehaviour "AWARE"

_hunter setSpeedMode "Full"

_hunter reveal _target

_hunter doTarget _target

#Loop

?((_target distance _hunter) >= 5) : group _hunter move getpos _target

~10

? (count units _hunter) <= 1 : exit

? (!(alive _target)) : exit

?((_hunter distance _target) <= 10) : exit

goto "Loop"

Best regrads,

Mr-Murray

Share this post


Link to post
Share on other sites

I have one small question Mr. Murray regarding the parameter......

[NameOftheUnitOrGroup,Player] exec "scripts\hunter.sqs"

Does the name of the group need to be the hunting group?

And does the player part  represent the BLUFOR Squad?

B/c please note this is for MP, not SP.

Also: I get an error whenever I start the mission and it says :

((_target |#|distance_hunter) >=5)

Error Distance: Type Group, expected array,object

What did I miss?

Share this post


Link to post
Share on other sites

Any ideas as to why I keep getting this error message ?

Share this post


Link to post
Share on other sites

Actually nvm on that script but thank you mr Murray, I got it done the other way in which baddo showed me, but how do I make it to where  the hunting group continuously track the hunted squad instead of only going to were the hunted squad started?

Share this post


Link to post
Share on other sites

You will need something which is called a loop and one example is in the script posted above.

#Loop

dostuffhere

andsomemorehere

goto "Loop"

it will jump from the line goto "Loop" to the line #Loop as long as the mission is running, if you don't use some way to exit the loop.

In ArmA we have other, maybe better ways to have a loop. Look for while as an example. Read the BIS Wiki and what scripting commands there are.

You will need to repeatedly tell them where the hunted group is.

But I think you should not give them the move command all the time, but give them some time to actually do their work. You could have some condition, like if the hunted group has gotten too far from the hunting group and the hunting group isn't even in its latest waypoint, then give them a new waypoint (move command) to the new location of the hunted group. Or something like that.

Share this post


Link to post
Share on other sites

Ok here is my script:

#Loop

getPos ( leader BDO_huntedGroup )

BDO_huntingGroup move ( getPos ( leader BDO_huntedGroup ) )

goto "Loop"

This does not work, the hunting party stop not even half way to the hunted group.

Also I found this on the biki, not shure if it would work, but here it is:

[_grp, 2] setWaypointPosition [position player, 0]

AND

[_grp, 2] waypointAttachVehicle _soldier1

and here is the link:

http://community.bistudio.com/wiki/setWaypointPosition

AND

http://community.bistudio.com/wiki/waypointAttachVehicle

Share this post


Link to post
Share on other sites

Hi

Sorry for the delay.

The only one you have to do is to add the name of the grouü into the array:

[GroupName,Player] exec "scripts\hunter.sqs"

Player is the victim and Group the hunter. That´s it.

It´s an older version but it works.

Best regards,

Mr-Murray

Share this post


Link to post
Share on other sites

Mr - Murray, it is not working, maybe I missed something, but here is what I have in the On Act: field of my trigger:

[hunter,soldier] exec "hunter.sqs"

hunter is the name of the group, and soldier is the name of the hunted player.

Share this post


Link to post
Share on other sites

Could also try a squad of commies on a Guard waypoint, they will only go to your contact locations, but if its a long contact, then they may catch up with the hunter sqaud.

Cheers

GC

Share this post


Link to post
Share on other sites

Thanx a lot i needed a script like this... yay.gif

A simple question, the sqs file has to be placed in the mission folder...right...

If i want 2-3 groups to start hunting, but with a delay of 4 min. between them, how can this be done..?

(i am using VBS-2, but i can still use the script there, right??) pistols.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  

×