irswat Posted August 18, 2016 Share Posted August 18, 2016 (edited) Looking for an SKSE function that you can pass a baseid for an asset, like a weapon, or piece of armor, and the function will return either the ModIndex or PlugIn name that the asset is loaded from. Is anyone aware of such a function? In short I want to help Narjah make his Leveled Unique Equipment plugin be compatible with third party mods, so he needs a function that can determine whether a weapon/piece of armor is from a third party plugin.I see the GetMod... functions, but there doesn't seem to be one like GetModIndex. Is anyone aware of such a function, or how I might achieve the desired effect of determining whether an asset is 3rd party?Not sure if it was SKSE, NVSE, or I'm imagining things but I recall stumbling across a function that does this.ALTERNATIVELY: Is there a flag for unique weapons/armors that I can access via script? I noticed there is a IsUnique function, but it seems to work on actors and not objects. Is there a function like IsUnique I can call on a weapon or armor formid/baseid? Is Craftable()? Edited August 18, 2016 by irswat Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 18, 2016 Share Posted August 18, 2016 There is GetFormFromFile which you can pass in the ID# and the ESP/ESM name. But you have to know the ESP/ESM name in advance. This is what is typically used to make 3rd party mods compatible when one does not create their own SKSE DLL plugin or have some patcher utility for the user to run once their load order is set (i.e. DynDoLOD, SkyProc, etc) It is used like so: Weapon UberWeapon = (Game.GetFormFromFile(0x00345678,"The Uber Weapon Mod.esp")) as WeaponYou *might* be able to jury rig something by using GetModCount to get the total number of active ESP/ESM files and then get the desired item's base object, pass that into a string, use GetNthChar from StringUtil script and convert the first two digits of the objects form into an integer from hex (if that is even possible in papyrus) and then use that as the index for GetModName. Personally, I'd rather just make it compatible on a mod by mod basis and use GetFormFromFile than mess around with some convoluted process that may or may not work. Link to comment Share on other sites More sharing options...
irswat Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) Can I call GetNumIngredients on a weapon/armor baseid. If I call GetNumIngredients on a weapon/armor baseid, and it is null, can I assume that it is not constructable? If it is not constructable can I assume it is unique? Edited August 18, 2016 by irswat Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 18, 2016 Share Posted August 18, 2016 Can I call GetNumIngredients on a weapon/armor baseid. If I call GetNumIngredients on a weapon/armor baseid, and it is null, can I assume that it is not constructable? If it is not constructable can I assume it is unique?No. GetNumIngredients is called by a ConstrucibleObject (i.e. a recipe) Calling on a weapon or armor, will cause the papyrus compiler to throw errors at you. Link to comment Share on other sites More sharing options...
irswat Posted August 18, 2016 Author Share Posted August 18, 2016 String WeaponLeft = .GetEquippedObject(0)String WeaponRight = .GetEquippedObject(1)Int ContructibleLeft = WeaponLeft.GetNumIngredients() Int ContructibleRight = WeaponRight.GetNumIngredients() if (!ContructibleLeft){ //call UniqueLevelingScript(string WeaponLeft)}endif;if (!ContructibleRight){ //call UniqueLevelingScript(string WeaponRight)}endif;I'm new to scripting in skyrim, but would something like this work do you think? Link to comment Share on other sites More sharing options...
irswat Posted August 18, 2016 Author Share Posted August 18, 2016 (edited) OK. I'll keep brainstorming then. Would be cool if the mod could be made universal. There has to be way.thanks for the help mate! Edited August 18, 2016 by irswat Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 18, 2016 Share Posted August 18, 2016 If you haven't done so, perhaps give the links on the right hand side of the CK Wiki Scripting Reference page a read. There is a lot of useful information and even some tutorials to help you nail the basics. Link to comment Share on other sites More sharing options...
irswat Posted August 18, 2016 Author Share Posted August 18, 2016 Yea, I mean that was the first place that I went and just looked through all the functions, but sometimes there are other 3rd party libraries and lesser known functions and approaches which aren't well documented in the official documentation. Thanks again for your help! Link to comment Share on other sites More sharing options...
irswat Posted August 18, 2016 Author Share Posted August 18, 2016 manually entering every unique weapon < dynamic and procedural recognition IMO. Link to comment Share on other sites More sharing options...
irswat Posted August 21, 2016 Author Share Posted August 21, 2016 What about Weapon.GetTemplate. Is there any documentation on this function? Link to comment Share on other sites More sharing options...
Recommended Posts