Keinichn Posted July 9, 2018 Share Posted July 9, 2018 So I'm sure this is rather simple, but my brain just can't seem to figure out how to do it after trying a bunch of different functions. Guess I'm just not using the right ones in the right way. Still kinda new at this. I have a quest that has a number of reference aliases on it (namely for NPCs). If I go in game and enter "sqv questname" in the console, I can see the list of those aliases as well as the reference ID for that particular NPC (ie, FF000983). My goal is to get that reference ID for eventual output to the screen. In my script, I have those aliases declared as ReferenceAlias properties and they're set properly on the quest scripts tab in the CK. Unfortunately, it doesn't seem as simple as just reading that property out to the screen. It typically gives me something like "[REFERENCEALIAS" rather than the hex ref ID as shown in the sqv console command. Anyone know the right command to get that ID into a variable? Thanks. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 10, 2018 Share Posted July 10, 2018 If I understand correctly, the RefID should be stored as a string variable for later display? If that's the case you could use a function like this, it requires Skse: string Function GetAliasRefID(ReferenceAlias RefAlias) string RefID = StringUtil.SubString(RefAlias.GetReference(),(StringUtil.Find((RefAlias.GetReference() as string), "(")) + 1, 8) return RefID EndFunction As you're stating the RefAliases are mostly NPCs, you may need to replace GetReference() with GetActorReference(), not tested. Link to comment Share on other sites More sharing options...
Keinichn Posted July 10, 2018 Author Share Posted July 10, 2018 Hey, thanks. That did the trick as written. Link to comment Share on other sites More sharing options...
PeterMartyr Posted July 11, 2018 Share Posted July 11, 2018 or ReferenceAlias.GetID() Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 11, 2018 Share Posted July 11, 2018 or ReferenceAlias.GetID() That would return the Alias ID number, not the actual reference ID. Please see the wiki. Link to comment Share on other sites More sharing options...
PeterMartyr Posted July 11, 2018 Share Posted July 11, 2018 or ReferenceAlias.GetID() That would return the Alias ID number, not the actual reference ID. Please see the wiki. AFAIK they don't have a FormID, they can have MOD ID like alias1 & alias2 but that simply ReferenceAlias.GetID() + 1 all I have to say DON'T duplicate Quest when your dealing with Alias or be prepared to Suffer the consequences!! Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 11, 2018 Share Posted July 11, 2018 (edited) AFAIK they don't have a FormID, they can have MOD ID like alias1 & alias2 but that simplyIt's not about FormID. The OP wanted to get the ID of the reference the alias is filled with, in hexadecimal notation. all I have to say DON'T duplicate Quest when your dealing with Alias or be prepared to Suffer the consequences!!??? Edited July 13, 2018 by Ghaunadaur Link to comment Share on other sites More sharing options...
Recommended Posts