QuakeNaked Posted February 7, 2016 Posted February 7, 2016 Hi, I'm just a simple mod user, and I understand very little of this, but when I load any save, even the first save on a brand new game, I'm getting an error that says I need to reset papyrus storage in MCM,. The problem is, there's no place in MCM to do this. Also, I can't find where to go find any logs to help diagnose this error. Any help would be appreciated.
Ashal Posted February 7, 2016 Author Posted February 7, 2016 I have a puzzler here. This function works fine. Function xpopStoreArray(INT[] iArray, BOOL bStore = True) INT i = 0 INT j = iArray.Length While (j > i) If (bStore) StorageUtil.IntListAdd(PlayerRef, "xpopModSkill", iArray[i], True) Else iArray[i] = StorageUtil.IntListGet(PlayerRef, "xpopModSkill", i) EndIf i += 1 EndWhile EndFunction Where this one does not. It should do the same thing as the one above, no? Function xpopStoreArray(INT[] iArray, BOOL bStore = True) INT i = iArray.Length While (i > 0) i -= 1 If (bStore) StorageUtil.IntListSet(PlayerRef, "xpopModSkill", i, iArray[i]) Else iArray[i] = StorageUtil.IntListGet(PlayerRef, "xpopModSkill", i) EndIf EndWhile EndFunction ... so unless I am missing something the IntListSet in Papyrus Utility No 3.2 is broken? IntListSet will do nothing if the index you give it is out of bounds for the existing list. So for example, if iArray.Length == 5, if "xpopModSkill" is not initialized with a count of 0, trying to set the non-existent index of 4 in the IntList will do nothing, because there is no index 4. This isn't a problem in the first version example, as it's just adding appending elements to the list regardless. Also, unless you have a specific need of being able to maintain iArray as a pointer that's referenced by multiple scripts/functions without having to re-fetch it, and make use of it as being variable sizes instead of always just matching the length of xpopModSkill, this should be a much simpler and faster solution: Function xpopStoreArray(INT[] iArray, BOOL bStore = True) if bStore && iArray ; // Copy contents of iArray to list StorageUtil.IntListCopy(PlayerRef, "xpopModSkill", iArray) else ; // Fill iArray with values of list from 0 to length StorageUtil.IntListSlice(PlayerRef, "xpopModSkill", iArray) endIf EndFunction
morcalvin Posted February 25, 2016 Posted February 25, 2016 hey, I have a problem. the download doesn't work. I'm trying to get the latest my version of papyrus and the link now constantly waits ten seconds and then says oops try again in 10 seconds. I used to be able to download papyrus but none of the versions are working for me now,
Inte Posted March 2, 2016 Posted March 2, 2016 I need some advice ... again. Is there a JsonUtil function that will check if the given .json file exists? Example fragment, ... ElseIf (aiOption == oidLoadConfig) STRING sFile = "../xazPrisonOverhaul - Patch/" +xpoPatch.PlayerRef.GetDisplayName()+ " - xpopConfig.json" BOOL bGo = ShowMessage("This will load all configuration settings from a .json file.", a_withCancel = True) BOOL bExist = ??? ;Check if the sFile.json file exists. If (bGo) If (bExist) If (JsonUtil.GetStringValue(sFile, "Version No.") != GetVersionStr()) If (ShowMessage("Existing version does not match saved version.\nSome data will not be loaded.\nContinue anyway?", a_withCancel = True)) ForceCloseMenu() xpoImportSettings() EndIf Else ForceCloseMenu() xpoImportSettings() EndIf Else ShowMessage("Bad command or file name!") EndIf EndIf Else ...
Guest Posted March 2, 2016 Posted March 2, 2016 bool bExists = (JSONUtil.GetStringValue(sFile, "Version No.", missing = "FILENOTFOUND")=="FILENOTFOUND")
Inte Posted March 2, 2016 Posted March 2, 2016 bool bExists = (JSONUtil.GetStringValue(sFile, "Version No.", missing = "FILENOTFOUND")=="FILENOTFOUND") Uh, I see - very clever, thanks I'll try it.
Guest Posted March 2, 2016 Posted March 2, 2016 Uh, I see - very clever, thanks I'll try it. This is the way I do to check for custom Sex Rules and for translations available in the current game language for Scent of Sex, and it seems to work pretty well without any papyrus error log. P.S. just check for an entry in the json that for sure it will be there.
Inte Posted March 2, 2016 Posted March 2, 2016 Yeap, "Version No." will always be there, good call. Scent of Sex is that the mod you mentioned with 15000 lines of code?
Guest Posted March 2, 2016 Posted March 2, 2016 Yeap, "Version No." will always be there, good call. Scent of Sex is that the mod you mentioned with 15000 lines of code? 50,000. (But 20% are comments)
Inte Posted March 3, 2016 Posted March 3, 2016 Yeap, "Version No." will always be there, good call. Scent of Sex is that the mod you mentioned with 15000 lines of code? 50,000. (But 20% are comments) Oh, wow.
Inte Posted March 3, 2016 Posted March 3, 2016 Ok, having used both JsonUtil, and StorageUtil I like both - but which is faster? Since they both do much of the same things I'd like to choose one.
Guest Posted March 3, 2016 Posted March 3, 2016 Personally I prefer JsonUtil, because the resulting file can be edited without problems. But it has some limitations compared to StorageUtil.
Inte Posted March 5, 2016 Posted March 5, 2016 Personally I prefer JsonUtil, because the resulting file can be edited without problems. But it has some limitations compared to StorageUtil. Like allowing players to cheat?
Guest Posted March 5, 2016 Posted March 5, 2016 Personally I prefer JsonUtil, because the resulting file can be edited without problems. But it has some limitations compared to StorageUtil. Like allowing players to cheat? Yes. But more than cheating is enabling advanced users to quickly do stuff you did not developed (yet.) If a game is not fun, then don't play it. And in some cases, for some people, cheating is the way to a fun game.
Ashal Posted March 5, 2016 Author Posted March 5, 2016 Ok, having used both JsonUtil, and StorageUtil I like both - but which is faster? Since they both do much of the same things I'd like to choose one. There isn't much of a speed difference, at least none worth worrying about. From some basic benchmarking I've done, over 2000 iterations of setting and getting an int and a form value: JsonUtil: 0.062598 seconds, StorageUtil: 0.100601 seconds. So JsonUtil came out fractions of a second faster, which isn't worth fussing over. Insteads it's better to just look at what your needs are. With JsonUtil all data is shared between all saves and characters. With StorageUtil the data is specific to the save.
darkconsole Posted March 28, 2016 Posted March 28, 2016 is there a logging option for extreme verbosity? getting an accelerated number of reports of CTDs after updating to 3.2 and trying to figure out what may be going on. i'm making heavy use of the FormListFind function if you know of any internal changes lately.
Guest Posted March 28, 2016 Posted March 28, 2016 Ok, having used both JsonUtil, and StorageUtil I like both - but which is faster? Since they both do much of the same things I'd like to choose one. There isn't much of a speed difference, at least none worth worrying about. From some basic benchmarking I've done, over 2000 iterations of setting and getting an int and a form value: JsonUtil: 0.062598 seconds, StorageUtil: 0.100601 seconds. So JsonUtil came out fractions of a second faster, which isn't worth fussing over. Insteads it's better to just look at what your needs are. With JsonUtil all data is shared between all saves and characters. With StorageUtil the data is specific to the save. Completely agree on the last part: if you need the values across saves go with JsonUtil, if you want it specific to a save go with Storage Util. But from the analysis of the performance I do not agree. JsonUtil is about 59% faster than StorageUtil. (See Ashal's numbers) if you need it once in a while, then no difference. But if you do an extreme use of it (continuously, and that should never be done), then JsonUtil is for sure faster.
zaira Posted March 31, 2016 Posted March 31, 2016 Found another bug in StorageUtil (reinitializing all lists during startup from my last bug report is still unfixed) In stage 1 of my Quest I do StorageUtil.FormListAdd(none,"test",objectInUnloadedCell.PlaceActorAtMe(MyActorBase1)) StorageUtil.FormListAdd(none,"test",objectInUnloadedCell.PlaceActorAtMe(MyActorBase2)) In stage 2 of my Quest I do Form[] actors = StorageUtil.FormListToArray(none,"test") Now the actors list contains [none,none]. 100% reproducible - I use PapyrusUtils from latest Sexlab. If I use native lists everything works fine. The reinitialize bug is if I add items in my OnInit handler (StorageUtil.FormListAdd(none,"test",myObj) ) the list is empty in later stages of my Quest. There is nothing visible in the logs - the things simply disappears.
Ashal Posted March 31, 2016 Author Posted March 31, 2016 Found another bug in StorageUtil (reinitializing all lists during startup from my last bug report is still unfixed) In stage 1 of my Quest I do StorageUtil.FormListAdd(none,"test",objectInUnloadedCell.PlaceActorAtMe(MyActorBase1)) StorageUtil.FormListAdd(none,"test",objectInUnloadedCell.PlaceActorAtMe(MyActorBase2)) In stage 2 of my Quest I do Form[] actors = StorageUtil.FormListToArray(none,"test") Now the actors list contains [none,none]. 100% reproducible - I use PapyrusUtils from latest Sexlab. If I use native lists everything works fine. The fact that you're using PlaceActorAtMe() makes it pretty clear I think. Sounds to me most likely that it's not a StorageUtil bug, but rather an issue with adding temporary forms to the storage. If an object is temporary and their Form ID changes or they are later disabled/deleted within Skyrim's engine, than of course pulling it as a value would later return as none. Both key and value storage relies on a form continuing to exist as the same object in order to access any data saved to it. k The reinitialize bug is if I add items in my OnInit handler (StorageUtil.FormListAdd(none,"test",myObj) ) the list is empty in later stages of my Quest. There is nothing visible in the logs - the things simply disappears. I've tried multiple times to reproduce this error according to your exact specifications, still unable to reproduce it.
zaira Posted March 31, 2016 Posted March 31, 2016 OnInit problem: event OnInit() SetIntValue(none,"dodo",GetIntValue(none,"dodo") + 1) Trace("Initialize Slots for " + self + " dodo = " + GetIntValue(none,"dodo")) endevent LogFile: Line 162: [03/31/2016 - 10:55:00AM] @@ BUILDER :Initialize Slots for [mariabuilderquestscript <MariaBuilderQuest (C689021A)>] dodo = 1 Line 351: [03/31/2016 - 10:55:18AM] @@ BUILDER :Initialize Slots for [mariabuilderquestscript <MariaBuilderQuest (C689021A)>] dodo = 1 Regarding PlaceActorAtMe: The form ID doesn't change - if I enter the cell and focus the created NPC I get the same form ID that I traced during FormListAdd. Update: regarding OnInit - I am pretty sure that this has worked in a previous version of StorageUtil...
Guest Posted March 31, 2016 Posted March 31, 2016 OnInit problem: ...snip... The OnInit() event is managed by the game engine, not by PapyrusUtil. I had a similar problem when directly attaching scripts to Quests and Actors. The oninit was, in some cases, fired multiple times for the same script, because there were multiple scripts attached to the base object.
zaira Posted March 31, 2016 Posted March 31, 2016 OnInit problem: ...snip... The OnInit() event is managed by the game engine, not by PapyrusUtil. I had a similar problem when directly attaching scripts to Quests and Actors. The oninit was, in some cases, fired multiple times for the same script, because there were multiple scripts attached to the base object. But SetIntValue(none,...) Refers to a global (=none) list - or not?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now