Jump to content
Varhastra

[SOLVED] Need help with AI Simulation

Recommended Posts

Here's what I'm stuck on. I want an area trigger to activate when BluFor are present in the area, however this conflicts with my gameplay concept. I already have blufor soldiers in the area who are set to join the player's squad when the trigger activates. If I disable the AI simulation in the blufor soldiers will it stop the trigger from activating until the player's squad (or the player themself) is in the area? If so is the code for that "disableAI Simulation?"

Share this post


Link to post
Share on other sites

Can't you use any player present at the condition of activation? Unless of course, you have players in more than one sides. In this case, you should put in the condition something like

// Check if a player of specific side is inside the trigger
thisList findIf {isPlayer _x && {(side _x) isEqualTo west}} != -1; // Change west to match the side you wish to check for

 

  • Like 1

Share this post


Link to post
Share on other sites

You can but I was hoping for more of a trigger that could be set off by the player's squad, including soldiers controlled by the ai

 

Share this post


Link to post
Share on other sites

The trigger condition can also have an:

NameOfUnit in units group player

so as for the trigger not to fire if the units are not in the players squad.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, JohnKalo said:

The trigger condition can also have an:


NameOfUnit in units group player

so as for the trigger not to fire if the units are not in the players squad.

Can you explain this code a bit more? I can't seem to get it to work

Share this post


Link to post
Share on other sites

An example would be something like the following (copying JohnKalo's solution)

// Check if any of the units inside the trigger area is in player's group
thisList findIf {_x in (units (group player))} != -1;

Hope this helps somehow. Let us know if it doesn't or you would like it implemented differently

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, ZaellixA said:

An example would be something like the following (copying JohnKalo's solution)


// Check if any of the units inside the trigger area is in player's group
thisList findIf {_x in (units (group player))} != -1;

Hope this helps somehow. Let us know if it doesn't or you would like it implemented differently

This works perfectly, thanks guys.

  • Like 2

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

×