Jump to content

Papyrus help


lavigne77

Recommended Posts

I don't know if this is the right place to post questions about papyrus but I have a question about a papyrus script I was trying to make.

What it basically does is rename a recipe by adding "(Learned)" to its name once it's read. (Pretty much like the unread books mod, only this doesn't use a FormList, this script is added to each recipe directly in the CK)

For some reason this code only works when the item is on the ground or anywhere else where you can actually activate the 3D object.

If it's in the inventory it doesn't work, self.GetBaseObject() doesnt return any value.

I've been looking out there for Papyrus help/tutorials/references but there's really not that much.

Any thoughts on this would be appreciated.

 

Scriptname dar_TeachProperties extends ObjectReference

Import StringUtil

Form Property recipeObject Auto
String recipeName

Event OnRead()

recipeObject = self.GetBaseObject()
recipeName = recipeObject.getName()

If (recipeIsRead == false)

	If Substring(recipeName, 0, 9) != "(Learned)"

		recipeObject.setName("(Learned) " + recipeName)
	EndIf
EndIf
EndEvent

Bool Property recipeIsRead  Auto

Link to comment
Share on other sites

When objects are inside of a container (and the player inventory is a container) scripts on them typically do not run.

 

You'll either have to develop some workaround using external scripts on the player alias or other objects.

Or live with it not happening from player inventory.

Link to comment
Share on other sites

When objects are inside of a container (and the player inventory is a container) scripts on them typically do not run.

 

You'll either have to develop some workaround using external scripts on the player alias or other objects.

Or live with it not happening from player inventory.

 

I doubt I have the knowledge to come up with a workaround for it, tried many things and none of them worked so I'll just probably leave it that way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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