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?
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).
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.
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.
Comments
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?
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().