Jump to content
Sign in to follow this  
demonized

is chinook interior lights possible?

Recommended Posts

I have a group of players in Multiplayer without NVG´s being inserted by chinook in the dark, chinook is flying on stealth waypoints, no lights.

Question: is there a way to create a red soft light inside chinook? so that players can see the inside of chinook.

Like red combat lights.. soft but not total dark.

Share this post


Link to post
Share on other sites

Create a lightsource and attach it to correct position with attachto?

Share this post


Link to post
Share on other sites

chino init field:

light1 = "#lightpoint" createVehicleLocal [0,0,0];
light1 setLightBrightness 0.01;
light1 setLightAmbient [0.2,0.2,0.2];
light1 setLightColor [1,0.2,0.2];
light1 lightAttachObject [this,[0,-2.5,-0.8]];
light2 = "#lightpoint" createVehicleLocal [0,0,0];
light2 setLightBrightness 0.01;
light2 setLightAmbient [0.2,0.2,0.2];
light2 setLightColor [1,0.2,0.2];
light2 lightAttachObject [this,[0,1,-0.8]];

chinook_red_interior_lights1.jpg

chinook_red_interior_lights2.jpg

Not perfect as they do show up outside a bit as well.

Share this post


Link to post
Share on other sites

still very nice, thank you very much for setting it up for me..

Edit: That was truly sweet!!! just what i was looking for, the outside view of it is very minimal, and as its for ambience on a coop mission, this was spot on.

Edited by Demonized

Share this post


Link to post
Share on other sites

One small issue is that when i have lights on inside chinook, all characters are dark, not lit up by lights as if they were still in complete darkness.

Its a cosmetic thing, no big deal.

But flares fired outside chinook lights up soldiers, but inside lights is like they give off no light source.

Share this post


Link to post
Share on other sites

Yeah, that was first thing I've ever done with lights. I have no idea how or if you even can makes lights that actually notice the models.

Share this post


Link to post
Share on other sites

setLightAmbient parameter is what you're looking for I believe. This should control the lights projection onto surrounding objects/terrain and whatnot. Generally speaking anyway...

Share this post


Link to post
Share on other sites

Note that lights have (maybe had, may be fixed now, unsure) a big problem wrt what I assume is floating point accuracy. The problem being that the lights fail to show up as expected at altitude (I've even had problems with normal particle systems at altitude), or that they suddenly turn completely off below a certain threshold value of ambient, color, or brightness.

Also note that you cannot attach a light to the static C130J.

Share this post


Link to post
Share on other sites

This is what I used in a mission I'm working on, I was happy with how it turned out:

// Prepare Chinook	
light3 = "#lightpoint" createVehicle [1,1,1];
light3 setLightBrightness 0.00675;
light3 setLightAmbient[1, 0, 0];
light3 setLightColor[1, 0, 0];
light3 lightAttachObject [ch1, [0, -3.25, -0.3]];
light2 = "#lightpoint" createVehicle [1,1,1];
light2 setLightBrightness 0.00675;
light2 setLightAmbient[1, 0, 0];
light2 setLightColor[1, 0, 0];
light2 lightAttachObject [ch1, [0, -5.25, -1]];
light1 = "#lightpoint" createVehicle [1,1,1];
light1 setLightBrightness 0.00675;
light1 setLightAmbient[1, 0, 0];
light1 setLightColor[1, 0, 0];
light1 lightAttachObject [ch1, [0, -0.25, -1]]; 

Share this post


Link to post
Share on other sites
This is what I used in a mission I'm working on, I was happy with how it turned out:

       // Prepare Chinook	
light3 = "#lightpoint" createVehicle [1,1,1];
light3 setLightBrightness 0.00675;
light3 setLightAmbient[1, 0, 0];
light3 setLightColor[1, 0, 0];
light3 lightAttachObject [ch1, [0, -3.25, -0.3]];
light2 = "#lightpoint" createVehicle [1,1,1];
light2 setLightBrightness 0.00675;
light2 setLightAmbient[1, 0, 0];
light2 setLightColor[1, 0, 0];
light2 lightAttachObject [ch1, [0, -5.25, -1]];
light1 = "#lightpoint" createVehicle [1,1,1];
light1 setLightBrightness 0.00675;
light1 setLightAmbient[1, 0, 0];
light1 setLightColor[1, 0, 0];
light1 lightAttachObject [ch1, [0, -0.25, -1]]; 

Edit: reason why lights dont work when in flight seems to be that they are created in horisontal plane of chinook, and remains that way, even when chinook is tilted forward backward to gain speed, look under spoiler for more info.

No offence kylania, your light was way to strong, and your version still make people black as they were in the dark same as shk version, and furthermore the chinook have much more light on the outside.

I can see the rear gunner lit up by inside redlight when im on the outside. as well as the chinook itself is a big red torch in the dark.

And when using setLightAmbient all AI enemy that you pass over will see that big red ball of chinook.

My graphic settings are not high, mostly normal and low, unsure if that can have anything to do with it, tho i doubt it.

ALso have done alot of different tests/approaches within my knowledge and its under this spoiler

maybe having lights placed on floor in center, 1 almost at front, 2 almost at back, will work better?? ill try and fiddle with the numbers to set its position, but im basically wawing in the dark, have no clue as to what number does what, im going for the logical 1x2y3z. - edit, no difference in changing to center.

Edit1: will try lowering light sthrength even more with kylania script before i attempt on moving lights.

Edit2:adjusted setLightBrightness 0.00675; to 0.00475 and outside is much better, still same black figures when looked from inside, also i noticed over a longer flightperiod, that sometimes passengers do get visible inside, so problem with lights moving or not being attched to same point all the time is apparent.

Edit3:i put a group in back of chinook when it was sitting at ground, and entered myself, and all is visible from inside, once heli is moving lights are out of their place.

Edit4:it appears that lights attached is positioned to chinook´s center, so while its horizontal all is good, once pilot starts moving meaning tipping his nose forward to gain speed, lights go out of sync.

-()---()-----()--- this is chinook and lights when standing still or level

This is chinook moving, lights still level but chinook not.

-
   -
       -
           -
()       ()          ()
                  -
                       -
                           -
                                -

Maybe 1 single light point attached to center of chinook will work.. edit: nope it didnt, lights come on when chinook is level or almost level, then when nose forward or backward lights off. red light in ceiling inside not affected, nor do you see any wandering lights outside when nose forward backward.

Ive created lights from chinook init line, ill try with a script of it instead, see if that makes any difference.

tried with script and same result:

//        redlight = [this] execVM "scripts\light.sqf";

if (isServer) then {
_heli = _this select 0;
// Prepare Chinook
_light3 = "#lightpoint" createVehicle [1,1,1];
_light3 setLightBrightness 0.00675;
_light3 setLightAmbient[1, 0, 0];
_light3 setLightColor[1, 0, 0];
_light3 lightAttachObject [_heli, [0, -3.25, -0.3]];
_light2 = "#lightpoint" createVehicle [1,1,1];
_light2 setLightBrightness 0.00675;
_light2 setLightAmbient[1, 0, 0];
_light2 setLightColor[1, 0, 0];
_light2 lightAttachObject [_heli, [0, -5.25, -1]];
_light1 = "#lightpoint" createVehicle [1,1,1];
_light1 setLightBrightness 0.00675;
_light1 setLightAmbient[1, 0, 0];
_light1 setLightColor[1, 0, 0];
_light1 lightAttachObject [_heli, [0, -0.25, -1]];
};

//this part below added in second test with script code. above this line was first test
if (isServer) then {
while {alive _heli} do {
	_light3 lightAttachObject [_heli, [0, -3.25, -0.3]];
	_light2 lightAttachObject [_heli, [0, -5.25, -1]];
	_light1 lightAttachObject [_heli, [0, -0.25, -1]];
	sleep 0.2;
};
};

Edited by Demonized
added edits and test info.

Share this post


Link to post
Share on other sites

Is it possible to addaction the switching of the lights from red > green > off?

Share this post


Link to post
Share on other sites
Is it possible to addaction the switching of the lights from red > green > off?

simulate switching by changing color then delete when off is wanted

Share this post


Link to post
Share on other sites
simulate switching by changing color then delete when off is wanted

Any clues as to how? I'm not quite sure how to go about doing this.

I've worked out how to add the action to the vehicle but would like to restrict this to pilots, and can't get the lights to switch off (presume deletevehicle?).

Share this post


Link to post
Share on other sites

yes deletevehicle on lights for off is the first id do, maybe there is something you can turn light strenght down to 0 but i dunno, you can just delete and create new light with same script mentioned by shk and kylania when you need light back on.

experiment or google setLightColor for changing to green:

light2 setLightColor[1, 0, 0];

edit: gogled r g b color charts and got this untested if its used in arma

http://kb.iu.edu/data/aetf.html

Edited by Demonized

Share this post


Link to post
Share on other sites

Yeah I've got the colours thanks, its the scripting I can't get my head around - can't seem to get anything to work.

My level of scripting knowledge isn't great (still learning), but what I would like to do is restrict the addaction to specific unit types (i.e. pilot), and add/remove the actions from red/green/black to simulate jump protocol. I'm hoping this would add a big dollop of realism to paradrop missions.

Edited by Enders

Share this post


Link to post
Share on other sites

Add this in heli initline: _null = [this] execVM "createlights.sqf";

here is script you need to save as createlights.sqf and place in missionfolder.

// Prepare Chinook	
light3 = "#lightpoint" createVehicle [1,1,1];
light3 setLightBrightness 0.00675;
light3 setLightAmbient[1, 0, 0];
light3 setLightColor[1, 0, 0];
light3 lightAttachObject [chinookname, [0, -3.25, -0.3]];
light2 = "#lightpoint" createVehicle [1,1,1];
light2 setLightBrightness 0.00675;
light2 setLightAmbient[1, 0, 0];
light2 setLightColor[1, 0, 0];
light2 lightAttachObject [chinookname, [0, -5.25, -1]];
light1 = "#lightpoint" createVehicle [1,1,1];
light1 setLightBrightness 0.00675;
light1 setLightAmbient[1, 0, 0];
light1 setLightColor[1, 0, 0];
light1 lightAttachObject [chinookname, [0, -0.25, -1]];

you see lightAttachObject that is x y z in relation to direction of heli, x is sideways, y is forward backward, z is up down. 0 is center, so -1 for x value is 1m to the left. adjust to what you need if using other helis, need to experiment until you get it right.

Now the pilot:

Add this in pilots initline:

pilotname addaction ["switchlights green", "greenlight.sqf"]; pilotname addaction ["switchlights red", "redlight.sqf"]; pilotname addaction ["switchlights off", "offlight.sqf"];

That will give pilot a scroll option with switchlights green,red,off.

Now create a script for each color green and red, im using kylanias script as example wich has 3 lights, but keep in mind that was made for chinook:

this is redlight.sqf: notice that color and stuff is same as script run on heli initline.

// change to color red.
light3 setLightBrightness 0.00675;	// this is light strenght.
light3 setLightAmbient[1, 0, 0];	// this is light color shed on surroundings, same as color.
light3 setLightColor[1, 0, 0];		// this is color of light.

light2 setLightBrightness 0.00675;
light2 setLightAmbient[1, 0, 0];
light2 setLightColor[1, 0, 0];

light1 setLightBrightness 0.00675;
light1 setLightAmbient[1, 0, 0];
light1 setLightColor[1, 0, 0];

this is greenlight.sqf wich you need to change the setLightColor to match green, set setLightAmbient to same as green color:

// change to color green.
light3 setLightBrightness 0.00675;	// this is light strenght.
light3 setLightAmbient[1, 0, 0];	// this is light color shed on surroundings, same as color.
light3 setLightColor[1, 0, 0];		// this is color of light.

light2 setLightBrightness 0.00675;
light2 setLightAmbient[1, 0, 0];
light2 setLightColor[1, 0, 0];

light1 setLightBrightness 0.00675;
light1 setLightAmbient[1, 0, 0];
light1 setLightColor[1, 0, 0];

this is offlight.sqf wich you dont need to change anything in.

// change color and light ambient to none, set light strenght to 0 (not there)
light3 setLightBrightness 0.0;		// this is light strenght.
light3 setLightAmbient[0, 0, 0];	// this is light color shed on surroundings, same as color.
light3 setLightColor[0, 0, 0];		// this is color of light.

light2 setLightBrightness 0.0;
light2 setLightAmbient[0, 0, 0];
light2 setLightColor[0, 0, 0];

light1 setLightBrightness 0.0;
light1 setLightAmbient[0, 0, 0];
light1 setLightColor[0, 0, 0];

Now save all three and your pilot will have 3 options when scrolling, 1 switchlights red 2 switchlights green 3 offlights, and switchlights any of red or green will turn lights back on again with correct color..

I think...

good luck..

Edit1: you are aware of the inside view other soldiers issue ive posted in previous posts of this thread.

Edit2 edit3: this will make pilot able to switch lights even when not inside heli. to solve that, run lines in pilot initline in a trigger instead set on repeated.

and in condition have pilotname in heliname AND lightsready

on activation line:

lightsready=false; pilotname addaction ["switchlights green", "greenlight.sqf"]; pilotname addaction ["switchlights red", "redlight.sqf"]; pilotname addaction ["switchlights off", "offlight.sqf"];

in on deactivate add this:

lightsready=true; pilotname removeAction 0; pilotname removeAction 1; pilotname removeAction 2;

add this in initline of pilot:

lightsready=true;

Edit4: corrected typo and missing line in onactivate in trigger.

Edited by Demonized
edit

Share this post


Link to post
Share on other sites

Cheers Demonized, I got this working briefly last night with a couple of changes (only really needed one light), but I'll have a go at it again later, playing around with some settings for the C130 also.

Edited by Enders

Share this post


Link to post
Share on other sites

Would it not be easier to add the action to the vehicle?

Just tried this:

nul = [this] execVM "scripts\jumplights\chinook.sqf"; this addaction [("<t color=""#f6314d"">" + ("Switch on Red Light") + "</t>"), "scripts\jumplights\redlight.sqf", [],1,false,false,"","EffectiveCommander _target == _this"];

And it doesn't seem to work in multiplayer, however it does if you remove the condition from the addaction

Edited by Enders

Share this post


Link to post
Share on other sites

problem with adding it to vehicle is that all can then use the actions inside and outside of vehicle, but you can fix that by adding some scripting where if player is driver, then driver gets actions only, unsure about how you would set that up but yeah thay would be best.

Share this post


Link to post
Share on other sites

Sorry but for some odd reason. I can't seem to get the code

light3 = "#lightpoint" createVehicle [1,1,1]; 
light3 setLightBrightness 0.00675; 
light3 setLightAmbient[1, 0, 0]; 
light3 setLightColor[1, 0, 0]; 
light3 lightAttachObject [chinookname, [0, -3.25, -0.3]]; 
light2 = "#lightpoint" createVehicle [1,1,1]; 
light2 setLightBrightness 0.00675; 
light2 setLightAmbient[1, 0, 0]; 
light2 setLightColor[1, 0, 0]; 
light2 lightAttachObject [chinookname, [0, -5.25, -1]]; 
light1 = "#lightpoint" createVehicle [1,1,1]; 
light1 setLightBrightness 0.00675; 
light1 setLightAmbient[1, 0, 0]; 
light1 setLightColor[1, 0, 0]; 
light1 lightAttachObject [chinookname, [0, -0.25, -1]];  

To work so I can get 'Cargo Lights' in the Static C130 object. I figure it would be the same but it appears not since I even set the brightness up constantly to see if I could at the very least see if they're even being created. Which clearly they are not. Any idea what I would need to change to make lights for the Static C130 object?

And before hand, yes. I changed the 'chinookname' and altered the X Y Z repeatedly. I just couldn't get it to work. Any help would be great ^^

Share this post


Link to post
Share on other sites

Make sure that you have not created lights with same script on another vehicle before in same mission, make sure you name c130 chinookname or a new name and replace name in code.

Also if using script in same missoin on another vehicle you need to make new names for light1,2,3.

But i see nothing wrong in your code, and i placed a static c130 wich is under military objects and named it chinookname and just pasted the code you showed me in its initline and the lights came on.

check name again.

Edit: And set time to night ;) else you wont see anything.

Edited by Demonized

Share this post


Link to post
Share on other sites

Oh what the hell XD Last night I tried 30 or 40 times (Yeah I'm making it sound worse then it was XD) and it never worked, I try again today and it does! Oh wtf Haha XD Thanky :P Will use this lol

Share this post


Link to post
Share on other sites

The problem I have is that the pilot did not have the options of turning on and off the light inside the helicopter, only to have it out to chopper.

Share this post


Link to post
Share on other sites

@M4rK3Tin6

You need to provide more details than that.

how does your scripts look?

how do you addaction and to what?

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  

×