Jump to content

Script to allow Wolf to walk through doors?


Recommended Posts

50 minutes ago, Tearoth said:

Hi everyone.

I'm looking for a script to add to my Wolf Companion in SSEEdit to allow it to go through doors (Follow the player through into caves etc also)

Anyone know of a script i can add in SSEEdit?

 

That is controlled with the race record.  AFAIK you'd be better off just clicking "can use doors" for all wolves.

Link to comment
36 minutes ago, Seijin8 said:

 

That is controlled with the race record.  AFAIK you'd be better off just clicking "can use doors" for all wolves.


So there's no way to get a script that can do it instead? I'd rather not change all the Wolves.

Wouldn't it break the game in some aspects if all Wolves could go through doors?

Edited by Tearoth
Link to comment
57 minutes ago, Tearoth said:

So there's no way to get a script that can do it instead?

 

Of course you can do it with a script as well, but since you're asking for a pre-made script I don't really know. Nether's Follower Framework has wolves that can go through doors but last time I looked at it, it wasn't done with scripts but rather some convoluted package setup. Could be wrong though, I didn't completely map out its internal workings.

 

1 hour ago, Seijin8 said:

AFAIK you'd be better off just clicking "can use doors" for all wolves.

 

Thank you, nowhere on the internet was it mentioned this was a race-specific option. Many forums and sites mentioned "just tick this box and it works". For some reason I never thought to look for it in race records; I went through actors and packages and stuff like that.

 

1 hour ago, Tearoth said:

I'd rather not change all the Wolves.

 

Consider making your follower wolf use a custom race that can open doors. Consider the implications this has on your installed mods, specifically SL and MNC.

Link to comment
2 hours ago, Tearoth said:


So there's no way to get a script that can do it instead? I'd rather not change all the Wolves.

Wouldn't it break the game in some aspects if all Wolves could go through doors?

 

You may be able to do it through scripting, BUT the script will still change all the wolves because the ability to use doors is a race-specific flag.

 

@traison mentioned making a new race for your companion and that is good advice.  If you were intending the wolf to be used in Sexlab scenes, the new race would need to be registered for it (look at MNC's scripts for how to do this).

 

Last I checked, Nether's framework allows creature followers to use doors just through normal distance checks and teleports them if they are too far away (interior to exterior cells always read as being many millions of distance units away).  Beware though that the follower packages that ask them to use or traverse doors do not take the race flags into account, and this can cause crashes.

Sadly, when an AI package demands a certain action that the race isn't capable of doing, CTD is sometimes the result, and given that this is triggering on a package for something that may not be visible, it can make tracking the source very difficult.

Link to comment
9 hours ago, traison said:

 

Of course you can do it with a script as well, but since you're asking for a pre-made script I don't really know. Nether's Follower Framework has wolves that can go through doors but last time I looked at it, it wasn't done with scripts but rather some convoluted package setup. Could be wrong though, I didn't completely map out its internal workings.

 

 

Thank you, nowhere on the internet was it mentioned this was a race-specific option. Many forums and sites mentioned "just tick this box and it works". For some reason I never thought to look for it in race records; I went through actors and packages and stuff like that.

 

 

Consider making your follower wolf use a custom race that can open doors. Consider the implications this has on your installed mods, specifically SL and MNC.

 

I'll give it a shot. Thank you.

 

8 hours ago, Seijin8 said:

 

You may be able to do it through scripting, BUT the script will still change all the wolves because the ability to use doors is a race-specific flag.

 

@traison mentioned making a new race for your companion and that is good advice.  If you were intending the wolf to be used in Sexlab scenes, the new race would need to be registered for it (look at MNC's scripts for how to do this).

 

Last I checked, Nether's framework allows creature followers to use doors just through normal distance checks and teleports them if they are too far away (interior to exterior cells always read as being many millions of distance units away).  Beware though that the follower packages that ask them to use or traverse doors do not take the race flags into account, and this can cause crashes.

Sadly, when an AI package demands a certain action that the race isn't capable of doing, CTD is sometimes the result, and given that this is triggering on a package for something that may not be visible, it can make tracking the source very difficult.

 

I see. I'll give the custom race a try. Thank you.

Link to comment

Update:

FYI, i'm using the mod BUVARP SE RE, which added custom races to the jailed Wolf in White River Watch, and Pumpkin the Fox from Southfringe Sanctum. I had reverted them to regular Wolf and Fox races, but have now turned them back into their custom races ("BUV_WolfCompanionRace" and "BUV_FoxPumpkinCompanionRace")

I also added them into the "MoreNastyCrittersRaces.psc" script, but they're still not working with SexLab. Their state don't change with Arousal and Creature Framework either.

Is there something else i need to do to make them work?

Update 2:

Managed to get the Creature Framework stuff working with both of them. They're both changing state when becoming aroused. SexLab still won't allow me to use them, though.
Is a new save required?

Edited by Tearoth
Update
Link to comment
On 10/25/2023 at 12:25 AM, Seijin8 said:

You may be able to do it through scripting, BUT the script will still change all the wolves because the ability to use doors is a race-specific flag.

 

Actually as far as I know that's not possible. What I would have the script do is either be an ability (a spell) that checks where the player is, and if its not the same cell: teleport to the player. Option B (more reliable) is to attach the wolf to a quest alias, and have the alias attach a ReferenceAlias script to it doing the same check as the ability above. Regardless though, it seems the issue was solved with the custom race (probably the best option here).

 

On 10/25/2023 at 9:26 AM, Tearoth said:

Managed to get the Creature Framework stuff working with both of them. They're both changing state when becoming aroused. SexLab still won't allow me to use them, though.

 

I tried to change Dremora to be considered creatures by SLAC some time ago and noticed that SL has hardcoded races for these it calls "Creature Slots". I didn't look into it any further because this seemed like the kind of thing that would start affecting how animations work etc. I could be completely wrong though, maybe its as simple as editing a file somewhere.

 

I would start my investigation here: (sslCreatureAnimationSlots.psc)

scriptname sslCreatureAnimationSlots extends sslAnimationSlots
...
sslBaseAnimation[] function GetByRace(int ActorCount, Race RaceRef)

 

The first issue I see is that GetAllRaceKeys is declared as a native function, so its definition is going to be hidden most likely in SexLabUtil.dll. If that function is paramount in altering what is considered a creature (i.e. adding a new wolf race) then knowledge of c++ and recompiling the dll will be needed. If this is the case, I probably wouldn't bother with it myself and go the quest alias/script route.

 

Edit: Another way to approach this investigation would be to locate a mod that adds new creatures to Skyrim; specifically one that has SL support. If these add custom races, they also contain the answer to the SL problem. Mihail's various monster mods may have one such alternative, although I am not certain.

 

Edit again: The quest alias/script approach could look something like this:

  1. Add an alias to a new or existing quest.
  2. Set it to the player (or the actor the wolf should follow).
  3. (optional) Rename the script.
  4. Attach the script below to that alias.
  5. Create additional aliases for each follower that needs this "hack".
  6. Add these aliases to the Followers array of the WolfOpensDoorsSortOf script.
Scriptname WolfOpensDoorsSortOf Extends ReferenceAlias

ReferenceAlias[] Property Followers Auto

; TODO If OnCellAttach doesn't work, try: OnLoad, OnAttachedToCell, OnCellLoad
Event OnCellAttach()
    Actor who = GetActorReference()
    Cell myCell = who.GetParentCell() ; Reference parent cell
    
    int i = 0
    
    While (i < Followers.Length)
        Actor f = Followers[i].GetActorReference()
        
        If (f != None)
            If (f.GetParentCell() != myCell)
                f.MoveTo(who, 0, 0, 0, true)
            EndIf
        EndIf
        
        i += 1
    EndWhile
EndEvent

 

NOTE: Script not tested nor compiled. Should be close enough.

Edited by traison
Script fixed and compiled, not tested.
Link to comment
21 minutes ago, traison said:

 

Actually as far as I know that's not possible. What I would have the script do is either be an ability (a spell) that checks where the player is, and if its not the same cell: teleport to the player. Option B (more reliable) is to attach the wolf to a quest alias, and have the alias attach a ReferenceAlias script to it doing the same check as the ability above. Regardless though, it seems the issue was solved with the custom race (probably the best option here).

 

 

I tried to change Dremora to be considered creatures by SLAC some time ago and noticed that SL has hardcoded races for these it calls "Creature Slots". I didn't look into it any further because this seemed like the kind of thing that would start affecting how animations work etc. I could be completely wrong though, maybe its as simple as editing a file somewhere.

 

I would start my investigation here: (sslCreatureAnimationSlots.psc)

scriptname sslCreatureAnimationSlots extends sslAnimationSlots
...
sslBaseAnimation[] function GetByRace(int ActorCount, Race RaceRef)

 

The first issue I see is that GetAllRaceKeys is declared as a native function, so its definition is going to be hidden most likely in SexLabUtil.dll. If that function is paramount in altering what is considered a creature (i.e. adding a new wolf race) then knowledge of c++ and recompiling the dll will be needed. If this is the case, I probably wouldn't bother with it myself and go the quest alias/script route.

 

Edit: Another way to approach this investigation would be to locate a mod that adds new creatures to Skyrim; specifically one that has SL support. If these add custom races, they also contain the answer to the SL problem. Mihail's various monster mods may have one such alternative, although I am not certain.


I tried downloading several custom creature mods and looking into how they were set up, but i couldn't seem to find anything beyond what i've already done.

I've added them in "MoreNastyCrittersRaces.psc" and made new files for the "creatures.d" folder, to allow Creature Framework/MNC to add their erect states.

Beyond that, i don't see why it wouldn't work already. The "MoreNastyCrittersRaces.psc" already has a lot of custom added races put into it, to allow for compatibility with a lot of mods, without having to do what i'm doing right now.

As long as the custom race shares the rig/skeleton with a vanilla race, it should work.

Atleast that's what i've come up with, after researching it.

Edited by Tearoth
Typos
Link to comment
3 minutes ago, traison said:

This may sound silly, but did you check the papyrus log after attempting to start an animation with one of these custom creatures? Remember to put SL into debug mode first.


Hmm. I'll definitely give that a shot.

Link to comment

So the SexLab Papyrus Log says the following (My character is Miraniel):

[10/25/2023 - 01:38:53PM] NOTICE: ValidateActor(Miraniel) -- TRUE -- HIT
[10/25/2023 - 01:38:54PM] NOTICE: ValidateActor(Fenrir) -- FALSE -- They are a creature type that is currently not supported (BUV_WolfCompanionRace)
[10/25/2023 - 01:38:54PM] Thread[1]  - Entering Making State
[10/25/2023 - 01:38:54PM] FATAL - Thread[0] AddActor(Fenrir) - AddActor(Fenrir) -- Failed to add actor -- They are not a valid target for animation

Link to comment

That error comes from sslCreatureAnimationSlots.HasCreatureType, which is a native function.

 

Edit: Looking for the SL dll source code but I don't think it exists still. Not the first time I've searched for it.

Edited by traison
Link to comment
7 minutes ago, traison said:

That error comes from sslCreatureAnimationSlots.HasCreatureType, which is a native function.

 

I'm not sure i understand what to do, then. :/ I guess i'll try starting a new save and see if SexLab somehow loads it in from there.

The custom races are still the creature type they were meant to be. So the BUV_WolfCompanionRace is defined as a Wolf, and the same goes for the Fox.

Link to comment

The relevant parts there are the AddRaceID lines. I believe you already hacked those into MNC. That code snippet is just doing it with an event; probably the way it was meant to be done. Your method would still work though (assuming its done correctly), you just need to keep in mind that you've stabbed MNC's files next time you plan to update it.

 

Edit: You did compile the edited psc file right? Otherwise nothing was changed.

Edited by traison
Link to comment
13 minutes ago, traison said:

The relevant parts there are the AddRaceID lines. I believe you already hacked those into MNC. That code snippet is just doing it with an event; probably the way it was meant to be done. Your method would still work though (assuming its done correctly), you just need to keep in mind that you've stabbed MNC's files next time you plan to update it.

 

Edit: You did compile the edited psc file right? Otherwise nothing was changed.


Compiled it? All i did was edit it in Notepad. ?

Link to comment

Send the edited psc file to me, I'll compile it. Will most likely take too long to go through setting up your setup for compiling scripts at this point. Would recommend you look into it however. Modding Skyrim is very limited without this basic ability.

Link to comment
7 minutes ago, Tearoth said:

What exactly does compiling do, and why isn't it enough just to add it in Notepad?

 

Short answer: significant performance increase. Long answer: Machine code.

 

Don't know if Papyrus compiles to pure x86/x64 asm, but its probably at least similar on an "idea" level. Machine code, with a custom/simplified instruction set for instance.

Link to comment
2 minutes ago, traison said:

 

Short answer: significant performance increase. Long answer: Machine code.

 

Don't know if Papyrus compiles to pure x86/x64 asm, but its probably at least similar on an "idea" level. Machine code, with a custom/simplified instruction set for instance.


So there's more to the .pex file than i could see in Notepad? More data?

Link to comment

There might be a way without script and race change.

 

Create a duplicate of the race, like dummywolf.

Create a duplicate of your animal follower (leave all data the same)

 

Untick in the dummy race "can't open doors.

Assign this race to the dummy wolf.

 

Use this npc dummy wolf as template for the npc wolf.

Use template flag base data only.

This assigns only name, essential and things like swim, can't open doors etc., but not skeleton and original race data (for MNC).

 

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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use