TechOFreak

Episode 20 Functions

Dec 16th, 2020
832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.02 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 20 Advanced Lighting Pt.2! Light Functions!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6.  
  7. //Set a light to be visible or not visable.
  8. Light_SetVisible("light_5", false);
  9. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  10. //active (bool)- whether or not the light should be visible.
  11.  
  12. //Set a light's brightness
  13. Light_SetBrightness("Light_Box_1", 0.0f);
  14. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  15. //brightness (float)- the brightness that the light should be set to.
  16.  
  17. //Fade a light's to a new brightness over a period of time
  18. Light_FadeBrightnessTo("Light_Box_1", 0.0f, 5.0f, eEasing_Linear);
  19. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  20. //brightness (float)- the brightness that the light should be set to.
  21. //fadeTime(float)- the amount of time that the light take to reach the new brightness.
  22. //easingType (eEasing)- the method at which the light should fade away, default is eEasing_Linear which will fade the light linearly.
  23.  
  24. //Fade light to a new color and radius, to find color values you can look at a color wheel online https://www.colorspire.com/rgb-color-wheel/
  25. Light_FadeTo("light_*", cColor(1.0, 0.0, 0.0), 2.0f, 2.0f);
  26. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  27. //lightColor (cColor)- the color that the light should be (you can specify one of the 4 default colors by using cColor_White, cColor_Red, cColor_Green, cColor_Blue instead).
  28. //radius (float)- the new radius of the light.
  29. //fadeTime(float)- the amount of time that the light take to reach the new radius.
  30.  
  31. //Place a light in the level that will flash in and out once, to find color values you can look at a color wheel online https://www.colorspire.com/rgb-color-wheel/
  32. LightFlash_Add(5.0f, 1.0f, 1.0f, Map_GetEntity("relic_room_gate_1").GetPosition(), cColor(1.0, 0.0, 1.0), 10.0f, 1.0f);
  33. //flashDuration (float)- the amount of time the flash of light should remain in the level
  34. //fadeInTime (float)- the amount of time that the light should fade into full brightness.
  35. //fadeOutTime (float)- the amount of time that the light should fade out into being off.
  36. //position3D (cVector3f)- the coordinates that the light should flash at (you can specify coordinates by using cVector3f(0.0, 0.0, 0.0)).
  37. //lightColor (cColor)- the color that the light should be (you can specify one of the 4 default colors by using cColor_White, cColor_Red, cColor_Green, cColor_Blue instead).
  38. //radius (float)- the radius of the light that will flash.
  39. //brightness (float)- the brightness that the light should be set to.
  40.  
  41. //Setup flickering on one or more lights
  42. Light_SetupFlicker(...);
  43. //Values to pass in are the exact options as in the level editor under the flicker tab starting with lightName(can be a wildcard), onMinTime, OnMaxTime, onSoundFileName, onPSFileName, etc.
  44. //Note: the sound and ps names can be empty strings ""
  45.  
  46. //Activate flicking on a light, the light specified should have already been setup by using the Light_SetupFlicker function or have values set in the level editor under the flicker tab
  47. Light_SetFlickerActive("light_5", true);
  48. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  49. //active (bool)- whether or not this effect should be activated.
  50.  
  51. //Get the current brightness of a light
  52. Light_GetBrightness("Light_Box_1");
  53. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light).
  54.  
  55. //Fade light's brightness back to its original value
  56. Light_FadeBrightnessToDefault("Box_Light_1", 5.0f, eEasing_Linear);
  57. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  58. //fadeTime(float)- the amount of time that the light take to reach the new brightness.
  59. //easingType (eEasing)- the method at which the light should fade away, default is eEasing_Linear which will fade the light linearly.
  60.  
  61. //Get a light's original brightness
  62. Light_GetDefaultBrightness("Box_Light_1");
  63. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light).
  64.  
  65. //Enable or disable a spotlight's ability to cast shadows
  66. Light_SetCastShadows("Spot_Light_1", false);
  67. //lightName (String)- name of a spot light as it appears in your level editor (can only be a spot light).
  68.  
  69. //Enables "cheap" rendering for a light that uses a gobo
  70. Light_SetCheapGobo("Light_Point_3", true);
  71. //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
  72. //active (bool)- whether or not this effect should be activated.
  73.  
Advertisement
Add Comment
Please, Sign In to add comment