Aramiteus Posted August 19, 2013 Share Posted August 19, 2013 (edited) Did a lot of search for a fix and found None.Found two bugs in the NN01QuestScript causing negative numbers of collected (crimsom or purple? (Using german Version)) Nirn roots. For example (-2/30). Corrected and tested it in my personal bugfix mod contaning also other not well tested things.Never published a mod before and have no idea how.So here is the sourcecode to compile with Papyrus. Perhaps someone can make use of it and integrate it into an other bugfix mod: Scriptname NN01QuestScript extends Quest Conditional GlobalVariable Property pNN01Count Auto Conditional int Property pNNTold01 Auto Conditional ObjectReference Property pSarethiFarmMapMarker Auto Function GotARoot() if GetStage() == 10 SetStage(15) pNN01Count.Value += 1 elseif GetStage() == 15 pNN01Count.Value += 1 elseif GetStage() == 20 if pNN01Count.Value < 30 ModObjectiveGlobal(1, pNN01Count, 10) elseif pNN01Count.Value >= 30 pNN01Count.Value += 1 endif endif if pNN01Count.Value >= 30 SetObjectiveCompleted(10,1) SetObjectiveDisplayed(20,1) pSarethiFarmMapMarker.AddToMap() endif endFunction Function LostARoot() if GetStage() < 20 if pNN01Count.Value > 0 ; added by Aramiteus pNN01Count.Value -= 1 endif ; added by Aramiteus elseif GetStage() == 20 if pNN01Count.Value < 30 if pNN01Count.Value > 0 ; added by Aramiteus ModObjectiveGlobal(-1, pNN01Count, 10) endif ; added by Aramiteus elseif pNN01Count.Value >= 30 pNN01Count.Value -= 1 endif endif if IsObjectiveDisplayed(20) == 1 SetObjectiveCompleted(10,0) SetObjectiveDisplayed(20,0) SetObjectiveDisplayed(10,1) endif endFunction simple fix. Just addedif pNN01Count.Value > 0 before the subtractions.Makes sense. If I have no root and take one away then I have -1 ? Math is sometimes illogical. :-) Edited August 19, 2013 by Aramiteus Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 19, 2013 Share Posted August 19, 2013 USKP has a fix for this and it actually works. The problem is as follows: Script NN01CrimsonNirnrootScript does not check stack quantity prior to running the GotARoot & LostARoot functions from the script you quoted. Thereby causing a stack of any amount to only advance or subtract the quest count by one. Correcting the proper error makes your change unnecessary. Link to comment Share on other sites More sharing options...
Aramiteus Posted August 20, 2013 Author Share Posted August 20, 2013 (edited) Strange, I am using the USKP and had the effect. (-2/30)Perhaps I collected 2 two roots before starting the quest, found another one, removed the 3 and got -2/30.For this the above code helps.Or:I am using a dirty mod loaded after USKP that reverts the fix of USKP. I'll check my load order this evening.Or:The check for the stack quantity failed due to timing/performance issues. I'll check USKP for that possibility, if I have access to the code. But nevertheless, it is always good to check ranges in codes. In this case it is simply no okay to substract 1 if the player does not have any. Hm. If it is possible to check for the stack quantity, why at all this way? Simple assigns and checks would work easier and for that more reliable.(Ah well, it is only code for a game and not for an aircraft) Oh sh...Having a look at the change history of USKP and realising of still having many of the fixed bugs ...I think by extracting the vanilla *.bsa files for getting access to the sources I also extracted the compiled vanilla scripts. (pex-files?) (I was young and wanted to learn papyrus scripting ...)I hope by deleting all compiled files in the scripts dir and only recompile my owns will fix this. Edited August 20, 2013 by Aramiteus Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 20, 2013 Share Posted August 20, 2013 Hm. If it is possible to check for the stack quantity, why at all this way? Simple assigns and checks would work easier and for that more reliable.(Ah well, it is only code for a game and not for an aircraft)I can't speak as to why they did it the way they did. Perhaps they thought it was more efficient, or more likely whomever wrote it never considered that the player might ever be able to get more than one at a time. After all, all fixed instances are from potted plants. Yet after Dawnguard came out, Crimson Nirnroot could be found on Falmer. I had 7 of them before I ever made it to Blackreach and those seven had been transferred in and out of my bag of holding whenever I accessed an alchemy station. My count was royally screwed up. :P Made a fix myself, but deleted it when I found out that USKP had pretty much the same thing. I even tested theirs under the same scenario and in all cases it corrected my values. If I remember correctly the USKP would correct the values when you picked the crimson nirnroot back up. So you might have gone negative on the count when you removed some but it might have corrected the count when you put them back in. However, that was a few versions ago. Always possible something got screwed in the meantime.... Link to comment Share on other sites More sharing options...
Aramiteus Posted August 20, 2013 Author Share Posted August 20, 2013 lol.Fixed in v1.3.2 - (2013-04-23)My Version is 1.3.1a. Have to updateWow, They were hardworking the past 4 months. @ admin: Thread can be closed and deleted. Think it is useless. (Sorry) Link to comment Share on other sites More sharing options...
Recommended Posts