SetSceneBrightness (CMS)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 19:22, 19 August 2014 by David Stoffel (talk) (Text replacement - "wikitable" to "ts")
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.