Jump to content

Swapping out NPCs based on player's race


aozgolo

Recommended Posts

Hello I'm VERY new to making Skyrim mods and starting off with creating a follower mod, I'm following tutorials on how to make those but there's a unique little feature I want to add. This follower is supposed to be someone from the player's past, so I want the follower to be the same race as the player. Now I'm aware that this means creating 10 different versions of the same follower, but instead of a bunch of different ESPs, I want to make this dynamic and have the mod detect the player's race and swap out the correct NPC Follower. I haven't decided where this follower will be located in-game but I want to make it where by the time you enter that location the correct NPC is already there and no others. I'm not really sure the best way to go about this. Any advice would be appreciated :)

Link to comment
Share on other sites

Try attaching a script to each NPC (you can use the same script for each of them, you don't need 10 different copies of it) with this event in it:

Event OnIniit()
    Race MyRace = (GetBaseObject() as ActorBase).GetRace()
    Race PlayerRace = Game.GetPlayer().GetActorBase().GetRace()
    If MyRace != PlayerRace
        Disable()
    EndIf
EndEvent

Just a suggestion - I haven't tested it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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