Jump to content

Story manager event triggered dialogue quests.. question


chajapa

Recommended Posts

Posted

Using Story Manager ActorDialogueEvent to trigger random dialogue specific to my mod (Elsie LaVache)

Each set of dialogues is contained within a quest. Each quest only contains 1 scene.

Each scene is marked to Begin on Quest Start and Stop Quest On Scene End.

 

It works most of the time.

An ActorDialogueEvent with specific conditions fires, quest starts, scene plays and then... sometimes the quest is left running.

 

I have put NameOfQuest.Stop() code in the script that runs at the end of the scene to try to stop the quest more assertively.

That helped. But I still end up with the quest running when the scene ends occasionally. The result is that the scene doesn't play again on the next ActorDialogueEvent because the quest is still running.

 

Here is what I'd like to try, but I am a bit unsure of the impact on performance. The mod does not have any polling scripts running or anything and I am trying like crazy to NOT make it a resource hog. 

 

If I set the Story Manager Event Node that fires the quest to wait... oh let's say... 6 minutes before being able to be fired again....

And then attach a script to one of the Reference Aliases used in the quest ... such that, when the quest starts and the alias is filled.. it RegisterForSingleUpdate with that update set to happen in 5 minutes...

AND the function called when it updates simply stops the quest....

Would that be a load on the system that I should avoid?

 

So...

Event fires and once it does it can't fire again for 6 minutes)

Quest starts... scene plays... and 5 minutes after quest starts, the Update forces it to shut down

Theoretically one minute before it's allowed to fire again.... leaves a little buffer for timing...

 

What I am trying to avoid is having a quest stop during its respective scene playing. 

My thought is that if the event can't fire again for X amount of time, (leaving plenty of time for the scene to play)... and if I force a shutdown BEFORE that event timer resets... I should get a forced shutdown in time to allow the event to fire and start the quest again.

 

Does that make sense? Will the RegisterForSingleUpdate cause undue load on the system?

 

I have 6 or 7 of these dialogue quests already, and before I do more, I need to resolve this bit about them being left running.

 

Thoughts?

 

Posted

Registerforsingleupdate is not very load intensive, less so than for instance a while loop. But you have to be careful with them as if you have properties of other scripts in your script or other scripts with other update functions in your Quest, the update functions can interfere with each other or override other update events.

 

It would be interesting to know why your Quest isn't shutting down sometimes. Is the Scene not initiating properly?

 

You also have Quest.IsRunning() and Scene.IsPlaying() functions that may be useful for logic tests.

 

For instance, if you have a Quest that starts at Scene start and Stops and Scene end, and the Quest somehow starts but the Scene doesn't fire correctly, leaving the Quest stuck open. You may be able to put a function on a separate 'checker Quest' ref Alias that would start under a similar Event (Dialogue), and it would check for:

 

If Quest.IsRunning() && !Scene.IsPlaying(); The Quest is running but the Scene isn't active.

Quest.Stop()

QuestCheckerQuest.Stop()

Else

QuestCheckerQuest.Stop()

EndIf

 

So if the Quest is running and the Scene is running, it should just shut down the 'checker' Quest which can then be fired again later, and the other Quest would be left alone. But if the Quest is Running and for some reason the Scene isn't (when it should be), it shuts down the errant Quest and also itself so it can fire again later for another check.

 

Posted

Thanks for the input... 

 

Hmmm... I think I tried doing something with those functions and it didn't work like I thought it would.

 

I have my MainQuest that stays running.

 

I have (so far) 7 of the dialogue quests. They are SUPPOSED to :

 

Start a specific one of those dialogue quests based on conditions.

The single scene within each quest is set to Start when the quest it's in starts

The SCENE is set to Start when it's quest starts and is also set to shut down the quest when the scene ends.

 

These dialogue quests can run simultaneously as they would involve different actors (conditions)

 

So a "checker Quest" would almost have to run down a list of the dialogue quests and see who is running without their scene playing, shut that one down, continue down the list.

 

Now that I think more about this... it MIGHT be that because (for testing) I have not yet set a timer on the Story Manager Event nodes, another ActorDialogueEvent is firing and trying to start an already running quest.

Maybe I should set the timers first and see if I caused my own problem by not doing so.

 

** EDIT **

 

Ok... well THAT wasn't it.... will look at the quest checker idea....

 

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...