Kydoimos 916 Posted June 6, 2013 Hi - just a quickie, Is there a way to turn a building's lights on using the game logic? For instance, the military offices? They having tube lights but they're all off? Or is this just because the game is only in the Alpha stage? Thanks, Share this post Link to post Share on other sites
MissileMoose 10 Posted June 6, 2013 I'm not certain about your question, but assume that once the game is finished, all lights would come on automatically at night. They probably haven't been configured yet. Take a look at TPW Houselights (Singleplayer, Multiplayer). Share this post Link to post Share on other sites
Kydoimos 916 Posted June 15, 2013 So there's no way to turn building lights on then? Share this post Link to post Share on other sites
NeMeSiS 11 Posted June 15, 2013 AFAIK they are not technically lights, just part of the buildingmodel. Share this post Link to post Share on other sites
dr_strangepete 6 Posted June 17, 2013 you could attempt: http://community.bistudio.com/wiki/switchLight but the wiki makes it seems that its targeted at specific objects that are Lamps, probably wont work on your building. I personally dont know how, but I know it is possible via scripting to add your own light sources in the meantime. Share this post Link to post Share on other sites
sergeant rock 3 Posted June 18, 2013 You can create light sources in buildings by placing a Game Logic in the building and putting this in the initialization: _nul = [this,0.05] execVM "lightSource.sqf"; The second param in that array is the light intensity, you will have to experiment to get the brightness you are looking for. The "lightsource.sqf" file will look like this: _light = _this select 0; _intensity = _this select 1; _light setPosATL[(getPosATL _light select 0), (getPosATL _light select 1), 1.8]; BIS_lightEmitor01 = "#lightpoint" createVehicleLocal getPosATL _light; BIS_lightEmitor01 setLightColor [1, 1, 1]; BIS_lightEmitor01 setLightBrightness _intensity; BIS_lightEmitor01 setLightAmbient [1,1,1]; BIS_lightEmitor01 lightAttachObject [_light, [0, 0, 0.1]]; The most important param to change in this script is the z-index for SetPosATL. This will determine the height of the light above the floor. I've found that 1.8 is a good height in a single story building. You can also experiment with light color here as well if you want some kind of colored lighting effect. Good luck. 1 Share this post Link to post Share on other sites
Aradol 13 Posted June 12, 2016 I am using a 10cm sphere instead of a game logic and that does work, what I want to know is if there is any adjustment to the script to use the objects height in the editor instead of the one set in the script so i can have multiple sources on different floors of a building? Share this post Link to post Share on other sites
anfo 118 Posted June 17, 2016 I am using a 10cm sphere instead of a game logic and that does work, what I want to know is if there is any adjustment to the script to use the objects height in the editor instead of the one set in the script so i can have multiple sources on different floors of a building? @Aradol, I am quite literally trying to get this script to work as well and am about to try the sphere instead of the logic. As for your issue about multiple floors I am not a coder, so my simple solution would be: 4 floors = 4 scripts. That is: lightSource_gf.sqf (ground floor) lightSource_1f.sqf (1st floor) lightSource_2f.sqf (2nd floor) lightSource_3f.sqf (3rd floor) I am sure I will get shot down by a coder, but as I said I don't know this stuff. Share this post Link to post Share on other sites
kylania 568 Posted June 17, 2016 *click click bang* Never repeat code. :) // _nul = [this,0.05] execVM "lightSource.sqf"; // _nul = [this, 0.05, "1F"] execVM "lightSource.sqf"; // Optional, place on 1st floor. params ["_light", "_intensity", ["_floor", "GF"]]; _height = switch (_floor) do { case "GF": {1.8}; case "1F": {4.8}; // you'd play around with these numbers to get the right height per floor. case "2F": {7.8}; default {1.8}; }; _light setPosATL[(getPosATL _light select 0), (getPosATL _light select 1), _height]; BIS_lightEmitor01 = "#lightpoint" createVehicleLocal getPosATL _light; BIS_lightEmitor01 setLightColor [1, 1, 1]; BIS_lightEmitor01 setLightBrightness _intensity; BIS_lightEmitor01 setLightAmbient [1,1,1]; BIS_lightEmitor01 lightAttachObject [_light, [0, 0, 0.1]]; 1 Share this post Link to post Share on other sites
nikoaton 1001 Posted September 29, 2016 Hello kylania. i have problem when run on dedicated server, need other parameters in the script?. Sorry for my bad English. Regards. Share this post Link to post Share on other sites