Page 1 of 15 1234511 ... LastLast
Results 1 to 10 of 141

Thread: TPW HOUSELIGHTS - automatic house light addon

  1. #1
    Warrant Officer
    Join Date
    Oct 30 2009
    Location
    Brisbane, Australia
    Posts
    2,134

    TPW HOUSELIGHTS - automatic house light addon

    EDIT 20120510: I have now released this as an addon called TPW_HOUSELIGHTS, no scripting necessary.
    EDIT 20120516: Version 1.01 released. Addon version is configurable by HPP file.
    EDIT 20120520: Version 1.03 released. Lights now flicker. 3 different fully configurable light sources. Lights are removed once player leaves the area.
    EDIT 20120530: Version 1.07 released. Completely overhauled and optimised dynamic light code. Distant lights are now brighter, lights only flicker if close to the player.
    EDIT 20120603: Version 1.08 released. Now comes in 2 flavours: SP (highly configurable dynamically calculated lights) and MP (precalculated lights, all players will see the same thing). Initialisation hint may now be configured off.
    EDIT 20120604: SP addon version config error fixed -> v1.081. In other news, TPW will not be working at NASA any time soon.
    EDIT 20120615: MP version config error fixed -> v1.081.
    EDIT 20121020: Files now hosted on Dropbox, just the addon version for the time being.


    Introduction:
    Hi all.

    McNools' recent magnificent Aliabad map has scaled the dizzy heights of realism as far as I'm concerned, and I've been playing it constantly lately. The immersive perfection of this map is only marred by the fact that ALICE2 won't light up Arrowhead houses at night. Which means that unless light sources are manually placed, every house and compound is pitch dark at night.

    I know the region is meant to be poor, but you'd think they could at least burn a few candles or lanterns at night! To simulate this, I wrote a script which selects a percentage of all the enterable houses on the map and assigns the parameters of one of three not-too-bright light sources (ratios/colour/brightness/flickering are configurable) into each. These houses are periodically scanned, and any houses close enough to the player have a light source placed in them, using the parameters for each. Any houses outside the defined radius have their lights removed. Lights close enough to the player will flicker to simulate flames/tv's/dodgy electricity.

    The effect is subtle but seeing a warm fllickering glow from houses really increases the sense that you're patrolling in an inhabited area.

    TPW_HOUSELIGHTS, as I have egotistically labelled this system, will work on any map with ALICE2 enterable buildings. It simply ignores non enterable buildings, so you won't notice it do anything on Chernarus.

    Files (v1.08):

    TPW_HOUSELIGHTS now comes in 2 versions

    Version 1: Single player / dynamically calculated lights
    This version allows lights to be dynamically calculated based on the various configuration options you provide.

    Advantages:
    • Works on any map. If there any enterable buildings on the map, they will be lit.
    • Highly configurable light options: distance around player to light, light colour/brightness/ratio/flickering etc etc etc
    • Can be configured to cause as much or as little stress to your CPU as you'd like


    Disadvantages:
    Every time the script initialises the player running the script will potentially see different lights.

    Addon version: https://dl.dropbox.com/u/481663/TPW_...IGHTS_1081.zip 1.081 fixes a config error in this addon version.

    Version 2: Multiplayer / precalculated lights
    This version was written in response to those requesting a system for multiplayer, whereby all players running the script will see the same lights if they are at the same point on a given map. To do this, the lights for each house on the map have been precalculated for a number of commonly used maps:
    • Aliabad
    • Clafghan
    • Fallujah
    • Fayshkhabur
    • Hazarkot
    • Lingor
    • Qom
    • Sangin
    • Shapur
    • Takistan
    • Tigeria
    • Torabora
    • Tropica
    • Zargabad


    Advantages:
    • MP compatible without requiring network synchronisation of light sources
    • All players see the same lights


    Disadvantages
    • Yes it's a kludge fix to ensure MP uniformity in lieu of true network synchronisation of lights. See below disclaimer before complaining to me about it
    • Out of the box the light configuration options are much more limited (intentionally, to ensure a "level playing field" as regards lighting). You trade flexibility for uniformity
    • Light precalculations were performed using the default light parameters of tpw_houselights108. These might not be to everyone's taste.
    • This version is quite a lot larger since it holds the light data for multiple maps
    • Your preferred map may not be on the supported list of this release


    Addon version: https://dl.dropbox.com/u/481663/TPW_...TS_1081_MP.zip

    Shortcomings:
    • The addon requires CBA to launch properly. If anyone knows of a way to convert a simple script into a PBO in a way that does not require CBA then I'd like to know about it.
    • Neither the SP or MP version works on a dedicated server. The CPU and network overhead, and my coding inability, prevents me from implementing true network light source synchronisation in this version. DISCLAIMER: I don't play MP, and am not familiar with the concepts involved with running scripts from dedicated servers. You are welcome to look at the heavily commented code to see if there's a way to implement light source synchronisation from a dedicated server from the existing code base. I will do what I can, so in the mean time please don't hassle me about it unless you have help to offer
    • Light sources don't seem to stress the engine too hard, but flickering light sources can. Default settings put lights into 30 or fewer houses near the player, with roughly 50% of them flickering. You may need to adjust the settings if you find your performance suffering.


    Alternatives:
    This thread seems to have stimulated a few ideas on alternative implementations of house lighting systems. Think mine is crap? Then why not try:


    I'm indebted to these guys for stimulating some further thoughts.

    Visuals:
    Here's what it looks like:




    McLupo has kindly taken a couple of videos of 1.07 which show the flickering lights in action:
    Zargabad: http://www.youtube.com/watch?feature...&v=HnHJ3OtBxOc
    Aliabad: http://www.youtube.com/watch?feature...qmoHxuJE&gl=DE
    Takistan: http://www.youtube.com/watch?feature...rnmY2AiU&gl=DE

    Thanks:
    • Das Attorney, for originally showing me how to make PBO addons
    • CarlGustaffa for the azimuth code
    • Rydygier for the inspiration for the flickering code. Check out his incredible Rincewinder system http://forums.bistudio.com/showthrea...ht=rincewinder from which he kindly demonstrated/donated a magic (pun intended) flickering function.
    • RogueTrooper for the improved code for determining enterable buildings
    • Xeno for config and server help
    • Demon Cleaner and Muzzleflash for code cleanup and optimisation tips
    • Twistking for his excellent suggestions regarding synch-less uniformity of lights for MP
    • BIS of course
    • All of you who have given me feedback


    Enjoy the dark!
    Last edited by tpw; Oct 20 2012 at 00:17.

  2. #2
    Wow, awesome script!
    IceBreakr, C/O [SBP] - Slovenian Black Panthers (www.vojak.si)

    Don't book a trip to Altis. There are no women living there at all! #Arma3Tips

  3. #3
    That looks great bro, I been playing the map nonstop, so will definitely use this for the night missions, thanks!

  4. #4
    Warrant Officer
    Join Date
    Oct 30 2009
    Location
    Brisbane, Australia
    Posts
    2,134
    Author of the Thread
    Quote Originally Posted by IceBreakr View Post
    Wow, awesome script!
    Thanks Ice, that means a lot. It works nicely on Lingor too!

  5. #5
    Retired Moderator Foxhound's Avatar
    Join Date
    Jun 6 2005
    Location
    The Netherlands
    Posts
    8,885
    Great little scripts like this deserve more attention

    Release frontpaged on the Armaholic homepage.

    Last edited by Foxhound; May 9 2012 at 09:25. Reason: updated with "follow player" version
    On holiday till the 25th.....dont expect replies to PM's or updates as how I used to do it until than!!!

    Visit Armaholic.com | Visit Carriercommandaholic.com

    Public FTP available, just check the Armaholic.com FAQ.

  6. #6
    Works very well .... thanks mate !

  7. #7
    Hello tpw!
    I am very interested in your "house lights Simple script".
    Unfortunately I have no idea how to run scripts at all.
    Would it be possible, to upload a short example mission within you did use the script?
    Located in the great Aliabad-Region.
    Then I could peek out how to run scripts at all .

    Thanks for the script and for your help!

  8. #8
    That is really very nice indeed, works perfectly. Thank you very much for sharing.

  9. #9
    Good one tpw!

    Maybe an explanation on how to activate the script for newcomers in the first post/readme would be good?

    EDIT (How to):

    - Start the editor, and put a unit on it. Add the below line into your units "init" field:

    script = [] execVM "Simple_house_lights_script.sqf"

    - Save the "mission", and when its saved you will get a mission folder - drop the script in that folder.

    Start the mission again and voila.

    Changed the above to an even simpler method.
    Last edited by Alex72; May 8 2012 at 20:55.

  10. #10
    Yeaai!
    Thanks Alex72.
    Manage to use it now!
    [execVM Very Happy!]

Page 1 of 15 1234511 ... LastLast

Similar Threads

  1. Addon automatic rifle AK-9
    By DAK in forum ARMA 2 & OA - ADDONS & MODS: DISCUSSION
    Replies: 13
    Last Post: Aug 15 2010, 22:19
  2. Chimney smoke / House light
    By Nephris1 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Aug 4 2010, 09:33
  3. Need help for add light in an house
    By XPETIT in forum ADDONS & MODS: DISCUSSION
    Replies: 0
    Last Post: Jun 16 2004, 20:00
  4. Replies: 1
    Last Post: Jun 15 2002, 14:04
  5. Working light house
    By walker in forum ADDONS & MODS: COMPLETE
    Replies: 2
    Last Post: Jun 2 2002, 23:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •