Jump to content

Recommended Posts

Hi!

 

I'm want to make a room which is supposed to be dark and you are supposed to see just a little bit in there. This is supposed to be in daytime and in multiplayer so I guess I can't fake darkness using skipTime? As I understand it can't be used locally, right? cutText ["","BLACK OUT",x]  won't work either because I want the player to be able to see the action commands since he is supposed to find the light switch. Can I make some sort of transparent almost black picture all over the screen somehow, like a filter? Is that the best solution?

 

Thanks

  • Like 1

Share this post


Link to post
Share on other sites

*edit* AZCoder's suggestion is far superior IMO, but this might still be useful for other things.

 

You could also look at post processing effect. There is an example in the color corrections section that you could alter to your purpose.

 

I fooled around with it for a second and came up with this. Drop a player unit in the editor, run, then paste this into debug:

 

0 = ["ColorCorrections", 1500, [0.1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 0], [0.1, 0.1, 0.1, 0]]] spawn 
{
	params ["_name", "_priority", "_effect", "_handle"];
	while {
		_handle = ppEffectCreate [_name, _priority];
		_handle < 0
	} do {
		_priority = _priority + 1;
	};
	_handle ppEffectEnable true;
	_handle ppEffectAdjust _effect;
	_handle ppEffectCommit 1;
	waitUntil {ppEffectCommitted _handle};
	uiSleep 3; 
	comment "admire effect for a sec";
	_handle ppEffectEnable false;
	ppEffectDestroy _handle;
};

 

  • Like 3

Share this post


Link to post
Share on other sites
15 minutes ago, AZCoder said:

This one is a local command https://community.bistudio.com/wiki/setAperture

I have played around a bit with it before, not sure if it will do what you want but worth checking out.

 

 

This works great, BTW! You can get a very convincing "day for night" effect using high values - setAperture 5000 for example:

h5AvlXR.jpg

  • Thanks 1

Share this post


Link to post
Share on other sites

Just be aware that this command is permanent unless you load another map.

So if you have it set to 5000 and hop back into the editor you're in for a surprise.

Setting it to -1 will revert any changes.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Apologies for necroing a old topic but it's the closest match to what I seek, I actually want the opposite effect.

 

Mission ambience I'm working on utilizes the setAperture 90 command, it's perfect while the  player is outdoors but it's way too dark when entering a building, so ideally I'd like to brighten any buildings interior using setAperture 40.

The example below is using two triggers, exterior trigger setAperture 90, interior trigger setAperture 40....

Is a scripted version of this example possible?

Something like while the player is outdoors setAperture is set to 90 but drops to 40 upon entering a roofed structure then back to 90 upon exit?  

Unfortunately I can't offer any code just the idea.

Thanks. :rthumb:  

Share this post


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

Apologies for necroing a old topic but it's the closest match to what I seek, I actually want the opposite effect.

 

Mission ambience I'm working on utilizes the setAperture 90 command, it's perfect while the  player is outdoors but it's way too dark when entering a building, so ideally I'd like to brighten any buildings interior using setAperture 40.

The example below is using two triggers, exterior trigger setAperture 90, interior trigger setAperture 40....

Is a scripted version of this example possible?

Something like while the player is outdoors setAperture is set to 90 but drops to 40 upon entering a roofed structure then back to 90 upon exit?  

Unfortunately I can't offer any code just the idea.

Thanks. :rthumb:  


You can try creating a lightweight loop (FSM based maybe) using the new insideBuilding command which returns when the player is in a building, instead of using triggers. There are some cases it returns false, such as in a building that is open like the slum shed buildings, but in my tests will correctly return true or false if in a building or on the roof/balcony. Also, in my experience, setAperture with colorCorrections and all that gets more complicated when you need to take into consideration different times of day, weather, moonphase, etc. since it may look bright in one setting, but extremely dark in another, and vice versa.

Hopefully this gives you a better idea how to have it work automatically for you in any building.

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

You could also use lineIntersects or one of its pals to check if there is a surface over your head. Maybe in conjunction with insideBuilding to filter out roof/balcony positives?

  • Like 1
  • Thanks 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

×