Dynamic Lighting (h2)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 20:02, 1 November 2014 by AFRLme (talk)
Name By
Dynamic Lighting (image based) AFRLme


This tutorial shows you how to create a dynamic light using static images. Dynamic light using images works by creating an image containing the lighting/glow with a transparent background. We then use random values to control the opacity & transition time between current opacity value & the target opacity value. Overall this creates a pretty neat effect.

Tutorial

Constant

1. You should create some lighting in your preferred graphic/3D program of choice. Don't forget to use feather/anti-aliasing to create smooth edges for your lighting. Blur is ok too. Background should be transparent.
2. First off you are going to want to create an object in your scene that you will be assigning the lighting image to.
3. Go to scene > value & create a new value. This value will be used to control the transition delay. 4. Next go to: scene > actions & create a at begin of scene action & a called by other action action. Make sure you give the called by other action an appropriate name.
5. Inside of the at begin of scene action: add a called action "called_by_other_action_name" action
6. Inside of the called by other action action you should include these action parts...

set random value in 'value_name' between 50 and 200 -- sets random delay between 50ms & 200ms.
execute script > (see code block below)
pause for 'value_name' millisecond(s) -- linked to value.
jump to action part #1 -- forces loop from beginning.
Objects["object_name"]:to(Values["value_name"].Int, {ObjectVisibility = math.random(75,100)}, easeQuintOut) -- fade to random opacity value between 75-100% with smooth ending


Resources

Name Description
dynamic_lighting.zip A working .ved file, complete with resources. Check out the readme.txt file for instructions.