Jump to content

Devious Devices Framework Development/Beta


Recommended Posts

Hello,

 

 

(...) 

Had a look at that code now. In my version of the file (3.3b release) ProcessEvents does manipulate ProcessNum. Also it works with normal left-to-right evaluation. It goes roughly like this:

 

Lets assume ProcessNum is 1 when the first if-statement is reached:

 

The left half of the AND-statement is evaluated true, because 1 > 0. Then it enters the function ProcessEvents. In ProcessEvents the call to ProcessOneEvent evaluates to false, therefore the else-branch of the if-statement within ProcessEvents is reached. In this else-branch ProcessNum is set to 0 and false is returned.

 

Because of the returned false, the second half of the first if-statement is evaluated true (as it is checked with the negation-operator). So the complete if evaluates to true, and ProcessNum is set to 0. Which means, the following second if-statement is evaluated to true. To clarify: the statement within ProcessEvents is

"else

   ProcessNum = 0"

 

NOT

 

"else if ProcessNum == 0"

 

It's not a boolean evaluation, it's setting ProcessNum to 0 in case of the else-branch. At least in 3.3b

No idea if the development version of DDi has different code, but the code I see should work.

 

I understand that...I did miss the negating on the calling condition, so I (too) quickly thought that condition would fail.

 

I am not using the latest commit of the code locally because I have too much work troubleshooting my own issues (except in this case).

I prefer using stable versions of the frameworks I am relying on.

Link to comment

@Kimy - I had to make a couple of tweaks to zadEventsSlots.psc and zadBaseEvent.psc to get my custom devices to register and trigger correctly. Hopefully this will save you time when troubleshooting the event loop.

 

1- I found that for some reason, the initialize function gets called on game load, which means that custom devices who got properly added by their registration event would get wiped from the list.

 

Changing the Initialize function to this helped with that problem:

Function Initialize()
	If (Registry.Find("")==0) ; SkyrimLL - Disable if already initialized
		libs.Log("Initializing Events arrays.")
		Registry = new String[125]
		Slots = new zadBaseEvent[125]
		LoadDefaults()
	else
		libs.Log("Events arrays already initialized - skipping.")
	Endif
EndFunction

2- Also, in zadBaseEvent, the 'Loaded' debug message would display weather the device was registered correctly or not, which could be misleading. Adding a call to the gegistration function helps with that (and also prevents from having to expect mods would call a full re-registration of all events just to add a new one).

Event OnPlayerLoadGame()
	RegisterForModEvent("zadRegisterEvents","OnRegisterEvents")
	if Probability < 0
		Probability = DefaultProbability
	EndIf
	libs.EventSlots.Register(name, self) ; SkyrimLL - Register on load if needed
	libs.Log("["+name+"] Loaded: "+Probability+"%")
EndEvent

Those two changes allowed me to display my custom events in the DD menu and change their probability there.

 

Turns out, I added 5 custom events from 3 mods over the past year or so and all that time, none were triggering at all :)

Link to comment

 

Chris knows. But it doesn't matter either way. Xaz, who was responsible for the coding side of ZAP, is still MIA, so the parts of ZAP that are relevant to us remain inadequate for our needs. Ultimately, ZAP limits us in areas that we are interested in expanding. And because none of us can commit to taking it over, we cannot trust it not to be abandoned or inherited by the wrong person again.

 

But regardless of anything else, we've been planning to do it for a long time. The recent incident merely convinced us that it was time to finally put the plan into motion. Given the uncertain future of ZAP, we have concluded that freeing DD from its dependency is the only way forward.

 

This is potentially huge for mods relying on ZAP keywords as shorthand for NPCs wearing collars or gags. 

 

I will have to deeply audit my mods for this.

 

Any rough idea of when you are planning to release this particular change? are we talking weeks, months?

 

 

Honestly, DD mods should and should always have used the DD keywords for evaluation and conditionals. Before we removed the keywords I checked the framework code and there was not a single instance where the framework actually evaluated these keywords. These changes should normally not affect backwards compatibility, except if a DD mods treats DD items like ZAP items. Not sure why anyone would do that, though. oO

 

But yes, the changes were already made, so you can test it against your own code and see if everything is still all right. :)

 

@Kimy - I had to make a couple of tweaks to zadEventsSlots.psc and zadBaseEvent.psc to get my custom devices to register and trigger correctly. Hopefully this will save you time when troubleshooting the event loop.

 

1- I found that for some reason, the initialize function gets called on game load, which means that custom devices who got properly added by their registration event would get wiped from the list.

 

Changing the Initialize function to this helped with that problem:

Function Initialize()
	If (Registry.Find("")==0) ; SkyrimLL - Disable if already initialized
		libs.Log("Initializing Events arrays.")
		Registry = new String[125]
		Slots = new zadBaseEvent[125]
		LoadDefaults()
	else
		libs.Log("Events arrays already initialized - skipping.")
	Endif
EndFunction

2- Also, in zadBaseEvent, the 'Loaded' debug message would display weather the device was registered correctly or not, which could be misleading. Adding a call to the gegistration function helps with that (and also prevents from having to expect mods would call a full re-registration of all events just to add a new one).

Event OnPlayerLoadGame()
	RegisterForModEvent("zadRegisterEvents","OnRegisterEvents")
	if Probability < 0
		Probability = DefaultProbability
	EndIf
	libs.EventSlots.Register(name, self) ; SkyrimLL - Register on load if needed
	libs.Log("["+name+"] Loaded: "+Probability+"%")
EndEvent

Those two changes allowed me to display my custom events in the DD menu and change their probability there.

 

Turns out, I added 5 custom events from 3 mods over the past year or so and all that time, none were triggering at all :)

 

Glad that you found the issue! Want me to merge that code or create a pull request yourself?

 

Link to comment

 

 

Hello,

 

 

Hello,

 

Question about event updates:

		if ProcessNum > 0 && !ProcessEvents(libs.PlayerRef) ; If we processed the last event, restart.
			if ProcessNum == 0
				libs.Log("Finished processing events. Re-Polling..")
				UpdateGlobalEvent()
			else
				DoRegister()
			EndIf
		else
			DoRegister()
		EndIf

In zadEventSlots.psc, you can find this piece of code above.

 

The first If statement checks if 'ProcessNum > 0'.

The second one looks if 'ProcessNum == 0'.

 

There is no way that second one is ever true if the first one is true, so it probably never gets processed.

 

 

just a wild guess from this snippet of code alone: this construct could be working if:

- ProcessNum's scope also is valid within the function ProcessEvents

- ProcessEvents manipulates ProcessNum via side effects

- therefore: if ProcessNum is e.g. 1 and ProcessEvents decreases it by one, then ProcessNum could actually be 0 at the second if statement.

 

Whether this is good style is a completely different matter though.

 

 

That would be assuming ProcessEvents is evaluated first in the condition.

If the condition is evaluated left to right in the code, the condition would fail right away and never get to evaluate ProcessEvent... but I concede there is a small chance that statement could be true.

 

That said, I doubt that was the intent smile.png

 

Edit: I looked at ProcessEvents and it doesn't touch ProcessNum.

However, it does return false if processEnum = 0, so it would fail as well in that case smile.png

 

 

Question about event updates:

 (...)
There is no way that second one is ever true if the first one is true, so it probably never gets processed.

 

 

Is there no case where  ProcessEvents(libs.PlayerRef)  would be true and ProcessNum == 0 ?

 

 

If ProcessNum==0, then the first part of the AND statement is false and the whole condition would fail even if ProcessEvents is true.

 

For it to work, it would have to be become 0 sometime between the first and the second line of code, which is very unlikely but I agree, could be possible in the situation suggested above.

 

 

 

Had a look at that code now. In my version of the file (3.3b release) ProcessEvents does manipulate ProcessNum. Also it works with normal left-to-right evaluation. It goes roughly like this:

 

Lets assume ProcessNum is 1 when the first if-statement is reached:

 

The left half of the AND-statement is evaluated true, because 1 > 0. Then it enters the function ProcessEvents. In ProcessEvents the call to ProcessOneEvent evaluates to false, therefore the else-branch of the if-statement within ProcessEvents is reached. In this else-branch ProcessNum is set to 0 and false is returned.

 

Because of the returned false, the second half of the first if-statement is evaluated true (as it is checked with the negation-operator). So the complete if evaluates to true, and ProcessNum is set to 0. Which means, the following second if-statement is evaluated to true. To clarify: the statement within ProcessEvents is

"else

   ProcessNum = 0"

 

NOT

 

"else if ProcessNum == 0"

 

It's not a boolean evaluation, it's setting ProcessNum to 0 in case of the else-branch. At least in 3.3b

No idea if the development version of DDi has different code, but the code I see should work.

 

I just checked, and the code is the same in the latest version on github as well.
Link to comment

 

 

 

Honestly, DD mods should and should always have used the DD keywords for evaluation and conditionals. Before we removed the keywords I checked the framework code and there was not a single instance where the framework actually evaluated these keywords. These changes should normally not affect backwards compatibility, except if a DD mods treats DD items like ZAP items. Not sure why anyone would do that, though. oO

 

But yes, the changes were already made, so you can test it against your own code and see if everything is still all right. :)

 

@Kimy - I had to make a couple of tweaks to zadEventsSlots.psc and zadBaseEvent.psc to get my custom devices to register and trigger correctly. Hopefully this will save you time when troubleshooting the event loop.

 

(...)

 

Glad that you found the issue! Want me to merge that code or create a pull request yourself?

 

 

 

I tried to create a pull request but I am doing something wrong and I keep getting an authentication error. 

Would you mind making the changes directly until I figure this out?

 

I created an issue here for the record - https://github.com/DeviousDevices/DDi/issues/173

 

About the keywords, I agree I should have used the DDi keywords from the start but  I thought it was very convenient at the time that ZAP keywords were supported as that provides a nice bridge for dialogue conditions with ZAP only mods like Hydragorgon's slave girls.

 

I will keep an eye out for how I use those keywords and make changes as I find them.

Link to comment

I am getting this error - "Permission to DeviousDevices/DDi.git denied to SkyrimLL." when I try to push my changes and do a pull request.

 

Do I need to be added to an approved list of contributors?

I think you need to use the fork feature in github, commit your changes in your fork, and then you can make a pull request with the changes after.
Link to comment

 

I am getting this error - "Permission to DeviousDevices/DDi.git denied to SkyrimLL." when I try to push my changes and do a pull request.

 

Do I need to be added to an approved list of contributors?

I think you need to use the fork feature in github, commit your changes in your fork, and then you can make a pull request with the changes after.

 

 

Thanks.

 

I think I got the hang of it.

 

I created a fork of the project to my account, and I was able to push the changes to my own copy (duh) and create a pull request back to the mothership.

 

Let's see if this works :)

Link to comment

Merged your changes! :)

Great.

 

Now that I am set up, will try to add a mod event to trigger a reset of the custom events instead of just a refresh.

 

That will be useful to force updates of events scripts registrations and clean up of the names in the array.

 

I will close the issue once I am done with that and the corresponding MCM buttons.

Link to comment

When wearing bondage mittens with the "hardcore bondage mittens" unchecked in the MCM -- trying to equip body armor while not wearing body armor pops a message box saying you can't equip armor with the mittens on, but the armor is equipped as normal anyway.

 

Either there should be no message box or the armor should not be equipped.

 

Link to comment

When wearing bondage mittens with the "hardcore bondage mittens" unchecked in the MCM -- trying to equip body armor while not wearing body armor pops a message box saying you can't equip armor with the mittens on, but the armor is equipped as normal anyway.

 

Either there should be no message box or the armor should not be equipped.

 

I will have a look at that. :)

Link to comment

 

When wearing bondage mittens with the "hardcore bondage mittens" unchecked in the MCM -- trying to equip body armor while not wearing body armor pops a message box saying you can't equip armor with the mittens on, but the armor is equipped as normal anyway.

 

Either there should be no message box or the armor should not be equipped.

 

I will have a look at that. smile.png

 

I put up a pull request with a possible solution for that. Though I'll admit it's somewhat simple and basic.

Link to comment

New API function for DD content mods, useful for starting device-aware sex scenes:

 

sslBaseAnimation[] function SelectValidDDAnimations(Actor[] actors, int count, bool forceaggressive = false, string includetag = "")

 

It's functionally equivalent to the DDI animation filter. Using it for starting animations has the advantage that only animations valid for the worn devices will get picked, and the animation will not have to be replaced by the DDI filter. Which is a much cleaner experience!

Link to comment

A couple of problems I've been having.

 

First, the Panel Gags do not appear at all when equipped, or at least the Ebonite ones. As for the leather ones, they do show up, but they're in the open gag position, not closed, and the popup box says "Remove plug" when there isn't one there.

 

I think this has to do with device inventory meshes either not being in the right place or the wrong ones in their place. Can you please look into this?

 

The second thing is that while working on The Duder's Fetish Grab Bag, and adding DD functionality to the tz_lockinghoods mod (private for now, but I think Veldarius (forgot his name, lol) would find it good for his Devious Extras mod, since the hoods need an update), I discovered that with the hoods, when equipping them, characters' mouths open as if they're being gagged.

 

Obviously they are not, cause you can still equip one, but this is a little bit of a pain in the butt when I'm trying to add the scripts to a different device where the mouth is visible. In all these cases, I'm trying to make it so after equipping, the mouth stays shut.

 

I've tried this with both the collar scripts (base attempt) and the dcur_RubberHood scripts and in both cases, the mouth opens and stays open until they unequip.

 

I'm thinking it MAY be a Papyrus problem, but since I don't know or understand that stuff, I can't really be sure. I'm just bringing it to your attention.

 

Either way, can you please look into this as well?

Link to comment

New builds up on the DDi and DDx repos! (Both required!)

  • (Hopefully) fixed the duplication of Prisoner Chain's HDT visuals
  • Added front-bound Handcuffs prototype, requires testing. Name: (Prototype) Iron Handcuffs

Up next on my immediate agenda:

  • Finalise the implementation of Handcuffs, rework Prisoner Chains into a Handcuffs device (pending testing results)
  • Implement prototype devices for the remaining AA sets (Breast Yoke, pending assets)
  • Implement struggling animations for everything (pending assets)
  • Fix AAs getting stuck after unequipping yokes via dialogue (issue successfully reproduced, pending further investigation)
Link to comment

It seems that all the new updates are going towards DDi and DDx. Are modder's going to have to their own assets from now on or DDa will have updates once everything is near completion?

DDa only contains assets with no locking functionality (the locking is added by DDi).

So, from what I understand, DDa will still be required by DDi, but will not get any updates unless something breaks. And given the way DDa/DDi is implemented, something breaking in DDa seems unlikely.

Disclaimer: Of course, since I'm not part of the DD team, I could be completely wrong...

Link to comment

New API function for DD content mods, useful for starting device-aware sex scenes:

 

sslBaseAnimation[] function SelectValidDDAnimations(Actor[] actors, int count, bool forceaggressive = false, string includetag = "")

 

It's functionally equivalent to the DDI animation filter. Using it for starting animations has the advantage that only animations valid for the worn devices will get picked, and the animation will not have to be replaced by the DDI filter. Which is a much cleaner experience!

 

Does this function support suppress tags?

 

Link to comment

It seems that all the new updates are going towards DDi and DDx. Are modder's going to have to their own assets from now on or DDa will have updates once everything is near completion?

 

Barring unforeseeable circumstances, we don't plan to touch DDA again, ever. There is simply no good reason to. All new items will go into DDX, which has the additional benefit to have all the framework code available.

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