Jump to content

Khajiit caravans stoped moving around


UlvArn

Recommended Posts

I don't know if this issue is still relevant or not, but for closure's sake, I'm gonna post my fix. 
Before going any further, at this point, using console command you should at least try:

  1. sqv Caravans

    to check khajit caravan quest (the quest that controls caravan movement around Skyrim) for any missing variable value, and whether the quest is running or not 

  2. If there're any irregularities, one could try:

    resetquest Caravans

If the issue still persists, you could try my solution and you should ALWAYS CREATE A BACKUP SAVE, because my fix is basically using a simple mod created in xEdit and simple papyrus scripting (possible in Notepad) to jumpstart the Caravans quest. 

I'm using UNOFFICIAL PATCH  as it's provided me with source file that I can debug, i.e. "caravanleaderscript" and "CaravanScript". 

The Problem:
To update whether the caravans should move around, CaravanScript uses this so-called "one-shot event handler" which systematically calls on itself after 24h game time. So the script re-primes the game engine to listen for the Event "OnUpdateGameTime" each time the interval expires, in the context of papyrus scripting this is called event registration, you could either use "RegisterForSingleUpdateGameTime" for one-shot event handler registration or "RegisterForUpdateGameTime" for persistent event handler.
NOW, there's a possibility during your gameplay, that after the event fires (and re-primes itself) your save file loses this information to re-prime the game engine in later game loads (or maybe some mod or misuse causes it, idk, don't intend to investigate further). So when this save is loaded, the "script-intended" game state that should have listened to the event, now won't. It's the (possible) failure of the Unofficial Patch CaravanScript, where the chain of this so-called event re-priming is snapped and the Khajit Caravan can't lead themselves to the warm(er) sand. (they're stuck in Dawnstar and Windhelm :c) 

Solution preface:
Now I can't ensure that this is the only problem that's causing the bug, there's also a possibility that the event didn't fire in the first place, so it can't re-prime itself, but the next step is apparent, jumpstart the event handler, and see whether the chain will run as intended. FOR ME THIS IS THE SOLUTION. Fortunately,  after the jumpstart, the "OnUpdateGameTime" defined in caravanleaderscript is successively called and re-primes itself to keep the khajit moving.
 

The Solution:
TOOL NEEDED:  B.A.E, Papyrus Compiler, Text Editor, Open mind (don't go into these steps with haste)

OUTLINE

  1. Modify (add script and recompile) caravan scripts (from Unofficial Patch) to show debug information when it's updating the caravan location. This is needed since we might have a different version of patch installed.
  2. Jumpstart the caravan update and event registration using the mod attached,
  3.  Save the file.
  4. Load the file, play the game for more than 24 HOUR GAME TIME, move around between cell, fast travel, serve, sleep, etc. This is important, because the onUpdateGameTime behaviour is stated as follows: 
    Quote

    May come in much later then you expect if the player is sleeping, waiting, fast traveling, or serving jail time. The event will only be sent once, after the sleep/wait/travel/serve period is over, so you should be prepared to handle hours passing between updates.

    so it's not really that accurate, which is why the Khajit caravans are sometimes hard to find, and move around a lot (theoretic 24 h update interval, so if they're traveling in the direction of its city's spawn location, then the update fires, it'll move to other location and you won't find them in the city you thought they'd be). And, fool around please! This is not a serious mode gameplay, just a test run, don't make any decision you'll later regret because it might not be in your saved game experience.

  5. Observe whether the caravan is moving and debug information shows. 
  6. If the debug information is shown multiple times during your gameplay then the event re-priming chain is working as intended (I'm done here) and the Khajit caravan will move around again. You can load the save you made at outline no. 3, remove the modified caravans script, and then play as usual.
  7. Debug further if no debug info is shown, retrace the steps below.

STEPS:

  1. Open BAE, load Unofficial Patch, uncheck all, go to script -> source, find: "CaravanScript.psc", extract to your game folder /data, and just select the "data" folder, BAE will place the script where it should be. 
  2. Open the CaravanScript (notepad is adequate), find "Function UpdateCaravan(......)"  on the first line below the function, enter: 
    Debug.Notification("CARAVANT [" + WhichCaravan  +"] " +  LeaderRef.GetDisplayName() + " IS UPDATING NOW")

    save the file, and make sure it's saved as ".psc" and not ".txt"

  3. Open Papyrus Compiler, for "CaravanScript.psc" do the following:

    1. dropdown input, select file (not folder), make sure "compile whole folder" is unchecked

    2. make sure "Optimize", "NoAsm" is unchecked

    3. on output folder section check "Use source parent folder"

    4. COMPILE

  4. Install the CaravanJumpstartPower mod attached in this post. 

  5. Open skyrim with the mod loaded, open console command 

    help CaravanQuestJumpstartPower

    inspect the returned value, find the ref to the SPEL of your jumpstart lesser power, then 

    player.addspell xxxxxxxx

    replace "xxxxxxxx" with SPEL ref 

  6. Move away from the caravan's spawn area to a different cell location, Equip the power from your power menu, activate it [shout key]. there should be debug notifications on the top left of your game window ex. "CARAVANT [2] Ahkari IS UPDATING NOW",  which is an update by the jumpstart mod, when the caravans is updated by the game engine it'll show similar messages.
    DON'T SPAM THE POWER, I made the script very simple so that it won't save any form into the saved .ess except the object reference to the caravan script itself.

  7. Return to the caravan's spawn area. The caravans might still be there even after you jumpstart the quest, on my other instance, they're completely packed up and ready to go on the road trip (with the follower following the leader from behind). There's also this distinct "dungeon cleared", "cave cleared" sound played by the game after the jumpstart happens. I guess there's some time delay between when the jumpstart ignited and the actual action performed by Skyrim depending on your game engine overhead at the time. 

  8. Goto Solution Outline no. 3 

  9.  [Optional] When stuck, you could try to experiment further by adding some code in "MyScript.psc" and recompile it:

    Caravan.InitArrays() ;force quest variable to reinit without checking state

    place it before the caravan updating routine, and rerun the solution from outline no. 2

 

Good luck.

 

CaravanJumpstartPower.7z

Edited by rip96
clarity
  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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