Jump to content

Search the Community

Showing results for tags 'lights'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Forum Rules & Announcements
    • Forum Rules & Guidelines
    • Announcements
    • Patch Notes
  • New Player Landing Zone
    • New Player Help
    • FAQ & Information Desk
    • Gameplay Tutorials
    • Player Introductions
  • General (EN)
    • General Discussions
    • Lua Forum
    • Builder Forum
    • Industry Forum
    • PvP Forum
    • Public Test Server Feedback
    • The Gameplay Mechanics Assembly
    • Idea Box
    • Off Topic Discussions
  • General (DE)
    • Allgemeine Diskussionen
  • General (FR)
    • Discussions générales
  • Social Corner
    • Org Updates & Announcements
    • Roleplay & Lore
    • Fan Art

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location:


Interests


backer_title


Alpha

Found 2 results

  1. Purpose, Makes lights randomly change rgb colour and cycles them to give a breathing effect. Level: Lua beginner = cut and paste code, create filters unit start and system update in lua editor , DU = know how to link lights to a programming board Build You need 1 Programming Board(PB) and some lights. Connect the lights to the PB and name each slot in the lua editor (Ctrl L) you have connected l1 , l2 etc. If you don't want 8 then edit the source code and remove. code is below. Other stuff you can do : add a detector to autostart , change parameters in unit start to get the feel you like. -- copy and paste into unit start unit.hide() -- hides programming board -- remove these where you have not connected a light l1.activate() l2.activate() l3.activate() l4.activate() l5.activate() l6.activate() l7.activate() l8.activate() bClock = system.getTime() -- start clock origRgb = l1.getRGBColor() -- stores the colour of the original light if you want to reset lights on exit breathRate = 1 --export: rate of breathing Multiplier changeFrame = 1200 --export: frame colour and channel cycle rgbIndex = utils.round(math.random(3)) -- choose channel to breathe r = math.random(255) -- setup channels g = math.random(255) b = math.random(255) frameCount = 0 -- Copy and Paste into System update frameCount = frameCount + 1 if ( frameCount % changeFrame == 0 ) then --randomize rgb and channel r = math.random(255) g = math.random(255) b = math.random(255) rgbIndex = utils.round(math.random(3)) -- choose channel to breathe end nClock = system.getTime() local timeSeconds = ( nClock - bClock) local breath = utils.round(( math.exp( math.sin(timeSeconds * breathRate )) - 0.36787944 )* 108.0) if rgbIndex == 1 then r = breath elseif rgbIndex == 2 then g = breath else b = breath end -- set rgb colour of linked lights ,remove these where you have not connected a light l1.setRGBColor(r,g,b) l2.setRGBColor(r,g,b) l3.setRGBColor(r,g,b) l4.setRGBColor(r,g,b) l5.setRGBColor(r,g,b) l6.setRGBColor(r,g,b) l7.setRGBColor(r,g,b) l8.setRGBColor(r,g,b)
  2. Alluysl

    RGB lights

    So if data links can carry non-binary information (which I think they can, for screens for example), why not having a light with three inputs for 8-bit values (integers between 0 and 255), one for red, one for green and one for blue? We could have the lighting changing depending on the situation, for example red if the base is attacked or green the day and blue the night (light detectors btw?)
×
×
  • Create New...