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...

Using the ObjectReference type


Bomaz
 Share

Recommended Posts

I would like to access the ObjectReference of an object that triggers an

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)

However the ObjectReference is "none" unless the akBaseObject is persistent.

Does anyone know how I can make an object persistent?

Or any other way to solve the problem so that the event triggers with an ObjectReference?

I tried creating a script that referenced the object with a long pause but this did not work. Any suggestions are appriciated

Link to comment
Share on other sites

I'm not sure what you mean by this I'm afraid. Preferably I would like to have a a script that looks something like this

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)


makeobjectpersistent( akBaseItem )


endEvent

From your explanation I don't understand what I have to do to accomplish this. This is all just so that I can get an objectreference for the objects when they trigger a OnObjectEquipped event for my script.

Link to comment
Share on other sites

An object that is worn or equipped no longer can be pointed to exactly, it actually becomes part of the NPC. (or player).

You would use the 'base ID', not that specific object.

Now, in your OnItemAdded fuction above, akItemReference will contain a reference name if the item is persistant. But being persistant means there is only one of these in the world...

Link to comment
Share on other sites

Hm, I would like to access the ObjectReference.GetItemHealthPercent() that I was informed could allow me to determine how much an item had been improved by smithing.

but you are telling me that it is not possible to get the ObjectReference of an item that is equipped? Crap.

Can I make all the items in the inventory persistant (so that they have an ObjectReference) and then use that to determine the one that goes missing or some such?

Link to comment
Share on other sites

hm, maybe the person that told me was misinformed. I have a hard time believing that there is no way to access the improvements or stats of items without using the script extender. Unfortunately my mod requires the armor rating of the currently equipped gloves to work properly. This is why I am searching for a way to make objects persistent since I was told that this enabled accessing smithing improvement.

There should definitely be a way to do it, I just have to find it. So far I calculate the unmodified rating based on the players attributes but that can't take smithing into account and smithing is a rather large factor on the stats of items.

An improved object would be unique however wouldn't it?

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...