Jump to content

Creating a Forced Dialogue After a Scene Ends


LevisageDeDior

Recommended Posts

Hello!

I've recently learned how to create custom dialogues using quests. Everything works great for simple dialogues that just flow from Start -> End.

However, I'm having trouble setting up a quest that works like this:

  1. The player chooses correct topic, and the conversation continues for a while.
  2. OStim scene starts.
  3. After the scene, the player and NPC return to talking (NPC forces the dialogue, a good example is Whiterun guard rushing ur face to tell you that you can't enter the city because of the dragon)

The goal is to FORCE the next "branch" on the NPC right after the OStim scene ends. I want to add some romance to my follower and not have the "Alright, see you" situation ^^
So far the only thing I manged to do are the first 2 steps, starting the quest and ending up on forcing the OStim scene.

I've tried creating a custom package using a "ForceGreet" template. I assigned that package to the player dialogue in the quest. Long story short, I made a lot of adjustments to the package and quest, to the point where I no longer had any idea what I was doing.

I’d really appreciate some help with this, as I spent an half day just trying to make an NPC force a dialogue after the scene. It can't be that hard, right? My head is literally about to explode xD

Link to comment
Share on other sites

Have your scene, after starting sex, wait for the end of sex.  Then have your scene place the forcegreet package on the NPC.

I haven't used OStim... in Sexlab, have the scene wait on a "Alias: NPC hasKeyword SexLabActive != 1.00" before setting the forcegreet package.

Or perhaps I misguessed where you are stuck...

 

 

Link to comment
Share on other sites

The topic itself is just a player dialogue topic.  If you can activate the NPC and see it offered, it will work for the forcegreet.  You can also make the topic branch "normal" (instead of "top level") so you don't see it when activating the NPC.

The AI is equally simple.  Use the forcegreet template, point it to your topic.  For all the locations it wants you to configure, just center them on the player, radius 5000.

All the magic will happen in a scene.  So create a new scene, add your two actors (player and NPC), and update your initial dialogue so that it ends with a script fragment that starts your scene.  The scene itself is a list of phases with script fragments, conditions and actions.  It should look something like this:

phase 1 start - script starts OStim

phase 1 end - use end conditions to wait for the end of sex (not sure how to do this with OStim; likely a keyword test).

phase 2 start - add a package action to the NPC in which you add your forcegreet package

phase 2 end - wait until forcegreet ends (isSceneActionComplete myscene,1 == 1.00 AND NPC.isInDialogueWithPlayer != 1.00 AND NPC.isGreeting != 1.00 AND NPC.isTalking != 1.00)

That should be it...

In general, AI packages have to be "placed" on the Actor... either in its CK record, in a reference alias, or a scene, or via ActorUtil.psc.  Using AI packages is confusing at first, but mostly because the documentation is so fragmentary.  In the end, they are fairly simple... just a matter of placing and removing them just at the right time (CK record if it's about being live or dead; quest alias when it's quest start / stop; or a scene if you have a specific sequence of events to wait for).

Link to comment
Share on other sites

Thanks, I will check it out in a moment. Yeah, I don't know either how to do it with OStim. Took me a LOT OF TIME to even learn how to trigger the scene for the player and the npc he's talking to. v_v

So far for me it worked a bit like Quest1 ends as OStim action -> ForceGreet package linked to a player dialogue that was supposed to trigger after the scene -> and that dialogue was linked to "walk away" dialogue which ended the convo with goodbye.

I made it basing on how SexTalk mod works, it's on LoversLab, so I won't link it.

Anyways, I'll try again (pain)

Link to comment
Share on other sites

I am doing a similar thing with a mod I am working on, except there, a force-greet is triggered by opening a prison door.

The FG package is at top of package stack on the alias, but is on a condition. Opening  the door runs a script, advancing quest stage, and setting condition for the package.   The key element, however, is calling EvaluatePackage() on the NPC (or TryToEvaluatePackage() on the alias)

The TopicInfo initiated by the FG package has a fragment to clear the condition for package.

About OStim:  I have not yet explored the structure of new non-0SA OStim, but the older one was based on ModEvents.   It would send out events on scene start, on adding actor to scene, on mid-scene undress, on animation change, and yes, on scene end as well.  This essentially created an API for various other mods to latch onto.  I am pretty sure that new one does this as well, will need to check.

So essentially when launching a scene, you RegisterForModEvent of OStim scene end, and in the mod event handler, initiate the package.

Link to comment
Share on other sites

I ran into difficulties using events in SL.

Sometimes, you get a successful start (from return code) but no AnimationStart or AnimationStarted event.  Sometimes you get a successful start, AnimationStart, AnimationStarted, but no AnimationEnding or AnimationEnded.  I've had to patch SL to make my mod work consistently.  Using the SexLabActive keyword is simpler and more reliable if you can test it in a scene end condition; I am still patching because there are cases in which I don't want to have a 15 scenes hanging on SL threads.

Hopefully OStim provides a keyword or handles the events better than SL.

Link to comment
Share on other sites

I have no idea what you guys are talking about, but once I'm done making the standalone follower, I will dive deep into it. I decided not to do it on a regular NPC just for test for the sake of not repeating this proccess later. This is a head bomb for me. I'm happy to hear more from you Scorpio once you'll dive into OStim.

When I decided to make something like this I never expected it to be such a trouble for me LOL 

Link to comment
Share on other sites

Checking OStim github shows the scripts support it.  Mods can send custom events to each other.  

So, in the script function where you launch the OStim scene, you add:

RegisterForModEvent("ostim_end", "OstimEndHandler")

In the same script, you add a function:

Event OstimEndHandler(String eventName, String strarg, Float floatarg, Form sender)

    Utility.Wait(2.0) ; let it really finish

    UnregisterForModEvent("ostim_end")

    ; do whatever will enable the condition for the forcegreet package

    NpcAlias.TryToEvaluatePackage()

EndEvent

 

Link to comment
Share on other sites

I'm sorry, but I have no experience in coding. Is it suppose to look like this?

The Scripts that starts scene alone:

Actor[] Actors = new Actor[2]
Actors[0] = akSpeaker
Actors[1] = Game.GetPlayer()
OThread.QuickStart(Actors)

And the final script that start the scene + function that allows for the package to be activated: (questionable xD) PASTED INTO PYTHON END Script - Because I want it to actiavate at the end of the dialogue, then after the scene trigger another one with the use of ForceGreet package

Actor[] Actors = new Actor[2]
Actors[0] = akSpeaker
Actors[1] = Game.GetPlayer()
OThread.QuickStart(Actors)

RegisterForModEvent("ostim_end", "OstimEndHandler")
Event OstimEndHandler(String eventName, String strarg, Float floatarg, Form sender)
    Utility.Wait(2.0)
    UnregisterForModEvent("ostim_end")
    NpcAlias.TryToEvaluatePackage("here goes the name of my package")
EndEvent
    
Link to comment
Share on other sites

  • Recently Browsing   0 members

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