Jump to content

[LE] Quest Alias for NPC from another mod's esp


Recommended Posts

Hello,

 

After solving the problems in my previous topics (thanks to the awesome people of these forums :smile: ), here's the next:

Is it possible to set up a Quest Alias that's filled with an npc from another mod's esp?

 

My aim is to be able to get an event when the player talks to this npc. So I figured I would create a quest alias, and attach this script to it:

Scriptname ScriptOnQuestAlias extends ReferenceAlias
 
Event OnActivate(ObjectReference akActionRef)
    if(akActionRef == Game.GetPlayer() )
        ; do my stuff
    endif
EndEvent

The alias is set to forced, and none in the beginning. (Quest is start game enabled, "allow reserved" is greyed out).

 

The filling of the alias is done by my other script that manages all of my mod's "related-to-other-mods" content (this is attached to a PlayerAlias in the same quest):

ReferenceAlias Property NPCAlias  Auto ; in the CK, properly set to the previously setup quest alias.
 
; other stuff
 
; in a function:
    if(Game.GetModByName("OtherMod.esp") != 255 )
        Debug.Notification("Printout 1")

        Actor npc = Game.GetFormFromFile(0x000012c4, "OtherMod.esp") as Actor
        NPCAlias.ForceRefTo(npc )

        Debug.Notification("Printout 2")
    endif

My problem is: the alias doesn't get filled. I do get both debug messages, so the function works for sure, and the fill must be attempted. But the alias stays unfilled (says NONE in the console).

I double, triple, then quadrupole-checked that I have the correct formID in the GetFormFromFile call, and it's indeed the npc's formID.

What am I doing wrong here? :/

Edited by WhiteWolf424242
Link to comment
Share on other sites

I'm not sure I understand the terminology. :sad:

I checked out the formID from TES5Edit under:

+Non Player Character (Actor) - > form ID

 

Which is the other one?

 

I only found:

+Worldspace -> +Cell -> +Persistent -> Placed NPC, but this has the same formID.

Edited by WhiteWolf424242
Link to comment
Share on other sites

Here is an example using TES5Edit:

Select an NPC, this example uses Addvar

At the top of TES5Edit you will see:

[00] Skyrim.esm (AF75991D) \ Non-Player Character (Actor) \ 00013255 <Addvar>

Select Referenced By tab (bottom of right window)

Locate the entry with signature ACHR

Double click to open it

At the top of TES5Edit you will see:

[00] Skyrim.esm (AF75991D) \ Cell \ Block 5 \ Sub-Block 8 \ 00016A0D <SolitudeAddvarsHouse> \ Persistent \ 000198D4 <AddvarREF>

You would use 000198D4 (the actor reference) instead of 00013255 (the actor base)

EDIT: My example actually utilizes SSE & SSEEdit values, but process is the same for TES5Edit & SLE

Edited by IsharaMeradin
Link to comment
Share on other sites

  • Recently Browsing   0 members

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