Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[SKY] ReferenceID changes at runtime, breaks my script, help!


trinta
 Share

Recommended Posts

Hi! I'm new to the forum and new to modding. I've been working on a quest, and I've exhausted my own troubleshooting capacity.

To make this quest, I was guided by the "Quest Design Fundamentals" tutorial at creationkit.com, changing the specifics to match my own idea. It's a very basic quest: BadGuy stole PreciousItem from GoodGuy. GoodGuy commissions Player to return it. GoodGuy, BadGuy, and PreciousItem were all created by me in the Creation Kit.

I've tracked my problem to a changing reference ID. In the CK, BadGuy's reference ID is 0400753F. At runtime, it's 1A00753F. I've played around a bit, and it seems to change based on how many mods I'm loading. I can get the first two characters to change in the Creation Kit by loading different mods.

As a result, whenever the script refers to BadGuy, it fails and instead puts something like "error: Cannot call Enable() on a None object" in my Papyrus log.

The question is, how do I get the game to find and use the correct reference at runtime?

Thank you for any help!

Edited by trinta
Link to comment
Share on other sites

You do not hardcode references.

And you are right, the first two digits are the mods 'load order number' in hexidecimal.

Instead of hardcoding a reference, you simply connect the NPC to the quest via the properties. The first scripting tutorial goes over connecting references.

Link to comment
Share on other sites

I didn't hardcode it, I use an alias in the quest that points to Unique Character: BadGuyTRB, and all scripts reference that alias.

I guess I was premature in thinking that the changing reference ID was the problem. Any attempts to refer to the NPC produce a "None object" error; any ideas on what the real problem might be?

Link to comment
Share on other sites

Uhhh... 42?

In the CK for my quest, the entry on the QuestAliases tab looks like this:

AliasName: TheBadGuy

Type: Ref

FillType: UniqueActor 'BadGuyTRB'

I'm sorry that I'm not more fluent in this; is there somewhere else I should be looking to confirm the "objectReference" status?

Link to comment
Share on other sites

I don't use quest aliases, so I don't know about that.

In my quest, I attached a script that points directly to my NPC that I want to interact with. You may have to wait for somebody to come along that understands quests since its not my strong point. Sorry!

For example, here is how I point to my horse, called NightMare:

ObjectReference Property LevelersNightMareREF  Auto 
I can then prefix commands, pointing to my horse, with the defined reference name:
LevelersNightMareREF.Enable()

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...