Jump to content
IGNORED

[Solved - thank you!] Quest to repeat a script on timer


Recommended Posts

So, I am trying to have an ongoing quest which picks two random actors, performs a script on them, then release and activate a timer. On timer, pick another two (or the same, just random), rinse and repeat - just pretty basic.

 

I am aware I need a quest to pick two aliases, I think I can manage to do that.

 

What I don't know is how to call the script on the two aliases, and then reset the timer - this is what I need help with. I've seen a couple of implementations (RSE RS and Hardship), but there is a lot more content there than what I need and I get lost in the complexity trying to re-engineer just the bare bones run script / repeat on timer

 

Please help :) TY

 

Link to comment

You need to attach the script to your quest. Then in that script create a variable of type ReferenceAlias, point it to your references as defined in the Quest.

That way you can reference your actors through ReferenceAlias.GetActorRef().

 

I would try to use the Story Manager if possible. That's the best way to have random acts happen at random intervals and you likely wouldn't need an elaborate script to loop and check for time passed, etc..etc.. I'm not too proficient in Story Manager stuff but I might be able to help more if you explain the exact functionality you're trying to create.

Link to comment
43 minutes ago, Reginald_001 said:

You need to attach the script to your quest. Then in that script create a variable of type ReferenceAlias, point it to your references as defined in the Quest.

That way you can reference your actors through ReferenceAlias.GetActorRef().

 

Sounds good. How do I do that? And what about the timer?

 

43 minutes ago, Reginald_001 said:

 

I would try to use the Story Manager if possible. That's the best way to have random acts happen at random intervals and you likely wouldn't need an elaborate script to loop and check for time passed, etc..etc.. I'm not too proficient in Story Manager stuff but I might be able to help more if you explain the exact functionality you're trying to create.

 

What is the story manager? :) 

Link to comment
45 minutes ago, SAC said:

 

Sounds good. How do I do that? And what about the timer?

 

 

What is the story manager? :) 

Check out these links!

 

The basics about the Story Manager, important stuff to know about:

https://www.creationkit.com/index.php?title=Bethesda_Tutorial_Story_Manager

https://www.creationkit.com/index.php?title=SM_Event_Node

 

'Hours until reset' is the key component for looping SM events (!)

 

This doesn't describe your purposes but it is a good introduction to the story manager:

https://forums.nexusmods.com/index.php?/topic/5758122-mini-guide-how-to-use-sm-event-node-increase-level/

 

When it comes to scripting, depending on what you are trying to do you might not even need any scripts. If you can be more elaborate on what it is that you are exactly trying to achieve, my advice will be more relevant. ;)

 

To add scripts to a quest check the movie I made for you and this small tutorial:

 

1 - In your quest go to the scripts tab:
image.png.6b8ee150548866000b17fe2c151d7c60.png

2 - Check New script:
image.png.b1541e3a84fb83463f616060fefbc3fc.png

3 - Give it a proper name with a prefix of your modname.

4 - Double Click it to open the properties then click on 'Add Property' bottom left.

 

5 - Name it: p(the_exact_name_of_your_alias) then it will autobind to the reference alias in your quest.
(So if your reference alias is called 'Actor1' your property will be called 'pActor1' etc..)

image.png.5e6d73ed9259f44000a87765ed1a78c0.png

6 - Check to make sure your reference is FILLED
(Otherwise you made a type or chose the wrong reference type)


image.png.8a9a788de71d99da40bb41af55d5242f.png

 7 - Now you can REFERENCE the alias in script:

 


Actor Ivy;

Ivy = pIVYCOMP.GetActorRef()

 
Link to comment
4 hours ago, Reginald_001 said:

You need to attach the script to your quest. Then in that script create a variable of type ReferenceAlias, point it to your references as defined in the Quest.

That way you can reference your actors through ReferenceAlias.GetActorRef().

 

Thank you. I think I followed your guide, everything compiles, the quest runs in game, but either it's not filling aliases, or I am not "importing" the aliases properly into the script, because although the script runs (I get messageboxes), the NPCs don't get killed - to simplify testing, I've just put "kill" there, until I am comfortable everything works

 

Basically the quest loops, the script fires but nothing seems to happen

 

image.png

 

 

image.png

 

 

image.png

Link to comment
28 minutes ago, SAC said:

Thank you. I think I followed your guide, everything compiles, the quest runs in game, but either it's not filling aliases, or I am not "importing" the aliases properly into the script, because although the script runs (I get messageboxes), the NPCs don't get killed - to simplify testing, I've just put "kill" there, until I am comfortable everything works

 

Basically the quest loops, the script fires but nothing seems to happen

 

 

Actually, turns out that if I load an older save, the quest runs fine and two actors are killed. Problem is, when the timer resets, nothing further happens, which tells me the same actors get picked again (I suppose...), it doesn't refill the aliases.

 

So, how to I cycle a quest to refill aliases at each re-run? I've tried stop/reset/startquest, no joy

 

Link to comment
25 minutes ago, SAC said:

 

Actually, turns out that if I load an older save, the quest runs fine and two actors are killed. Problem is, when the timer resets, nothing further happens, which tells me the same actors get picked again (I suppose...), it doesn't refill the aliases.

 

So, how to I cycle a quest to refill aliases at each re-run? I've tried stop/reset/startquest, no joy

 

That's where the Story Manager comes in. Read about it and try to get a test quest running, using that. It should make things far clearer for you.

Using script to set up the loop doesn't sound like the right approach. It might work in the end, but it'll give you a headache to set it up and get working right. The story manager will give you a far more stable option for both filling random aliases each time around and making the quest repetitive.

 

As example, the Story Manager Event nodes are used to kick off dialogue for all companions. It works very similarly to what you're trying to achieve. Although the end-result is completely different, the technical means to get there are very similar.

 

You will also want to check for some kind of keyword or conditionals in the actors, to make sure they don't fill with an actor that you don't want killed or used in this, or an actor that disallows reserving (e.g. actors that are already reserved in another running quest).

Link to comment
24 minutes ago, SAC said:

 

Actually, turns out that if I load an older save, the quest runs fine and two actors are killed. Problem is, when the timer resets, nothing further happens, which tells me the same actors get picked again (I suppose...), it doesn't refill the aliases.

 

So, how to I cycle a quest to refill aliases at each re-run? I've tried stop/reset/startquest, no joy

 

Self.Reset()

Self.Stop()

Self.Start()

 

Which of these do you think is the problem?

If you said all of them, you'd be right.

 

First thing, self.Reset(), this stops the quest so it can 'reset' all of its quest stages - not needed by people who are not making their quest have repeatable quest stages. But most importantly, in order to reset it, as I said, it stops the quest. Meaning, it stops the script from running too. So the STOP and START lines never even get executed.

 

Second, why are you stopping and restarting in the first place? For what you are trying to do, this is a pointless step to take, because the script stops running as noted above.

 

Do this instead:

 

Event OnQuestInit()

     StartSexFunction()

EndEvent

 

Function StartSexFunction()

     Actor NPC1 = pNPCMale1.GetActorRef() as Actor

     Actor NPC2 = pNPCFemale1.GetActorRef() as Actor

     NPC1.kill()

     NPC2.kill()

     StartTimer(40,SAC_JF_Timer)

EndFunction

 

Event OnTimer(int TID)

     If TID == SAC_JF_Timer

          StartSexFunction()

     Endif

EndEvent

 

 

//

 

Obviously, replace the kill() functions with your callsex function down the road. But test this one out - it will run every 40 seconds and kill the two npcs, all without that reset/stop/start nonsense. :)

 

1 minute ago, Reginald_001 said:

That's where the Story Manager comes in. Read about it and try to get a test quest running, using that. It should make things far clearer for you.

Using script to set up the loop doesn't sound like the right approach. It might work in the end, but it'll give you a headache to set it up and get working right. The story manager will give you a far more stable option for both filling that aliases and making the quest repetitive.

Story manager is perfect, if one is changing location and wishing to start a quest in that way. But he is trying to create an autonomous sex function that fires every 40 seconds. I agree the best way might be to use a change location SM event to start the quest when one enters a player owned settlement and then add code to the script on that quest, for OnLocationChange, where it looks at akNewLoc to see if it has the WorkshopSettlement keyword - and if not, stops the quest so that it is not running until one enters a settlement again.

 

 

Link to comment
9 minutes ago, Flashy (JoeR) said:

Story manager is perfect, if one is changing location and wishing to start a quest in that way. But he is trying to create an autonomous sex function that fires every 40 seconds. I agree the best way might be to use a change location SM event to start the quest when one enters a player owned settlement and then add code to the script on that quest, for OnLocationChange, where it looks at akNewLoc to see if it has the WorkshopSettlement keyword - and if not, stops the quest so that it is not running until one enters a settlement again.

Yes, Context is King. :)

For such a function, say every 40 seconds, just a running quest that fills a random alias should be enough.

You could even force the alias through script to another actor by using ForceRefTo, right?

Link to comment

New Code without needing to use Story Manage to fire the quest. This implies the quest is set to Start Enabled and will always run. The timer itself will only run if the player is in a settlement location and once they leave it, the timer will stop itself until player re-enters a settlement again.

 

Keyword Property LocTypeWorkshopSettlement auto

ReferenceAlias Property pNPCMale1 auto

ReferenceAlias Property pNPCFemale1 auto

 

Event OnQuestInit()

     RegisterForRemoteEvent(Game.GetPlayer(),"OnLocationChange")

     RegisterForRemoteEvent(Game.Getplayer(),"OnPlayerLoadGame")

EndEvent

 

Event Actor.OnPlayerLoadGame(actor akSender)

      Location Where = Game.GetPlayer().GetCurrentLocation()

      If Where.HasKeyword(LocTypeWorkshopSettlement)

          StartTimer(40,100)

      Endif

EndEvent

 

Function StartSexFunction()

     Actor NPC1 = pNPCMale1.GetActorRef() as Actor

     Actor NPC2 = pNPCFemale1.GetActorRef() as Actor

     NPC1.kill()

     NPC2.kill()

     StartTimer(40,100)

EndFunction

 

Event OnTimer(int TID)

     If TID == 100

          StartSexFunction()

     Endif

EndEvent

 

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)

     if akSender == Game.GetPlayer()

          if akNewLoc.HasKeyword(LocTypeWorkshopSettlement) == false

               canceltimer(100)

          else

               starttimer(40,100)

          endif

     endif

EndEvent

 

 

 

Link to comment
41 minutes ago, Flashy (JoeR) said:

 

Obviously, replace the kill() functions with your callsex function down the road. But test this one out - it will run every 40 seconds and kill the two npcs, all without that reset/stop/start nonsense. :)

 

 

 

Wish this worked, but it doesn't. Meaning it does cycle the script, however it does not cycle the aliases.

 

It happened I've tested it with a bunch of random NPCs, out of which a couple were essential. Guess what, even as I've changed location within the crowd, the initial two essential NPCs kept "dying" (that's how I could tell it was not picking new ones but staying with the initial ones)

 

 

Uploading what I've got so far, please ignore the sexor function, it's not in play until I manage to sort out the basics

 

SAC_JF.rar

Link to comment
11 minutes ago, SAC said:

 

Wish this worked, but it doesn't. Meaning it does cycle the script, however it does not cycle the aliases.

 

It happened I've tested it with a bunch of random NPCs, out of which a couple were essential. Guess what, even as I've changed location within the crowd, the initial two essential NPCs kept "dying" (that's how I could tell it was not picking new ones but staying with the initial ones)

 

 

Uploading what I've got so far, please ignore the sexor function, it's not in play until I manage to sort out the basics

 

SAC_JF.rar 3.22 kB · 0 downloads

Oh yeah... you need to refresh aliases.

 

Create a second quest. It will be the one with the aliases.

 

So the script I wrote, put it on its own quest, start enabled.

Then create a second quest that has the aliases in it. For example purposes, Ill just call it AliasQuest.

 

New script code:

 

Keyword Property LocTypeWorkshopSettlement auto

ReferenceAlias Property pNPCMale1 auto

ReferenceAlias Property pNPCFemale1 auto

Quest Property AliasQuest auto

 

Event OnQuestInit()

     RegisterForRemoteEvent(Game.GetPlayer(),"OnLocationChange")

     RegisterForRemoteEvent(Game.Getplayer(),"OnPlayerLoadGame")

EndEvent

 

Event Actor.OnPlayerLoadGame(actor akSender)

      Location Where = Game.GetPlayer().GetCurrentLocation()

      If Where.HasKeyword(LocTypeWorkshopSettlement)

          StartTimer(40,100)

      Endif

EndEvent

 

Function StartSexFunction()

     If AliasQuest.IsRunning() == false ; check to see if already running, if not, start functions. If it is, ignore it for now so as to now interrupt a current scene.

          AliasQuest.Stop()

          AliasQuest.Start()

          If AliasQuest.IsRunning()

               Actor NPC1 = pNPCMale1.GetActorRef() as Actor

               Actor NPC2 = pNPCFemale1.GetActorRef() as Actor

               NPC1.kill()

               NPC2.kill()

               ;or DoSexStuff(NPC1,NPC2), to call sex scenes instead of the kill commands
          Endif

     Endif

     StartTimer(40,100)

EndFunction

 

Function DoSexStuff(actor NPC1, actor NPC2)

     ; in here do your sex scene stuff. Dont forget to STOP the AliasQuest when all sex functions end, typically in your AAF OnSceneEnd event.

     ; that way, the AliasQuest is ready to be restarted on next scan cycle.

     ; it is important to keep the AliasQuest running until all scenes are complete, so the aliases remain intact.

     ; but most importantly, with the AliasQuest running, a new scene will not be restarted, killing the current running one early.

     ; again, it is VERY important to STOP the AliasQuest when your sex scene ends, so NPCs return to normal AND the function can run again.

EndFunction

 

Event OnTimer(int TID)

     If TID == 100

          StartSexFunction()

     Endif

EndEvent

 

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)

     if akSender == Game.GetPlayer()

          if akNewLoc.HasKeyword(LocTypeWorkshopSettlement) == false

               canceltimer(100)

          else

               starttimer(40,100)

          endif

     endif

EndEvent

Link to comment
53 minutes ago, Flashy (JoeR) said:

Oh yeah... you need to refresh aliases.

 

Create a second quest. It will be the one with the aliases.

 

So the script I wrote, put it on its own quest, start enabled.

Then create a second quest that has the aliases in it. For example purposes, Ill just call it AliasQuest.

 

 

 

I'm sorry, but I don't get it. I understand that AliasQuest is supposed to provide the aliases (+also run sex?), and the other one ("TriggerQuest") is supposed to trigger and cycle the AliasQuest (how?)

 

Am I supposed have alias scripts in both quests? This doesn't make sense

 

I am guessing that either:

- I put the second script in the AliasQuest, but then how do I use the TriggerQuest to cycle the AliasQuest?

or

- I use the AliasQuest to just provide the references without any script at all, and the sex gets called by the TriggerQuest using the AliasQuest aliases (I've already tried this, it doesn't seem to do anything)

 

Right now I've got

- AliasQuest with its aliases and a mighty fine script, but no way to start / restart it

- TriggerQuest start enabled, but no idea which script to add to it

 

Sorry about the bother, this was supposed to be simple :) 

Link to comment

Stop whatever you are doing with this and follow what I am writing, in an EMPTY esp file.

 

1. Create a Quest. Make it START ENABLED. Name it StartUpQuest. Click OKAY to close the window.

2. Edit StartUpQuest. Go to the QUEST tab and add a script.

3. Put the script I provided above into the new script on that quest.

4. Control-S to compile and save the script. Do not worry about the PROPERTIES yet, as we don't have the second quest made.

5. Create a new quest. Call it AliasQuest. Disable START ENABLED and RUN ONCE (uncheck them both). Click on ALIAS tab and create an alias.

6. In this alias, name it NPC1. Click ALLOW RESERVED. Add your conditions. Likely, GetIsSex == Male == 1. (Use this alias for male NPCs). Click OKAY to close window.

7. Create a new alias. Name it NPC2. Click ALLOW RESERVED. Add the GetIsSex == FEMALE == 1 condition. Click OKAY to close the window.

 

{NOTE: for these two aliases, use FIND MATCHING REFERENCE, actors only, in loaded area and choose closest to player.}

 

8. Click OKAY to close the quest window.

9. Edit StartUpQuest. Go to QUEST TAB. Click on the script and then click on PROPERTIES. Auto-Fill. Should fill two of the four properties.

10. For the aliases, find the AliasQuest in the questname drop down and then fill in NPC1 and NPC2 respectively.

 

Save this mod.

 

Add to your game.

 

When you enter a settlement, the script on StartUpQuest will see you entered the settlement and start the timer. 40 seconds later, if there is a male and a female NPC in range, they will be filled into the aliases and the sex scene you create will run. At this point, you can start looking in the console to see if the aliases are filled.

 

SQV AliasQuest

 

It will either say RUNNING or STOPPED. If running, you can use page up to see the two aliases and the refids of the NPCs in the aliases.

 

That there alone tells you the script and esp are running as expected. And if you built an AAF calling function, you should see the two NPCs doing their thing.

 

I cant get into more detail than this right now as I am buried in my own mod, but this in a nutshell is what you need to do.

Link to comment
13 hours ago, Flashy (JoeR) said:

Stop whatever you are doing with this and follow what I am writing, in an EMPTY esp file.

 

 

Beautiful, thank you very much!! It makes perfect sense (the trigger quest runs the business, the alias quest just provides aliases)

 

As you also wrote in the dosexstuff comments (those comments are also very important for future reference to whoever tries to replicate this), in the original format the alias quest runs once and never gets stopped/reset, so for now and for testing purposes I have just commented out the isrunning condition and it cycles properly. I'll see down the road how I manage this, I don't know (yet) how to listen for AAF events (I have declared AAF a master, hopefully it will just run as a "native" event)

 

I also commented out the locationtype condition, I don't want this to run just in settlements, but this is a minor aspect

 

So, for reference, the tutorial you wrote works great and to the letter, and the modded script so far is

 

@Reginald_001 I'm sure further down the road I'll be wanting to expand this into a proper interaction quest and I'll check out the story manager, for now I'll just need to learn how to stand up before attempting to run the marathon :)  Thank you!

 

Scriptname SAC_JF2_Startup_Quest_Script extends Quest
Keyword Property LocTypeWorkshopSettlement auto
ReferenceAlias Property pNPCMale1 auto
ReferenceAlias Property pNPCFemale1 auto
Quest Property AliasQuest auto

Event OnQuestInit()
     RegisterForRemoteEvent(Game.GetPlayer(),"OnLocationChange")
     RegisterForRemoteEvent(Game.Getplayer(),"OnPlayerLoadGame")
EndEvent

Event Actor.OnPlayerLoadGame(actor akSender)
      Location Where = Game.GetPlayer().GetCurrentLocation()
 ;     If Where.HasKeyword(LocTypeWorkshopSettlement)
          StartTimer(20,100)
          debug.messagebox("player load timer start")
 ;     Endif
EndEvent

Function StartSexFunction()
 ;    If AliasQuest.IsRunning() == false ; check to see if already running, if not, start functions. If it is, ignore it for now so as to now interrupt a current scene.
          AliasQuest.Stop()
          AliasQuest.Start()

		If AliasQuest.IsRunning()
               Actor NPC1 = pNPCMale1.GetActorRef() as Actor
               Actor NPC2 = pNPCFemale1.GetActorRef() as Actor
               NPC1.kill()
               NPC2.kill()
               Debug.MessageBox("sex start")

               ;or DoSexStuff(NPC1,NPC2), to call sex scenes instead of the kill commands
          Endif

 ;    Endif

     StartTimer(20,100)
     debug.messagebox("sex timer start")
EndFunction

Function DoSexStuff(actor NPC1, actor NPC2)

     ; in here do your sex scene stuff. Dont forget to STOP the AliasQuest when all sex functions end, typically in your AAF OnSceneEnd event.

     ; that way, the AliasQuest is ready to be restarted on next scan cycle.

     ; it is important to keep the AliasQuest running until all scenes are complete, so the aliases remain intact.

     ; but most importantly, with the AliasQuest running, a new scene will not be restarted, killing the current running one early.

     ; again, it is VERY important to STOP the AliasQuest when your sex scene ends, so NPCs return to normal AND the function can run again.

EndFunction

 

Event OnTimer(int TID)
     If TID == 100
          StartSexFunction()
          debug.messagebox("run ontimer")
     Endif
EndEvent

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
     if akSender == Game.GetPlayer()
 ;         if akNewLoc.HasKeyword(LocTypeWorkshopSettlement) == false
  ;             canceltimer(100)
   ;       else

               starttimer(20,100)
               Debug.MessageBox("location change timer Start")

    ;      endif

     endif

EndEvent

 

Link to comment

Just for reference, the v1 of the script complete with calling the AAF API / registering for events / handling the enscene event etc. Runs fine so far, triggers a twosome or a threesome on dice, "target" is either the player or a random female (again, on dice). Added the second male alias and player alias in the alias quest

 

 

Spoiler

Scriptname SAC_JF2_Startup_Quest_Script extends Quest

Keyword Property LocTypeWorkshopSettlement auto

ReferenceAlias Property pNPCMale1 auto

ReferenceAlias Property pNPCFemale auto

Quest Property AliasQuest auto

ReferenceAlias Property pNPCMale2 Auto

ReferenceAlias Property pNPCPlayer Auto


AAF:AAF_API AAF_API

Function LoadAAF()
    AAF_API = Game.GetFormFromFile(0x00000F99, "AAF.esm") as AAF:AAF_API
    If !AAF_API
        Debug.MessageBox("No AAF")
    Else
        RegisterForCustomEvent(AAF_API, "OnSceneEnd")
    Endif

 ;   Debug.MessageBox("AAF loaded")
EndFunction
 

Event OnQuestInit()

     RegisterForRemoteEvent(Game.GetPlayer(),"OnLocationChange")

     RegisterForRemoteEvent(Game.Getplayer(),"OnPlayerLoadGame")

     LoadAAF()

EndEvent

 

Event Actor.OnPlayerLoadGame(actor akSender)

 ;     Location Where = Game.GetPlayer().GetCurrentLocation()

 ;     If Where.HasKeyword(LocTypeWorkshopSettlement)

          StartTimer(20,100)

 ;         debug.messagebox("player load timer start")

          AliasQuest.stop()

          LoadAAF()

 ;         debug.messagebox ("game loaded")

 ;     Endif

EndEvent

 

Function StartSexFunction()

     If AliasQuest.IsRunning() == false ; check to see if already running, if not, start functions. If it is, ignore it for now so as to now interrupt a current scene.

          AliasQuest.Stop()

          AliasQuest.Start()

          If AliasQuest.IsRunning()

               Actor NPCMale1 = pNPCMale1.GetActorRef() as Actor
        
         Actor NPCMale2 = pNPCMale2.GetActorRef() as Actor


               Actor NPCfemale = pNPCFemale.GetActorRef() as Actor

        Actor NPCPlayer = pNPCPlayer.GetActorRef() as Actor

               Debug.MessageBox("sex start")

               DoSexStuff(NPCFemale, NPCPlayer, NPCMale1, NPCMale2)

          Endif

     Endif

     StartTimer(20,100)

;     debug.messagebox("sex timer start")

EndFunction

 

Function DoSexStuff(actor NPCFemale, actor NPCPlayer, actor NPCMale1, actor NPCMale2)

     ; in here do your sex scene stuff. Dont forget to STOP the AliasQuest when all sex functions end, typically in your AAF OnSceneEnd event.

     ; that way, the AliasQuest is ready to be restarted on next scan cycle.

     ; it is important to keep the AliasQuest running until all scenes are complete, so the aliases remain intact.

     ; but most importantly, with the AliasQuest running, a new scene will not be restarted, killing the current running one early.

     ; again, it is VERY important to STOP the AliasQuest when your sex scene ends, so NPCs return to normal AND the function can run again.


 ;        AAF:AAF_API AAF_API

;    AAF_API = Game.GetFormFromFile(0x00000F99, "AAF.esm") as AAF:AAF_API
     AAF:AAF_API:SceneSettings settings = AAF_API.GetSceneSettings()
    settings.duration = utility.randomint(60, 120)
    settings.preventFurniture = False
    settings.usePackages = False
    settings.position = None
    settings.includeTags = None
    settings.excludeTags = None
    settings.locationobject = Game.GetPlayer()
    settings.skipwalk = True
    settings.scanradius = 150


int participants = utility.randomint(2, 3)

Actor[] actors = new Actor[participants]

actors[0] = NPCMale1

int playerorfemale = utility.randomint(1, 2)

if playerorfemale == 1
    actors[1] = NPCFemale
else
    actors[1] = NPCPlayer
endif

if participants >= 3

    actors[2] = NPCMale2

endif


    actors[1].moveto(actors[0])
    actors[2].moveto(actors[0])
    utility.wait(1)

    AAF_API.StartScene(actors, settings)

EndFunction

 

Event OnTimer(int TID)

     If TID == 100

          StartSexFunction()

 ;         debug.messagebox("run ontimer")

     Endif

EndEvent

 

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)

     if akSender == Game.GetPlayer()
 ;         if akNewLoc.HasKeyword(LocTypeWorkshopSettlement) == false
  ;             canceltimer(100)
   ;       else

               starttimer(20,100)
;               Debug.MessageBox("location change timer Start")

    ;      endif

     endif

EndEvent

Event AAF:AAF_API.OnSceneEnd(AAF:AAF_API akSender, Var[] akArgs)
;    If AliasQuest.IsRunning()    
          AliasQuest.Stop()

 ;         debug.messagebox ("end scene")
;    Endif
EndEvent

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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