Jump to content
Sign in to follow this  
CaptainBravo

How to change unit setcaptive status when it gets near certain moving units?

Recommended Posts

I have a mission where player is settocaptive true. However that changes to setcaptive false when he gets within 10 meters from specific enemy patrol units that are moving. I thought about attaching a trigger to each enemy moving patrol unit but that seems not so optimized. Is there a better smoother way of doing it?

Thanks.

Share this post


Link to post
Share on other sites

attach trigger to the captive..when activated by enemy forces..setcaptive false?

OOh specific patrols..is there a way you could put a specific unit in each of the moving patrols?

IE enemy in trigger area..checks if it iskindof "enemygrenadier"

if it is not grenadier nothing happens..if it is grenadier it will setcaptive false

Share this post


Link to post
Share on other sites
attach trigger to the captive..when activated by enemy forces..setcaptive false?

OOh specific patrols..is there a way you could put a specific unit in each of the moving patrols?

IE enemy in trigger area..checks if it iskindof "enemygrenadier"

if it is not grenadier nothing happens..if it is grenadier it will setcaptive false

This is a good idea. Actually each of the enemy patrols have a dog. So just place dog classname in iskindof "dogclassname" should work? WIll have to test.

OK, tested quick and did not work. Not sure why.

Have trigger with this in activation: This iskindof "Pastor"

Attached trigger to player "radio1 attachTo [warlord,[0,0,0]];" but when he moves to dog nothing happens. Any ideas?

Edited by CaptainBravo

Share this post


Link to post
Share on other sites

Thanks Charles. I updated post after you posted. Even with classname, trigger is not activating. What am I missing?

Share this post


Link to post
Share on other sites

{(_x iskindof "classname") count thislist > 0} in the activation field of the trigger should do it

Oh I don't know if atachto works for triggers lemme see what I can find

ok 30 seconds on google seems to say it can work the way you are doing it..let me know

Edited by Charles Darwin

Share this post


Link to post
Share on other sites

You can attach a trigger and it will activate By Blue/Russian side present. However trying to activate it by animal class name does not seem to work.

I am using in condition: {!(_x iskindof "Fin")} count thislist > 0;

A bit confusing as it should work ... so what is missing?

Share this post


Link to post
Share on other sites

set it to be activated by anybody and see what that does.

might be this as well

{!(_x iskindof "Fin")} count thislist > 0;

try:

{(_x !iskindof "Fin")} count thislist > 0;

Share this post


Link to post
Share on other sites
set it to be activated by anybody and see what that does.

might be this as well

{!(_x iskindof "Fin")} count thislist > 0;

try:

{(_x !iskindof "Fin")} count thislist > 0;

I get a syntax error with {(_x !iskindof "Fin")} count thislist > 0

Does attach trigger work with class names?

Share this post


Link to post
Share on other sites

no reason it shouldn't try it with the trigger set to anybody(as apposed to blufor-opfor). If not Im not sure you could attach an object to every one of the dogs and then hide them.

Share this post


Link to post
Share on other sites

I have set the trigger to activate with anybody present with condition "{!(_x iskindof "Fin")} count thislist > 0;" Problem is it activates right away since player is inside trigger even though the dogs are not inside trigger yet. It seems as the trigger is ignoring that condition and activating right away.

I am not sure what step is missed here. Any ideas?

Attaching trigger to dogs is the other possibility, but dogs will be spawned later and I am not sure how about to attach a trigger t each spawning dog.:confused:

Edited by CaptainBravo

Share this post


Link to post
Share on other sites
and you tried with just {(_x iskindof "Fin")} correct?

I have tried that and got a syntax error. I have almost given up on the trigger solution as it seems more complicated that I thought. Any other ideas? :rage:

Share this post


Link to post
Share on other sites
specific enemy patrol units that are moving.

How much specific? If this may be unit with certain name, it is easy:

1. Set not attached to anybody trigger.

2. It's conditions (without "this"): ((player distance NameOfUnitWithCertainName) <= 10)

3. It's act field: player setCaptive false;

If it is about only unit of certain kind with any name, then there will be more complex condition:

((player distance ((getPos player) nearestObject "HereInputChosenKindOfUnit")) <= 10);

If BIKI description is accurate, this will work for radius up to 50 meters if you want to set it wider.

Edited by Rydygier

Share this post


Link to post
Share on other sites

you can also use the count check as condition if its to check for player distance to any members of multiple groups...

({({player distance _x <= 10} count units _x) != 0} count [groupname1,groupname2,groupname3]) != 0

Share this post


Link to post
Share on other sites

Thanks guys, all the soloutions you proposed are working prefect! I have more than one way to do it now. I appreciate it. Thanks again.

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  

×