Jump to content
Sign in to follow this  
jeffv202

Move to waypoint # if Bluefor is detected (Beginner)

Recommended Posts

Hello guys, yeah still struggling with 3den and scripting (lol). Can someone please give me an example how i can do this? I'm doing an "find spotter" mission. I would like to do something like that: "If bluefor is detected within a radius of 75 metres the spotter flee directly to waypoint # 1". This possible to put it in the unit init do i need to use trigger?

Other question is it possible to limit the Dismissed waypoint  for example to 200 meters? Because the ai goes much too far. 

Hey guys, your help is much appreciated. Thank you. 

Share this post


Link to post
Share on other sites

In the triggers, There is a condition called - detected by.

 

Test this condition. It works great!

  • Like 1

Share this post


Link to post
Share on other sites

Thank you Joe. Is it possible to change the detection distance for example 75 metres?

Share this post


Link to post
Share on other sites

I don't know sorry. You need to experiment. I have a set of notes 20 pages long!

 

Careful. If the enemy is only 75 meters away he will shoot you!

  • Like 1

Share this post


Link to post
Share on other sites

Hi jeffv202, welcome to the forums!

 

2 hours ago, jeffv202 said:

Is it possible to change the detection distance for example 75 metres?


Not directly. But there are many ways of doing this. 

One way is to "Turn off" your spotter, and turn him on only when players get within desired range.

a) Go into the attributes of your spotter unit. Give him a variable name; let's say "Spotter" for now. Look under the special tab and uncheck "Enable Simulation".
(You can do the same thing by writing this command in the init box:)

this enablesimulation false;

That "turns off" your spotter unit. The character won't respond or move, but is visible to players. 

b) Place a trigger on top of your spotter. Go into the attributes. Look under the transformation tab and adjust the dimensions and shape of your trigger area.
c) In the Trigger: activation tab, set the activation to "Any Player" for now. 
d) In the Trigger: Expression tab, enter this in the On Activation box:

Spotter enablesimulation true;

Finished. 

Now when a player walks into the trigger area, the spotter unit will "activate". Depending on which way he's looking, stance of players et cetera, it might be a few seconds or longer before he detects somebody. 

This is of course very simple. You can build on this example. Here are a few commands in the Bohemia Interactive wiki that you can use on your "Spotter" instead:
https://community.bistudio.com/wiki/disableAI

And here is a command you can use (and then adjust with triggers) on your player units: 
https://community.bistudio.com/wiki/setUnitTrait

There are several more ways to design this. Have fun.

  • Like 1

Share this post


Link to post
Share on other sites

Also, in the condition field of the trigger,  try      command < 75.   I dont know the command, you need to experiment. 

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, Joe98 said:

Also, in the condition field of the trigger,  try      command < 75.   I dont know the command, you need to experiment. 

Did you mean this?

"_target distance player < 75";

😋

  • Like 1

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  

×