Jump to content
Barba-negra

enableEnvironment only in specific area

Recommended Posts

 good afternoon everyone, greetings and a hug, I come here to ask for help please, I am currently using this command to deactivate the sound of a map environment, but when using it, it does so throughout the map, and I would like it just outside of a selected area or within a trigger, how could he do it? please help. 



this is the command 



enableEnvironment [false, false];

 

Share this post


Link to post
Share on other sites

For SP you can just use it in a trigger and re enable on exit, for MP however it might be more complicated, it does not say on the wiki wether the effects are global or local. I'd put my money on global in which case it might not be possible but it's worth testing.

Share this post


Link to post
Share on other sites

if it really works on the global, I've tried it on a dedicated server and if it removes all the ambient sound of the map, but I still do not know how it could cause only the sound to be deactivated in a specific area

Share this post


Link to post
Share on other sites

considering that even the ambient rabbits and snakes are local, there might be a chance the effects of the command are local tbh. i'd like to know this for sure too though. since i already use this exactly like the OP tries to inside a large building with a trigger but i never cosnidered it could be global effect.

Share this post


Link to post
Share on other sites

 I have used this scripts but nevertheless it is still deactivating the sound of the whole map 
 

trigger name Trignuevo

 

Ac:

sounddeactivated = enableEnvironment [false, false] inAreaArray Trignuevo;

Share this post


Link to post
Share on other sites

Is this for singleplayer? If so, a trigger should work fine:

 

Name your trigger (I'll use "EnvToggle_01")

 

Activation:

Player

Present

Repeatable

 

Condition:

player inArea EnvToggle_01

 

OnAct:

enableEnvironment [true, false];  //leave wildlife but remove sound, change to [false, false] to remove everything

 

OnDeact:

enableEnvironment [true, true];

 

Any time the player is in the trigger, the environment will deactivate. When the player leaves the trigger, the environment reactivates.

  • Like 1

Share this post


Link to post
Share on other sites

Also, since environmental wildlife is local, I would guess that sounds are as well, so it might work in MP...?

  • Like 1

Share this post


Link to post
Share on other sites

hello hello, I was off the pc, it's multiplayer Harzarch, what did you write then it would only be for one player?

 

 

Share this post


Link to post
Share on other sites

Is your script very complete, could it serve as a multiplayer?

Share this post


Link to post
Share on other sites

Well I just tried it and it works eliminates the ambience when you are inside the trigger, but it is necessary that the ambience continue for players who are out of the trigger, is that possible?

Share this post


Link to post
Share on other sites

maybe you see something like that  ???

 

 

[enableEnvironment [False, false]] inAreaArray EnvToggle_01;

 

 

 

Share this post


Link to post
Share on other sites

what you have to check is if the command is executed only on the machine that calls the command or if it's executed on all machines. To do that just ask a pal to join you on the server and run the command in the console (by clicking on local of course) if the sounds stop for you and not for your pal it means the command has effects local to the machine and then what you want to do can be easily done, if not however it might not be possible.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, elthefrank said:

maybe you see something like that  ???

 

[enableEnvironment [False, false]] inAreaArray EnvToggle_01;

 

Well, no. enableEnvironment works in a specific way, you can't change that by mixing it with other commands like inAreaArray. 

Do as @Mr H. suggested above.

Share this post


Link to post
Share on other sites

Its EL, updated wiki page.

 

Just place down a trigger and leave its options as default, do nothing but change its position and size and give it a name.

//initPlayerLocal.sqf

waitUntil{ !isNil "BIS_fnc_init" && time > 0 };

_trigger = trg;

if ( player inArea _trigger ) then {
	enableEnvironment[ true, false ];
};

_trigger triggerAttachVehicle [ player ];
_trigger setTriggerActivation [ "VEHICLE", "PRESENT", true ];
_trigger setTriggerStatements ["this", "
	enableEnvironment[ true, false ]
", "
	enableEnvironment[ true, true ]
"];

Replace trg on the second line of code with what ever name you gave the trigger.

Test SP, MP hosted and dedicated and JIP. TEST_MISSION

  • Like 3
  • Thanks 3

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

×