• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.
Sign in to follow this  
Followers 0
DjaySaint

Help with script - NPC reference

You should use "Properties".

A property is a reference to an object (pretty much any kind of object) used in Papyrus scripting.

 

Now, if your follower is a static NPC, well defined in one cell, then just add something like:

Actor Property myAmazingFollower Auto

 

And then after saving you MCM, edit the properties, and fill "myAmazingFollower" with the actor that you are adding.

ActorBase can be got in the same way you did for the player: ActorBase followerAB = myAmazingFollower.getLeveledActorBase()

 

In case your "follower" is a generic one, then you need something different.

For example, if you don't care about multiple followers mods, you can garb the ReferenceAlias Follower from the quest DialogueFollower.

If you care about EFF, UFO, etc, then you need to scan the surroundings of the player to find matching NPCs (and every follower mod uses a different way to make them followers.)

 

Last: do not use Game.getPlayer().

Add a property: Actor property PlayerRef Auto

Way faster, way more easy.

 

 

 


Second note. I hope your follower is a custom NPC with a custom actorbase, used only for this follower.

If it is not, then when you alter the ActorBase, then ALL NPCs that are using this ActorBase will have the same change.

The player skin/body/parts/whatever are managed outside the actorbase. Because the player has a specific one.

NPCs may share the same actor base.

 

0

Share this post


Link to post

You should use "Properties".

A property is a reference to an object (pretty much any kind of object) used in Papyrus scripting.

 

Now, if your follower is a static NPC, well defined in one cell, then just add something like:

Actor Property myAmazingFollower Auto

 

And then after saving you MCM, edit the properties, and fill "myAmazingFollower" with the actor that you are adding.

ActorBase can be got in the same way you did for the player: ActorBase followerAB = myAmazingFollower.getLeveledActorBase()

 

In case your "follower" is a generic one, then you need something different.

For example, if you don't care about multiple followers mods, you can garb the ReferenceAlias Follower from the quest DialogueFollower.

If you care about EFF, UFO, etc, then you need to scan the surroundings of the player to find matching NPCs (and every follower mod uses a different way to make them followers.)

 

Last: do not use Game.getPlayer().

Add a property: Actor property PlayerRef Auto

Way faster, way more easy.

 

Yeah it's a custom NPC follower defined in a cell.

 

The code above is what I was using for my player code, not specifically the follower.  I was adapting it to my follower though.

 

Would you mind if I sent a PM to show you specifically what I have?

 

Thanks for the reply!

0

Share this post


Link to post

 

...

 

Would you mind if I sent a PM to show you specifically what I have?

 

 

That is fine.

Do not send the full mod or the esp. I don't care too much about them.

Just send me the main scripts (MCM or else), and I will have a look.

0

Share this post


Link to post
Sign in to follow this  
Followers 0