Jump to content

Associating data with a reference?(question dedicated to experienced scripters)


hexef

Recommended Posts

I have some plans in developing some Fallout 4 mods soon, and I'm only interested in the scripting side of the modding environment. I have zero experience with the scripting engine from FO4 and Skyrim.

 

I am a veteran scripter in the scripting language that powers both Fallout 3 and Fallout: New Vegas, with thousands of lines of written code as well as a couple of published mods.

 

One thing that I couldn't find about the Papyrus scripting engine is how do you bind a custom variable to a reference that exists in the game world. It really baffles me that I couldn't find any docs/tutorials/questions from other scripters regarding this process, considering the fact that Papyrus exists since the release of Skyrim.

 

There are many ways to safely bind variables to references in FO3 and FNV, as long as the reference is persistent and can not be stored inside containers(e.g. NPCs placed in the editor). Dynamic references(e.g. pickable items or object refs spawned via PlaceAtMe) can still have custom variables, but the only safe way to do this is via the script attached to their base form(if present), as the variables inside their script retain their values even if they are added or removed from containers - script variables are not tied to their refid.

 

My question: Is Papyrus powerful enough in such a way that allows me to bind custom variables to dynamic references, like weapon references from across the game world?

 

What I'd like to do is implement a weapon condition system like in FO3 and FNV as a first mod. Obviously, a "condition" variable would be needed to be linked to every weapon in order to monitor their condition status. Is this viable in Papyrus?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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