Skip to reading
Cameras, Lighting & Rendering

33 Lua, BASIC and partial behavior updates

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page
Code example
local Script = {}
function Script.run(context)
    await(SetCameraTargets({cameraId="conversation",
        targetId="player", targetIds="elias"}))
    return await(ActivateCamera({cameraId="conversation",
        duration=1.2, wait=true}))
end
return Script
Code example
FUNCTION Run()
    AWAIT SetCameraTargets({"cameraId":"conversation","targetId":"player","targetIds":"elias"})
    AWAIT ActivateCamera({"cameraId":"conversation","duration":1.2,"wait":TRUE})
END FUNCTION

The first block is Lua. The second is BASIC. Use the editor’s generated entry-point template if a new record supplies one; keep the actions inside it.

Set Camera Behavior accepts partial settings. For example, cameraId conversation, enabled true, mode group and damping 0.15 change those settings without requiring every field again. Set Camera Targets changes targetId, targetIds and lookAtId through the same behavior update route.

For an active shot, a runtime behavior update can rebuild its controller. Do not call it every frame just to repeat the same values. Change behavior when the situation changes.

Page 39 of 109Permalink
Go to page