SetSceneBrightness (CMS)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 20:59, 14 August 2014 by AFRLme (talk) (Created page with "{| class="wikitable" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By |- | setSceneBrightness("scn" ''o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Name Type By
setSceneBrightness("scn" or nil, n) Definition AFRLme

This small function allows you to quickly set the brightness value of the current scene or a specific scene.

Instructions

1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2a. To use this function you should create an execute a script action containing...

setSceneBrightness("scene_name", 80) -- sets the linked scenes brightness value to 80%

2b. Alternatively to automatically link to current scene use this method...

setSceneBrightness(nil, 80) -- sets the current scenes brightness value to 80%

Main Script

function setSceneBrightness(scn, n)
 if scn ~= nil then
  getObject("Scenes[" .. scn .. "]"):setValue(VSceneBrightness, n)
 else
  game:getLink(VGameCurrentScene):setValue(VSceneBrightness, n)
 end
end

Syntax Breakdown

Name Type Description
scn "string" or nil This should be a "string" value containing the name of the scene you want to affect else it should contain the word nil.
n integer This should be an integer (number) value which will determine the brightness value of the linked scene (scn) or the current scene if nil was used.