Jump to content
Sign in to follow this  
bruhmis

Trigger AI hostility

Recommended Posts

I'm creating a mission that needs to trigger Independent forces to attack blufor at a certain point in the mission. I can't use Blufor setfriend [resistance, 0] because it can't be used mid game. is there any way for me to trigger hostility between independent units and blufor units at a certain point?

Share this post


Link to post
Share on other sites

In editor set the enemy to "careless", then with a trigger (or however you're controlling them) set them to another behavior, "aware", or "danger" maybe.

Share this post


Link to post
Share on other sites

I have a similar mission that I just set the Independents friendly to East, and scripted my Blufor soldiers setCaptive true. In my trigger area I just had to script all my Blufor Units setCaptive false. Works great but it's a lot of typing, I hope someone has a better solution

Share this post


Link to post
Share on other sites
I have a similar mission that I just set the Independents friendly to East, and scripted my Blufor soldiers setCaptive true. In my trigger area I just had to script all my Blufor Units setCaptive false. Works great but it's a lot of typing, I hope someone has a better solution

does this effect the blufor units in any other way? they can still fire weapons, control vehicles and everything?

Share this post


Link to post
Share on other sites

You can also make independent units join the group of an Opfor leader who is invisible and harmless, or even hasn't been spawned (% of presence=0).

I forget what the command is called, though. Joinsilent or something like that.

Share this post


Link to post
Share on other sites

maturin is right.

Place an OPFOR man, anywhere on the map. name it, let's say "badguy" probability of presence 0%

Name the independent group, on leader init field put, let's say "indies = group this"

In the trigger / waypoint you want them to be enemy, put:

{[_x] joinSilent badguy} forEach units indies

Then, they are opforside.

If you want them to go back to the light, you can make the same process but instead of joining an OPFOR, joining a BLUFOR

Share this post


Link to post
Share on other sites

I've tried all 3 methods that have been suggested so far, and they all function to a certain degree but none of them are sufficient to make the mission actually work. is there any way to make units engage in friendly fire on specified groups/units?

---------- Post added at 10:36 ---------- Previous post was at 10:35 ----------

maturin is right.

Place an OPFOR man, anywhere on the map. name it, let's say "badguy" probability of presence 0%

Name the independent group, on leader init field put, let's say "indies = group this"

In the trigger / waypoint you want them to be enemy, put:

{[_x] joinSilent badguy} forEach units indies

Then, they are opforside.

If you want them to go back to the light, you can make the same process but instead of joining an OPFOR, joining a BLUFOR

I tried this and it works, but they don't attack or get attacked by blufor units, which is what I need.

Share this post


Link to post
Share on other sites

Then, it is not working. Two checks:

- The indies and / or BLUFORS are not setcaptive, right?

- You havent messed with setFriend, right?

I never did this joining (allways done in the editor from the begining of the mission) so maybe the 0% presence does not work after the engine is on. Let's try in a different way:

Instead of 0% put "badguy" at 100%, in a far away and safe part of the map, on init field put: this hideObject true; removeAllWeapons this; this setCaptive true

And do the joining process.

Now, if it doesent work, something is wrong in your mission. Send it and I'll check it.

Share this post


Link to post
Share on other sites

Set BLUFOR to captive, so that they are not attacked/attack anyone:

{if (side _x == west) then {_x setCaptive true;};} forEach allUnits;

Remove captive flag:

{if (side _x == west) then {_x setCaptive false;};} forEach allUnits;

There may be some faulty syntax (writing from work), but I hope, you get the idea.

Share this post


Link to post
Share on other sites
Then, it is not working. Two checks:

- The indies and / or BLUFORS are not setcaptive, right?

- You havent messed with setFriend, right?

I never did this joining (allways done in the editor from the begining of the mission) so maybe the 0% presence does not work after the engine is on. Let's try in a different way:

Instead of 0% put "badguy" at 100%, in a far away and safe part of the map, on init field put: this hideObject true; removeAllWeapons this; this setCaptive true

And do the joining process.

Now, if it doesent work, something is wrong in your mission. Send it and I'll check it.

looks like the 0% presence was making the AI glitch out. it's working perfectly now, thanks a lot. just in case anyone else has the same problem, I put all the commands barbolani listed in ''badguy's'' init field, except for: ''this setCaptive true'' because if he was captive the blufor units would be passive towards his squad.

Share this post


Link to post
Share on other sites

An additional trick: after joining, deleteVehicle badguy, so you will be able to put waypoints to the Indie group as normal, instead of placing them to badguy, which is a usless unit.

Additionally, tkae in count the original group name won't be on use since the joining, so anything you want to command on that group after joining badguy, must be referred to the group of badguy

Share this post


Link to post
Share on other sites

Even when placing waypoints to the useless unit your squad will still carry them out as normal. Create an opfor soldier with higher rank than your squad leader, put his presence at 0%, group your units that you want FIRED UPON to him and script the group setCaptive true. When you want your soldiers to fire on them just trigger them setCaptive false.

Edited by WarLord554

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  

×