Forum rules - please read before posting.

Is there a flag or variable I can check against in script to know if a cutscene is active?

edited June 2018 in Technical Q&A
Hello,

Basically I need to stop some custom scripts from processing when a cutscene is active. Is there a inbuilt variable I can check against or anything that is set to 'true' while a cutscene is active?

Thanks,
Tem

Comments

  • Just found bool AC.StateHandler.IsInCutscene() in the scripting guide. Will give that a whirl.
  • That didn't seem to work as expected. It goes true for about a frame, but then reverts straight back to false. For a bit of context, I'm triggering a cutscene (which is the hippo conversation tutorial).
  • edited June 2018
    Ok, I've got this working but I don't know if it's the expected way of doing it. To succesfully block my custom script throughout a entire conversation I've had to do it this way:
    void Update() { if (KickStarter.stateHandler.gameState == AC.GameState.Normal) { //Fire FireProjectile(); } }
    While a conversation is active the GameState will change between .Cutscene & .DialogOptions. Things like IsInCutscene() weren't staying true for the full conversation. Would anyone recommend better ways of doing this or is this fine?
  • The StateHander function also includes an IsInGameplay method, which will only return true if the GameState is Normal.

    Alternatively, you can hook into the OnEnterGameState / OnExitGameState custom events - see the end of the "Custom motion controllers" Manual chapter for more.
  • edited June 2018
    Thanks Chris.

    Can I also double check, the way I'm triggering the cutscene via ActionList is by using this:



    Is there a more appropriate or dedicated action for triggering a cutscene? I was wondering if my activation method was causing problems with AC.StateHandler.IsInCutscene().


  • The "Cutscene to run" is more of a convenience tool - the "ActionList: Run" Action is the more dedicated way to trigger another list, with more options.

    However, ActionLists can also be triggered via script - by calling its Interact method.
  • Thanks. 'ActionList: Run' it is!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.