Jump to content

Recommended Posts

 

Uploaded v3.2, changelog:

 

3.2 - 01/04/2016

  • IsGood() - Checks if the given Json file is currently loaded or not and has no errors
  • GetErrors() - Returns a formatted string of any Json parsing errors, if any
  • JsonInFolder() - Returns an array of all Json files in a given directory.

 

Do you know that now you just delayed the release of my new mod, because I HAVE TO USE these new functions?

:D  :D  :D

 

Nice job.

 

I will check the "ScallCellActors" function too (You sure it should not be called "ScanCellActors" ???) to see what its parameters are.

Link to comment
There seems to be a bug in StorageUtil.

In a very early stage of a new game (Main quest not running) I add an actor in a Quest OnInit() function:

 

FormListAdd(none,"Auctionator",auctionator,false)

Trace("auctionator count=" + FormListCount(none,"Auctionator"))

 

This trace returns "auctionator count=1"

There is no code to reset the "Auctionator" list in my whole mod

 

In later stages (Main quest running) FormListCount(none,"Auctionator") returns 0

 

In previous PapyrusUtils the same code works without problems.

 

 

 
Link to comment

Even this code is not working since new PapyrusUtil:

 

event OnInit()
    if GetIntValue(none,"fcinit")
        return ; hack to prevent double init
    endif
    SetIntValue(none,"fcinit",1)
    ....

 

Once the quest is running I reset the IntValue fcinit. In the previous PapyrusUtil with this construct I could ensure that OnInit is called once only. Now GetIntValue returns 0 in the second OnInit call.

 

It looks like there is a new general reset code in the new PapyrusUtil that resets to late.

 

 
Link to comment

 

Haven't seen it happen and can't think of any reason it would. Would have to see papyrusutildev.log from whenever it happens though to know more.

Contains only JSON logs - but I use StorageUtil

 

the log isn't just JSON stuff, it just happens to be the most verbose. Everything spits out errors of some kind to it, and most importantly, the order and progress of the load/save/revert process gets output there as well and is potentially incredibly relevant here.

Link to comment

Simple way to reproduce:

  • start game enabled quest
  • object reference property in quest script
  • add this reference to a StorageUtil Formlist add(none,"dummy",myReference) in the OnInit handler of the quest script
  • Try to read this list later - the reference is away...

I think this problem was introduced some versions ago - must not be the latest version

 

Link to comment
  • 2 weeks later...

I'm curious on performance when doing something like this:

 

(rough mock up)

 

int x=0

while FormListCount(none,"List_Actors1") > 0 || FormListCount(none,"List_Actors2") > 0 || FormListCount(none,"List_Actors3") > 0

FormListAdd(none,"List_Sorted"+x,FormListShift(none,"List_Actors1"))

FormListAdd(none,"List_Sorted"+x,FormListShift(none,"List_Actors2"))

FormListAdd(none,"List_Sorted"+x,FormListShift(none,"List_Actors3"))

x+=1

endwhile

 

I have three lists which I need to sort into groups of 1-3 actors. I left out the extra logic that determines which lists to pull from each loop and what to do when a list goes empty. Worst case is I'm adding all three in one loop.

 

I know this is slow and sloppy in the relative sense. But I'm curious if it would be faster to pull the lists into a local array, do my sorting, and then put them back into storageutil? "Common sense" wants to tell me that it's faster to keep the processing within StorageUtil when I don't need to do anything locally with the information (besides my count check), but I haven't worked with Papyrus enough to know how the program "flow" works. Mostly single executable C and VB programming where I didn't have to worry about things like threads and framerate.

Link to comment

Is there a git repository or somewhere where I can view the C++ source code for this plugin? I'm trying to figure out the art of writing SKSE plugins (and as a Java programmer in real life, my experience with C/C++ is limited at best).

This project was literally my first forray into C++. I learned a lot over the course of it, but a lot of it shows clear signs of me being new to the language so it's fairly inconsistent in style and method throughout. Been kinda too embarrassed by it to maintain a public git or download of the source as a result. Look to the readily available source of JContainers if you want an example of more mature coding practices here. But I guess if you want to see what the hell a primarily nodejs/php/python dev thought good enough for their first basic C++ project, it might be easier to follow and draw some lessons from basic/bad examples I guess. I can PM you the source if you'd like.

Link to comment

 

Is there a git repository or somewhere where I can view the C++ source code for this plugin? I'm trying to figure out the art of writing SKSE plugins (and as a Java programmer in real life, my experience with C/C++ is limited at best).

This project was literally my first forray into C++. I learned a lot over the course of it, but a lot of it shows clear signs of me being new to the language so it's fairly inconsistent in style and method throughout. Been kinda too embarrassed by it to maintain a public git or download of the source as a result. Look to the readily available source of JContainers if you want an example of more mature coding practices here. But I guess if you want to see what the hell a primarily nodejs/php/python dev thought good enough for their first basic C++ project, it might be easier to follow and draw some lessons from basic/bad examples I guess. I can PM you the source if you'd like.

 

 

Appreciate the offer, Ashal. I will go and check out the JContainers source (I *really* need to implement Lists (not arrays) of ReferenceAlias among other things, so JContainers fails me there)...

 

Link to comment

By the way - it is still reproducible that the StorageUtil containers (global containers) are reset during clean game startup - if I fill items to early into them they gets lost.

It is no longer an issue for me because I switched to JsonUtil but it is still worth to mention it.

Link to comment

I hope someone can give some advice. I'm trying to fix Deviously Helpless so that it will work with Sl1.6+ or more specifically with papyrusutil 3.4.

 

The problem I'm having is with the override priority here's the actual code:

 

    AddPackageOverride(akActor, attackChasePackage, 20)
    AddPackageOverride(akActor, approachPackage, 19)
    AddPackageOverride(akActor, gatherPackage, 18)
    AddPackageOverride(akActor, sandboxPackage, 17)

 

The problem seems to occur with the attackChasePackage line, if I comment it out the other three then work correctly but the problem is that the pc has to stand next to a bandit to start it off.

 

If I include it then the bandits do approach but there is only one attack and then afterwards the bandits keep following the pc. If I drop the priority on attackChasePackage then it behaves the same as if I have commented it out. I tried adding an extra line to drop the priority afterwards but again that was the same as if it was commented out.

 

Ideally I need it to run once then switch off

Link to comment

I hope someone can give some advice. I'm trying to fix Deviously Helpless so that it will work with Sl1.6+ or more specifically with papyrusutil 3.4.

 

The problem I'm having is with the override priority here's the actual code:

 

    AddPackageOverride(akActor, attackChasePackage, 20)

    AddPackageOverride(akActor, approachPackage, 19)

    AddPackageOverride(akActor, gatherPackage, 18)

    AddPackageOverride(akActor, sandboxPackage, 17)

 

The problem seems to occur with the attackChasePackage line, if I comment it out the other three then work correctly but the problem is that the pc has to stand next to a bandit to start it off.

 

If I include it then the bandits do approach but there is only one attack and then afterwards the bandits keep following the pc. If I drop the priority on attackChasePackage then it behaves the same as if I have commented it out. I tried adding an extra line to drop the priority afterwards but again that was the same as if it was commented out.

 

Ideally I need it to run once then switch off

 

This does not looks like a AddPackageOverride problem, but more on the definition of the packages themselves.

Check if they can be joined, check them directly added to a NPC to test if they can complete successfully.

Link to comment

 

I hope someone can give some advice. I'm trying to fix Deviously Helpless so that it will work with Sl1.6+ or more specifically with papyrusutil 3.4.

 

The problem I'm having is with the override priority here's the actual code:

 

    AddPackageOverride(akActor, attackChasePackage, 20)

    AddPackageOverride(akActor, approachPackage, 19)

    AddPackageOverride(akActor, gatherPackage, 18)

    AddPackageOverride(akActor, sandboxPackage, 17)

 

The problem seems to occur with the attackChasePackage line, if I comment it out the other three then work correctly but the problem is that the pc has to stand next to a bandit to start it off.

 

If I include it then the bandits do approach but there is only one attack and then afterwards the bandits keep following the pc. If I drop the priority on attackChasePackage then it behaves the same as if I have commented it out. I tried adding an extra line to drop the priority afterwards but again that was the same as if it was commented out.

 

Ideally I need it to run once then switch off

 

This does not looks like a AddPackageOverride problem, but more on the definition of the packages themselves.

Check if they can be joined, check them directly added to a NPC to test if they can complete successfully.

 

 

They work fine in with papyrusutil28 it's with papyrusutil32 that there's a problem.

 

I gather from a comment by Ashal in the old DH thread that in v28 priority wasn't active so the overrides just followed in the order that they were in the script.

 

Link to comment

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?

Link to comment

i've never worked with IntListSet but from what i read, it works with a range.
if i=5, then you give it 5 and then the content of array index 5.

Should be more like 5, 7 to adress index 5, 6 and 7.

To adress only 1 index IntListAdd should be the way to go.

But as mentioned: Just a guess as i never used IntListSet and just read up on it.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use