Skip to main content

Scene/Script help requested, ideas.

Submitted by donAllister on
Attachment Size
MWBardSongsScript.txt 8.77 KB

Hey folks. I figured I had my solution, making Bards play seemingly consistently and without prompting by creating a rest scene that switches from singing to resting and then back to singing, sort of like a big scene semi-random loop, and it works, the first time. I couldn't figure out why it would only run the rest scene once, until I found this:

Repeating scenes

If the "Repeat while true" flag is checked on a scene, the "Repeat" conditions are checked when the scene ends - if true, the scene restarts. Note that the scene's Begin and End script fragments run only once each - Begin when the scene first starts, and the End when the scene actually ends. They do NOT run each time the scene loops.
http://www.creationkit.com/Category:Scenes#Repeating_scenes

BUT, I found when I talked to the bard he would all the sudden click into the rest scene, as if it reset it and allowed it to play again. The snippet in the script that seems to be responsible is this:

    While MWBard.IsInDialogueWithPlayer()
            if Changesettings == False && (Stopsong == True || SavedPlayContinuous == False)
                Return
            endif
            Utility.Wait(1)
            Debug.Trace("Playsongs is waiting...")
        EndWhile

So I figure since I switched packages at the end of the singing scene, I could call on a package check like this:

    While (MWBard.GetCurrentPackage() == MWBardBreakPackage)
            if Changesettings == False && (Stopsong == True || SavedPlayContinuous == False)
                Return
            endif
            Utility.Wait(1)
            Debug.Trace("Playsongs is waiting...")
        EndWhile

I get this warning, so it looks like that won't work.
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MorrowindBardsSongsScript.psc(181,15): GetCurrentPackage is not a function or does not exist
No output generated for MorrowindBardsSongsScript, compilation failed.

My goal is to activate the snippet that resets the NPC, somehow.

Do you have any ideas, full script attacted. (probably has a bunch of things I am not using anymore, but I stripped out a lot, so, it's easier to read that it was.

Any ideas would be helpful,

 

Karma: 0 (0 votes)
Last edited by grumpycat on 14 Mar 2014 - 23:05.

MWBard is objectreference in your script but getcurrentpackage is actor function you need to cast it (MWBard as Actor).GetCurrentPackage() to solve error. But maybe this script can be made better it looks much more complicated than it should.

Karma: 0 (0 votes)

I don't know really, just guessing, the only thing I do know if that it will run the rest scene one time, and the next time it's triggered after a music set it doesn't seem to take. Very frustrating.

Karma: 0 (0 votes)

Duckbat

MWBard is objectreference in your script but getcurrentpackage is actor function you need to cast it (MWBard as Actor).GetCurrentPackage() to solve error. But maybe this script can be made better it looks much more complicated than it should.



Yeah, I tried that too, to a different error. I agree, the original bard system was way more complicated than it needed to be, it's no wonder there are few modders who tackle bards. So many conditions, LocTypeRefs, and a variety of other things. I've already broken the multiple quests down to three, I figure before I'm done I'll have it down to two, Adding bard audience aliases to the main quest instead of having a separate quest. This is basically holding up my progress till I make a workaround or something to keep the scenes running.
Karma: 0 (0 votes)

Double post.

Karma: 0 (0 votes)

Let me explain the way I've been making it more or less work.
At the end phase of the song set scene that leads to the break scene I have the following fragments. In the scene script I start off as BardRest=FALSE as a property

Start:
BardRest=TRUE
;there because I am switching packages from travel to sandbox with a bool variable
MWBard.GetActorRef().EvaluatePackage()

End:
(GetOwningQuest() as MorrowindBardsSongsScript).PlaySongRequest(MWBard.GetActorRef(),"Rest")

____________________________
At the end of the break scene I have:
This scene's script starts off with BardRest=TRUE as a property

Start:
BardRest=FALSE
MWBard.GetActorRef().EvaluatePackage()

End:
(GetOwningQuest() as MorrowindBardsSongsScript).PlaySongRequest(MWBard.GetActorRef(),"MusicSet")


The end of the Rest scene works without fail, every time. The end of the music scene almost never works, unless of course I start talking to them after the music scene has ended, then they jump right into the rest scene after I close the dialog menu, every time.

.

Karma: 0 (0 votes)

OK, I fixed it, I replaced the slapdash 3 if statements in concurrence for an if/elseif/endif and voila, it worked, finally, I can focus on the audience. :)

Cheers.

Karma: 0 (0 votes)

Victim of sloppy code.

Karma: 0 (0 votes)