Jump to content

Recommended Posts

Hello! Okay script-ninjas, I'm asking for some help and I don't entirely know what I'm doing.

 

I'm wanting to make a follower mod where you can choose which version of the follower to use by using a spell from each follower. There's NPC1 and NPC2 where NPC2 is a duplicate of NPC1 (same stats, but set as unique of course). NPC2 is just a slightly different appearance of NPC1, ie. different warpaint and a different hairstyle. My idea is when you meet NPC1, you get a teleport spell (from their inventory) that will allow you to teleport NPC2 to your location (a kind of "battle" alternative version) and at the same time teleport NPC1 to another location off the map (so no one can find her in Skyrim, like in a "purgatory" cell). NPC2 would then have a spell that you can aquire that will do the reverse -- teleport NPC2 off the map (to a "purgatory" cell) and bring back NPC1 from her "purgatory cell".

 

Below is the script I put together and it doesn't compile...because I don't know how to script, but am willing to learn. If there's another way to do this let me know but I do want to add that I would like to avoid SKSE dependant scripts since this will also be available for SSE on console(s).

 

If you're willing, please give me some code suggestions. I appreciate the help! :)

Scriptname TESTSCRIPT extends activemagiceffect
{When you activate this spell, it will teleport NPC1 to a designated location off the map and teleport NPC2 to your current location}

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
Location Property LocationNPC1 Auto {;I was thinking of creating a new cell or just use an ingame cell like the one where the courier is sometimes stored or where the deadbody cleaned cell}

function OnEffectStart(Actor akTarget, Actor akCaster)
	Utility.Wait(1.0)
	NPC1.Enable(false)
	NPC2.Enable(false)
	NPC1.MoveTo(LocationNPC1)
	NPC2.MoveTo(game.getplayer() as objectreference, 0.000000, 0.000000, 0.000000, true)
endFunction
Link to comment
Share on other sites

As far as selecting which NPC to choose I would suggest controlling all your variant NPC's via message box with multiple clickable options so that your script knows which NPC to put out of your holding cell.

 

I'm at work currently, but later in probably after the Vikings beat the Jets today I'll fire up my computer and give you a script snippet which should help out if someone doesn't beat me to it.

Link to comment
Share on other sites

 

Hello! Okay script-ninjas, I'm asking for some help and I don't entirely know what I'm doing.

 

I'm wanting to make a follower mod where you can choose which version of the follower to use by using a spell from each follower. There's NPC1 and NPC2 where NPC2 is a duplicate of NPC1 (same stats, but set as unique of course). NPC2 is just a slightly different appearance of NPC1, ie. different warpaint and a different hairstyle. My idea is when you meet NPC1, you get a teleport spell (from their inventory) that will allow you to teleport NPC2 to your location (a kind of "battle" alternative version) and at the same time teleport NPC1 to another location off the map (so no one can find her in Skyrim, like in a "purgatory" cell). NPC2 would then have a spell that you can aquire that will do the reverse -- teleport NPC2 off the map (to a "purgatory" cell) and bring back NPC1 from her "purgatory cell".

 

Below is the script I put together and it doesn't compile...because I don't know how to script, but am willing to learn. If there's another way to do this let me know but I do want to add that I would like to avoid SKSE dependant scripts since this will also be available for SSE on console(s).

 

If you're willing, please give me some code suggestions. I appreciate the help! :smile:

Scriptname TESTSCRIPT extends activemagiceffect
{When you activate this spell, it will teleport NPC1 to a designated location off the map and teleport NPC2 to your current location}

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
Location Property LocationNPC1 Auto {;I was thinking of creating a new cell or just use an ingame cell like the one where the courier is sometimes stored or where the deadbody cleaned cell}

function OnEffectStart(Actor akTarget, Actor akCaster)
	Utility.Wait(1.0)
	NPC1.Enable(false)
	NPC2.Enable(false)
	NPC1.MoveTo(LocationNPC1)
	NPC2.MoveTo(game.getplayer() as objectreference, 0.000000, 0.000000, 0.000000, true)
endFunction

 

 

Scriptname TESTSCRIPT extends activemagiceffect
{When you activate this spell, it will teleport NPC1 to a designated location off the map and teleport NPC2 to your current location}

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
Location Property LocationNPC1 Auto {;I was thinking of creating a new cell or just use an ingame cell like the one where the courier is sometimes stored or where the deadbody cleaned cell}

Event OnEffectStart(Actor akTarget, Actor akCaster)
    NPC1.Enable(false)
    NPC2.Enable(false)
    Utility.wait(1.0)
    NPC1.MoveTo(LocationNPC1) ; <---- LocationNPC1 needs to be an object of some sort. Not a location. This is the source of it not compiling.
    NPC2.MoveTo(game.getplayer(), 0.000000, 0.000000, 0.000000, true) ; <-- don't need to cast, the player reference is an objectreference
EndEvent

Link to comment
Share on other sites

As far as selecting which NPC to choose I would suggest controlling all your variant NPC's via message box with multiple clickable options so that your script knows which NPC to put out of your holding cell.

 

I'm at work currently, but later in probably after the Vikings beat the Jets today I'll fire up my computer and give you a script snippet which should help out if someone doesn't beat me to it.

 

I thought about this too actually and would love to know how to pull that off, even if for educational purposes. Good luck to your Viks...and go Cowboys! :)

Link to comment
Share on other sites

 

 

Hello! Okay script-ninjas, I'm asking for some help and I don't entirely know what I'm doing.

 

I'm wanting to make a follower mod where you can choose which version of the follower to use by using a spell from each follower. There's NPC1 and NPC2 where NPC2 is a duplicate of NPC1 (same stats, but set as unique of course). NPC2 is just a slightly different appearance of NPC1, ie. different warpaint and a different hairstyle. My idea is when you meet NPC1, you get a teleport spell (from their inventory) that will allow you to teleport NPC2 to your location (a kind of "battle" alternative version) and at the same time teleport NPC1 to another location off the map (so no one can find her in Skyrim, like in a "purgatory" cell). NPC2 would then have a spell that you can aquire that will do the reverse -- teleport NPC2 off the map (to a "purgatory" cell) and bring back NPC1 from her "purgatory cell".

 

Below is the script I put together and it doesn't compile...because I don't know how to script, but am willing to learn. If there's another way to do this let me know but I do want to add that I would like to avoid SKSE dependant scripts since this will also be available for SSE on console(s).

 

If you're willing, please give me some code suggestions. I appreciate the help! :smile:

Scriptname TESTSCRIPT extends activemagiceffect
{When you activate this spell, it will teleport NPC1 to a designated location off the map and teleport NPC2 to your current location}

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
Location Property LocationNPC1 Auto {;I was thinking of creating a new cell or just use an ingame cell like the one where the courier is sometimes stored or where the deadbody cleaned cell}

function OnEffectStart(Actor akTarget, Actor akCaster)
	Utility.Wait(1.0)
	NPC1.Enable(false)
	NPC2.Enable(false)
	NPC1.MoveTo(LocationNPC1)
	NPC2.MoveTo(game.getplayer() as objectreference, 0.000000, 0.000000, 0.000000, true)
endFunction

 

 

Scriptname TESTSCRIPT extends activemagiceffect
{When you activate this spell, it will teleport NPC1 to a designated location off the map and teleport NPC2 to your current location}

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
Location Property LocationNPC1 Auto {;I was thinking of creating a new cell or just use an ingame cell like the one where the courier is sometimes stored or where the deadbody cleaned cell}

Event OnEffectStart(Actor akTarget, Actor akCaster)
    NPC1.Enable(false)
    NPC2.Enable(false)
    Utility.wait(1.0)
    NPC1.MoveTo(LocationNPC1) ; <---- LocationNPC1 needs to be an object of some sort. Not a location. This is the source of it not compiling.
    NPC2.MoveTo(game.getplayer(), 0.000000, 0.000000, 0.000000, true) ; <-- don't need to cast, the player reference is an objectreference
EndEvent
@Rasikko I will see if this works, total thanks for the time and the suggestions!

 

Link to comment
Share on other sites

Hello @Rasikko and @ SeraphimKensai the script below worked for me and what I was trying to do:

I would like refine a couple of things however.

1) Is there a way to dismiss the current follower and use the other one, automatically setting them as my current follower? So basically, if NPC1 is my current companion and I wanted to switch to NPC2 version, once they appear, NPC1 is dismissed as my current follower and NPC2 automatically becomes my current follower.

2) I would like for when the NPC disappears for there to maybe be a fadeout or an fxshader of my choice to play as the NPC disappears.

 

Thanks again for the help!

Scriptname TESTSCRIPT extends activemagiceffect

ObjectReference Property NPC1 Auto
ObjectReference Property NPC2 Auto
ObjectReference Property LocationNPC1 Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    NPC1.Enable(false)
    NPC2.Enable(false)
    Utility.wait(1.0)
    NPC1.MoveTo(LocationNPC1)
    NPC2.MoveTo(Game.GetPlayer())
EndEvent
Link to comment
Share on other sites

To dismiss the current follower you need to set a property for the DialogueFollower quest and call as such

(DialogueFollower as DialogueFollowerScript).DismissFollower(0, 0) ; Function DismissFollower(Int iMessage = 0, Int iSayLine = 1)

That will dismiss with the default dismissal message and skip the npc speaking the dismissal voice line. To then recruit a forced npc with

(DialogueFollower as DialogueFollowerScript).SetFollower(akTheActor) ; Function SetFollower(ObjectReference FollowerRef)
Link to comment
Share on other sites

  • Recently Browsing   0 members

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