staalo18 Posted October 31 Share Posted October 31 It seems that unlike other actors in Skyrim, object references of dragons are switching worldspace along with the player. You can test this by creating a new (empty) mod: Place a new dragon (object reference) somewhere into Skyrim. Add this mod to your mod list and start Skyrim. Use the console, select the dragon (so that the dragon's id is showing), and type "getInWorldSpace tamriel". It will show 1 as answer. As soon as you fast travel to (eg Whiterun) via map, the same command will yield 0 for the dragon, but "getInWorldSpace whiterunworld" will now show 1. Doing the same with other type of actors (I tested a cow that I placed into Skyrim) shows that they remain in Tamriel Worldspace, and not switch worldspace along with the player. So this mechanism for dragons seems to be hardwired into the game engine. I am wondering what's the reason for this, and of course if there is any way to circumvent this. Ie how can I make the dragon references stay in their worldspace when the player switches to a new worldspace? Any feedback is welcome! Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 31 Share Posted October 31 Honest answer: No idea. Does the same happen with existing unique dragons? i.e Alduin, Paarthurnax, etc... Link to comment Share on other sites More sharing options...
staalo18 Posted November 1 Author Share Posted November 1 I only tested with vanilla levelled dragons so far, and the answer for them is: no. When I check for Worldspace via console for such a dragon after travelling to Whiterun ("getinworldspace tamriel"), there is no result in the console (ie neither 0 or 1, just no answer returned). So I made mod I had generated a master file (ie set ESM flag in SSEdit). Then I see the same also for the inserted dragon, ie no result returned. Same with hand-placed cows. Link to comment Share on other sites More sharing options...
staalo18 Posted November 2 Author Share Posted November 2 What I learned so far: Dragons are switching Worldspace along with the player as long as the new worldspace has the same parent worldspace, AND that new worldspace has the "Use Sky Cell" checkmark activated. Ie it shares the same sky cell with the parent worldspace. Flying dragons seem to be part of the Sky Cell. Eg WhiterunWorld's parent worldspace is Tamriel, and it has "Use Sky Cell" activated. When the player moves from Tamriel to WhiterunWorld, the hand-placed dragons are moving as well. On the other hand, when the player moves from Tamriel to Solstheim (does not have a parent worldspace), the dragons do not move along. Likewise, if you uncheck "Use Sky Cell" for WhiterunWorld, the dragons also don't move along when the player switches from Tamriel to WhiterunWorld. Haven't figured out yet why vanilla dragons (and handplaced dragons in ESM'ed mods) do not follow this procedure. Link to comment Share on other sites More sharing options...
Sphered Posted November 2 Share Posted November 2 The idea behind it was to have dragon attacks that were happening outside a major hold, to also continue if you zone inside. This game was made to work on PS3 remember, which is why we had to deal with zoning here at all. So if dragons were flying above you when you walk into Whiterun, then magically disappear after you cross that gate, yeah. Anyway that was the thought process behind it. Resolved with mods later, at least somewhat. One of the many incomplete things that didn't make it to 11/11/11 release. And I am old now 1 Link to comment Share on other sites More sharing options...
staalo18 Posted November 2 Author Share Posted November 2 @Sphered Makes sense. That also matches my further testing. In contrast to what I stated earlier, also vanilla dragons switch worldspace along with the player, as long as they are flying, and Tamriel is the parent worldspace. (I must have tested with a grounded vanilla dragon). So they behave the same as my inserted dragons. Those also only switch worldspace when they are flying. When they are grounded, their Worldspace stays Tamriel. My problem with this is that sometimes my dragons are triggered to land (via script, SetAllowFlyingEx()). When the player switches worldspace while they are in the process of landing, they switch along with the player, and then land in a city, instead of where they should have been landing in Tamriel. I can catch these situations in my scripts, and re-enable flying for them. Then they will take off again and fly away from the city. But it's still breaking immersion to see them show up in the city, when they should be somewhere else. Any ideas on how to approach this? Link to comment Share on other sites More sharing options...
Sphered Posted November 2 Share Posted November 2 I worked on a project once where we had a dark world version of Skyrim. Dark Whiterun for instance, where dragons ruled. I used a portal to go between the two worlds, so I basically had full control of what happens before/after I cross. Before I entered, I spawned a bunch of them via script, and added them to a formlist. When I use my portal to leave, I would fade screen-to-black, and run a routine which takes a couple seconds, to disable and remove all the dragons in that list, before player returns to the light world. This prevented crossover, since they no longer existed. They were simply removed from the equation entirely. I could do this because I fully controlled the situation, and I simply never had unexpected dragons to contend with I just know they will cross worldspaces under certain conditions, which like you pointed out, are part of the game engine. They may simply need to be flying, or there might be a IsInCombat check, etc. My method worked to prevent crossover, so I stopped exploring other ways. So in short, I would start with tracking all of them in a list or something, and to explore using a script to zone to and from this place instead of a door, if realistic. Easier if there is only one entrance/exit, and to regulate it via script. Probably could work with a normal door or trigger areas, but imo you can control what happens better if you control the passage in between world A and B, and do things before/after teleporting the player Link to comment Share on other sites More sharing options...
staalo18 Posted November 2 Author Share Posted November 2 Yes, was thinking about that type of approach as well. But I fear that for my case it will not be as clean as in the setup you describe, because I have no control over the player's worldspace transitions. They might even use COC , and it still needs to work reliably. I can catch the worldspace change, eg via OnCellDetach() on the dragon, and there test for "illegal" Worldspaces. I could disable the dragon right away when it follows the player into a such a worldspace. But how to reliably re-enable it when the player returns to Tamriel (or Solstheim, for that matter)? And how to ensure that it re-appears at the location where it was before the initial worldspace switch? Not to forget that OnCellDetach() might not even fire if the dragon is not one of the neighboring cells of the player (ie is already detached). I might be finding answers to this, but I don't like the complexity of this approach, because it's too easy to make a mistake in the bookkeeping. I don't want a dragon to get lost through it, or to be bugged in other ways. Link to comment Share on other sites More sharing options...
staalo18 Posted November 2 Author Share Posted November 2 Hmm, just a thought: Add a package to the top of the dragon's package list. That package has condition "if in illegal worldspace". Attach script fragments On Begin (disable dragon if currently enabled) and On End (enable dragon if it was disabled on Begin). I'll experiment with that thought a bit. Link to comment Share on other sites More sharing options...
xkkmEl Posted November 2 Share Posted November 2 1 hour ago, staalo18 said: Hmm, just a thought: Add a package to the top of the dragon's package list. That package has condition "if in illegal worldspace". I doubt package conditions can be this reactive. Use an actorless scene instead. Their completion conditions get evaluated every frame (> 20/s). Link to comment Share on other sites More sharing options...
Recommended Posts