Jump to content

Recommended Posts

hello all guys a greeting and a hug, I'm trying to create a sound that is automatically activated when one object approaches another, but I have not gotten it to work, and I think I have everything right, I used the following code and I do not know where may be wrong, please help 



I have named a vehicle as casa variable name 

 

and I have placed a loudspeaker with the name of variable corneta

 

and I've placed the script in a gamelogic:

 



'barrelsproximidadA = nearestobjects [getpos casa, [' 'B_Truck_01_mover_F' '], 3000]; 
{
corneta say3d' ' bipA '' 


} foreach barrelsproximidadA; ';

Share this post


Link to post
Share on other sites

Wow wow wow, literally nothing makes sense.

 

To do this, make a trigger, set the condition this:

casa distance corneta < 3000

And on the On Activation:

corneta say3d "bipA"

 

This should do this.

 

 

Hey, your quoting might breaks everything. Follow the rules.

Use " , ' or "" in the both sides you want to quote, without any spaces.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@POLPOX but I need to use the nearestobjects, because there are objects that are spawn, they will not have variable names, and they will not be able to activate the trigger, as I could do?

Share this post


Link to post
Share on other sites
5 minutes ago, elthefrank said:

@POLPOX but I need to use the nearestobjects, because there are objects that are spawn, they will not have variable names, and they will not be able to activate the trigger, as I could do?

Well... why not place the object via Eden Editor? Why placing object on-the-fly? You are making me confused. What exactly you want to do?

Is there a truck? A loudspeaker? Are they named or not? Placed via Eden Editor or not? I have no idea, so I give up for now.

Share this post


Link to post
Share on other sites

having this is another similar, I am trying to activate a sound when a vehicle fires a missile, it is like an alarm that is activated to warn that the missile is approaching, then the name of the missile object is B_misil_F, (this name is a example), then when the missile is spawn and enters the area of 3000 meters the alarm should be activated, so I try to use nearestobjects, but something I need that could be?

Share this post


Link to post
Share on other sites

I got it @POLPOX :D this is the correct scripts, and it perfectly fuses with the logic of great game

 

_barrelsproximidadA = nearestObjects [base, ["B_Missile_F"], 3000]; 
 
{ Altavoz say3d "bipA"; 
   
} forEach  _barrelsproximidadA; 

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

×