So you modified the MineOreScript by adding a single GlobalVariable? GetFormFromFile could have saved you the hassle of modifying every instance of the ore veins. You can use that even on your own records in your own plugin. Yes, the script would still be edited but not the ore vein references.
If you were to switch to using that, you could remove the property, reduce compatibility problems, reduce the need for patches for DLC and mods that add new ore veins and devise a small function that authors of other mining mods could use in their script versions to call upon and modify your GlobalVariable.
In fact it could be this:
Function MinedOreVeinTracker() If Game.GetFormFromFile(0x00000D62,"Ore Veins Mined.esp" ) GlobalVariable StatOreVeinsMined = Game.GetFormFromFile(0x00000D62,"Ore Veins Mined.esp" ) StatOreVeinsMined.SetValueInt(StatOreVeinsMined.GetValueInt() + 1) EndIf EndFunction
The other authors would only need to copy/paste that into their version of the script and call upon it at the correct location.
Downside to this is that the check is made for each vein. If your mod isn't installed, the user will get an error in the papyrus log when it fails. Harmless but could bloat the log on sessions where a lot of ore veins are mined. Please note that I did not include the Dragonborn esp version you have. Why? It wouldn't be needed since the references would no longer be edited.
EDIT: I totally dislike that formatting on the comment page side is different than the formatting on the forum side Had to space some things out for the comment page side...
There is an error. It was late when I posted the earlier message. Should have caught it, sorry. There just needs to be an added casting from one type into another on a single line. Change this line
I must have missed the books one I just try to collect them all. Maybe that's what I meant is it possible to have a "Own # of #" books? (Probably not but it would be cool)
I mean useless to me because I don't mine. I just like the concept of your mod. Most mining I have done was stalhrim for my extra frost weapons and armor.
7 comments
GetFormFromFile could have saved you the hassle of modifying every instance of the ore veins. You can use that even on your own records in your own plugin. Yes, the script would still be edited but not the ore vein references.
If you were to switch to using that, you could remove the property, reduce compatibility problems, reduce the need for patches for DLC and mods that add new ore veins and devise a small function that authors of other mining mods could use in their script versions to call upon and modify your GlobalVariable.
In fact it could be this:
The other authors would only need to copy/paste that into their version of the script and call upon it at the correct location.
Downside to this is that the check is made for each vein. If your mod isn't installed, the user will get an error in the papyrus log when it fails. Harmless but could bloat the log on sessions where a lot of ore veins are mined. Please note that I did not include the Dragonborn esp version you have. Why? It wouldn't be needed since the references would no longer be edited.
EDIT: I totally dislike that formatting on the comment page side is different than the formatting on the forum side
Change this line
GlobalVariable StatOreVeinsMined = Game.GetFormFromFile(0x00000D62,"Ore Veins Mined.esp" )
Into
GlobalVariable StatOreVeinsMined = Game.GetFormFromFile(0x00000D62,"Ore Veins Mined.esp" ) as GlobalVariable
Do you plan on more? I would love to see one for How Many Books read.
I am going to dl and endorse just on idea alone. Thank you.
What mods are you using for mining? I have a suspicion that modifying the mining speed alone may not affect the script as it may be a global variable.
I mean useless to me because I don't mine. I just like the concept of your mod. Most mining I have done was stalhrim for my extra frost weapons and armor.