Jump to content

Questions about Form list and references


MegaRedRider

Recommended Posts

Could file list created in esp be edited from another esp file by script.

Is it possible to add references that does not exist to file list (i suppose it could be added only by script )

and after adding this reference to the script should it be checked with IsReference function to define is it really exist, or maybe it will be no error checking this reference with GetPlayerTeammate.

 

Sorry for my english

Link to comment
Share on other sites

There is only one way for a mod to access an item in another mod. The first mod must be a master ("esm" not "esp"). The second mod must list the first mod as a master. This way, the second mod can access an item in the first mod. However, then the second mod cannot be used without the first mod. There is no way I know about to have the second mod "optionally" access an item from another mod which may or may not be loaded.
Link to comment
Share on other sites

There is only one way for a mod to access an item in another mod. The first mod must be a master ("esm" not "esp"). The second mod must list the first mod as a master. This way, the second mod can access an item in the first mod. However, then the second mod cannot be used without the first mod. There is no way I know about to have the second mod "optionally" access an item from another mod which may or may not be loaded.

i think, it could work (roughly, never given this a thougt before) with esp's only, like this: from what i've read, it's possible for a mod to ask for another mod's presence by the name of the esp (and i really hope that's true, because i'll be needing this in a future mod). so: have mod1 and mod2 both check for eachothers presence, keep a duplicate of the item in both, if mod1 finds mod2 present, it disables it's copy of the item, while mod2, if it finds mod1 present, enables it's copy. the effect of this being, no esp would ever have to manipulate another esp's item.

and if the item's properties are modifyable, you could store it's properties to variables before the enabling/disabling thing. just a theoretical concept, as said, no idea if this would work in reality...

 

@ davidlallen: yeah, i REALLY like disabling/enabling stuff... :-)=)

Edited by stevie70
Link to comment
Share on other sites

Maybe i have not explained what i want, i have script that works with followers references, list of references of followers srored in file list but it does not matter now.

I want to edit follower reference that added by another mod, could i simply edit it if i know name of the reference.

Link to comment
Share on other sites

Suppose the other mod is named foo.esp and has a follower reference barREF. The following may work (not tested and I don't even have NVSE installed)

if IsModLoaded foo.esp then
  barRef.disable # or whatever you wanted to do
endif

Theoretically, even if the person using your mod does not have foo.esp installed, this should compile and run OK. That is, since they do not have foo.esp, the expression will return false and nothing will happen.

 

If you do not know the exact filename and exact name of the reference, this technique will clearly not work.

Link to comment
Share on other sites

You won't be able to add a follower from another mod (in advance) to your list unless your plugin has the other mod as a master.

Checking for another plugin loaded doesn't give you access to its records.

So even if both mods have barREF, they are completely different objects with different formIDs.

 

But, you could make an activation perk that triggers on certain conditions:

1. The actor is a teammate (GetPlayerTeammate)

2. The actor is not in your list (IsInList)

In the result script of the perk, you can use GetSelf to get the RefID of the actor, then prompt the player to add it to your list, or launch a quest script to do whatever.

 

That's how I set up my Companion cure mod to get refID's of poisoned followers.

You can make the perk hidden and just add it once to the player. If he hires anybody that isn't in your list then the first time its activated you can add the RefID

 

Though if you are adding to an existing list that you made in the Geck, I would get the baseID of the actor before adding it to the list, so you are not mixing it with refs and bases. That is another NVSE function. Otherwise, start with an empty list in the Geck and build it as you need to, and just store RefIds.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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