Jump to content

Recommended Posts

Hello, I want to have a bunch of objects in my mission have custom ambient sound effects. The way I do this is not very performance friendly but I don't know any other way to do it. Is there a better way to have objects loop a sound effect?

 

Object's init

call{
[]spawn {
 while {true} do { tentlight_1 say ["light",10];
 sleep 9;
 };
};}

Share this post


Link to post
Share on other sites

object's init:

this spawn 
{
	while { alive _this } do
	{
		_this say ["light", 10];		
		sleep 9;
	};
};
  • Like 2

Share this post


Link to post
Share on other sites

So with that I can delete the object after the player exits the area and it won't harm performance?

Share this post


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

So with that I can delete the object after the player exits the area and it won't harm performance?

yes, when you delete object, loop will end and sound will stop

Share this post


Link to post
Share on other sites

Would it be worthwhile to use a trigger to activate the sounds when a player enters the area? Or is the performance loss already minimal.

Share this post


Link to post
Share on other sites
37 minutes ago, Crimson Mage said:

Would it be worthwhile to use a trigger to activate the sounds when a player enters the area? Or is the performance loss already minimal.

you will probably add heavier condition to loop with checking if any of player is near

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

×