Larian Studios
Posted By: sndwav Using Osiris calls in the Story Editor - 18/08/21 08:21 PM
Hello,

We have a Game Master mod and we want to add a camera movement (kinda like a cinematic) using StartCameraSpline.
https://docs.larian.game/Osiris/API/StartCameraSpline

This is an Osiris call that we use in a Story Editor script.
In the INIT section, we wrote:
Code
StartCameraSpline(CameraSpline_000_a277cb26-f3b5-4e8a-9790-ad1a86c30e46, NULL, 3, 1, 1, 0)
When building the script we get an error:
Code
syntax error: "}" unexpected

Does anyone know what we are doing wrong?

In addition, we will be trying to use this script in a Game Master mod (on item use). Would that be possible?

If not, is there a way to add such camera movements in a Game Master mod?

Thank you.
Posted By: Tinkerer Re: Using Osiris calls in the Story Editor - 21/08/21 08:47 AM
You're missing a semicolon at the end of the line. The NULL also needs the null GUID after it.

However, it won't work in the INIT section. That one gets executed when Story gets initialised (*), which is before the level has even loaded, let alone before the presentation layer ("client") has been been initialised. You could try to use the https://docs.larian.game/Osiris/API/GameStarted event (in the KB section, not in INIT)
Code
IF
GameStarted("YourLevelName", 0)
THEN
StartCameraSpline(CameraSpline_000_a277cb26-f3b5-4e8a-9790-ad1a86c30e46, NULL_00000000-0000-0000-0000-000000000000, 3.0, 1, 1, 0);

If you want it to happen on item use, you can use https://docs.larian.game/Osiris/API/CharacterUsedItem :
Code
IF
CharacterUsedItem(_, YourItem_UUID)
THEN
StartCameraSpline(CameraSpline_000_a277cb26-f3b5-4e8a-9790-ad1a86c30e46, NULL_00000000-0000-0000-0000-000000000000, 3.0, 1, 1, 0);

I don't know how well that calls works/doesn't work in gamemaster mode. If it doesn't, I'm not aware of any alternative you could use.

(*) Unless it's in the init section of a story goal that's a child of another goal that completes when another event arrives, but that's probably not the case here. See https://docs.larian.game/Osiris_Overview#Goal_Initialisation_and_Completion and https://docs.larian.game/Osiris_Design_Patterns#Program_Initialisation for more details
Posted By: sndwav Re: Using Osiris calls in the Story Editor - 21/08/21 05:45 PM
It's working!
Thank you very much!
© Larian Studios forums