prideslayer Posted July 22, 2012 Author Posted July 22, 2012 I'm considering making the keys for Get/Set/Clr case insensitive. Any objections?
Chase Roxand Posted July 22, 2012 Posted July 22, 2012 Please do. Also, if a key is being set to and from 0 often, would it be better to set it or clear it?
prideslayer Posted July 22, 2012 Author Posted July 22, 2012 I'd say set it to 0 in that case. Use clr when it's being unset and probably won't be set for a while, or when you need to clear a large subset of keys. E.g. this: if (actorA) actorA.NX_ClrEVFl "Sexout:Start::" 2 actorA.NX_ClrEVFo "Sexout:Start::" 2 endif Is a lot easier than the ~50 lines I needed (per actor!) to set the vars to zero individually. As you're the only other person heavily using NX, your vote counts for 10.. and so.. case insensitivity, here we come.
Chase Roxand Posted July 22, 2012 Posted July 22, 2012 Oh my. I want to make things with this. I don't even know what, but things. Any updates on storing the EVs in/with saves?
prideslayer Posted July 22, 2012 Author Posted July 22, 2012 Ashmedai is heading up the fight on that front. He has the load notification working, but save notification isn't done yet. Soon as it is, I should be ready to rock n' roll, once I've actually coded the save/load on my end. Trying to not rush him. Going to need some Con_DumpEV* functions (that can do the prefix/wildcard thing) as well to help with debugging I think, just to spew them into the console.
prideslayer Posted July 22, 2012 Author Posted July 22, 2012 Having a bit of C/C++ trouble that I'm maybe just too zombified to see.. Will start simple. This: key = keyName; std::transform(key.begin(), key.end(), key.begin(), ::tolower); _MESSAGE("\tget %x %s", thisObj->refID, key.c_str()); _MESSAGE("\tcount(%x) is %i", thisObj->refID, nvse_ex_evformmap.count(thisObj->refID)); if (nvse_ex_evformmap.count(thisObj->refID) > 0) { _MESSAGE("\t\t [%x].count(%s) is %i", thisObj->refID, key, nvse_ex_evformmap[thisObj->refID].count(key)); if (nvse_ex_evformmap[thisObj->refID].count(key) > 0) { *result = nvse_ex_evformmap[thisObj->refID][key]; _MESSAGE("\t\t\tresult is %x (%x)", nvse_ex_evformmap[thisObj->refID][key], (UInt32)*result); if (IsConsoleMode()) { Console_Print("GetEVFo: %x", (UInt32)*result); } } } Is producing this output: get d7f59 sexout:start::actora count(d7f59) is 1 [d7f59].count(sexout:start::actora) is 0 result is d7f59 (d7f59) Which should be impossible. Result should not be printing if count == 0, so I must be using count wrong, which might explain some other things as well. That or I'm using the whole structure wrong. Definition of nvse_ex_evformmap: typedef std::unordered_map NVSE_EXEVRefForm; typedef std::unordered_map NVSE_EXEVRefFormMap; NVSE_EXEVRefFormMap nvse_ex_evformmap; So it's an unordered_map (hash) with a UInt32 key, NVSE_EXEVRefForm value. NVSE_EXEVRefForm is another hash with a string key and a uint32 value. It did used to be a single definition like typedef std::unordered_map> NVSE_EXEVRefFormMap; But that shouldn't matter.. I don't think?
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Copypasta gone wrong of course.. working now, no thanks to the peanut gallery! *ducks*
Halstrom Posted July 23, 2012 Posted July 23, 2012 I'd say set it to 0 in that case. Use clr when it's being unset and probably won't be set for a while' date=' or when you need to clear a large subset of keys. E.g. this: if (actorA) actorA.NX_ClrEVFl "Sexout:Start::" 2 actorA.NX_ClrEVFo "Sexout:Start::" 2 endif Is a lot easier than the ~50 lines I needed (per actor!) to set the vars to zero individually. As you're the only other person heavily using NX, your vote counts for 10.. and so.. case insensitivity, here we come. [/quote'] You got my vote, not that I know exactly what I'm voting for, but then that's no different to any government election I've participated in My GECK errors still there in V8 but I'm suspecting 99.9% it's more likely to be at my end and hasn't caused any issues yet.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Cool hal, thanks for that. Not quite sure what to say about the Geck issues though? I haven't had any problems myself with V8, has anyone else? V9 is giving me all kinds of trouble still, really not sure what's going on. If anyone could look at the code @ sourceforge and provide insights, I'd really appreciate it. Seeing bizarre behavior in game that isn't duplicated via the console, like: ; testing set actorab to NX_GetEVFo "Sexout:Start::actorA" set actorbb to NX_GetEVFo "Sexout:Start::actorB" set actorcb to NX_GetEVFo "Sexout:Start::actorC" printc "SexoutCSEs: %n - %n (%i) %n (%i) %n (%i)", self, actorab, actorab, actorbb, actorbb, actorcb, actorcb printc "SexoutCSEb: %n - %n (%i) %n (%i) %n (%i)", self, actora, actora, actorb, actorb, actorc, actorc NX_SetEVFo "Sexout:Start::actorA" actorA NX_SetEVFo "Sexout:Start::actorB" actorB NX_SetEVFo "Sexout:Start::actorC" actorC set actora to NX_GetEVFo "Sexout:Start::actorA" set actorb to NX_GetEVFo "Sexout:Start::actorB" set actorc to NX_GetEVFo "Sexout:Start::actorC" printc "SexoutCSEa: %n - %n (%i) %n (%i) %n (%i)", self, actora, actora, actorb, actorb, actorc, actorc Resulting in this the first run (test run with actora & actorb) SexoutCSE: callver 0 SexoutCSEs: Deputy Beagle - (00000000) (00000000) (00000000) SexoutCSEb: Deputy Beagle - Deputy Beagle (000D7F59) Wyoming (00000014) (00000000) SexoutCSEa: Deputy Beagle - Deputy Beagle (000D7F59) Wyoming (00000014) (00000000) And then this the 2nd run (masturbation attempt, only actorA set) SexoutCSEs: Wyoming - (00000000) (00000000) (00000000) SexoutCSEb: Wyoming - Wyoming (00000014) (00000000) (00000000) SexoutCSEa: Wyoming - Wyoming (00000014) Wyoming (00000014) (00000000) This should obviously not happen.. actorb was 0 on the 2nd attempt, as the first line indicates.. but setting it and pulling it back out, it's not there. It's almost like A is being duplicated into B's slot, and then overwritten but only if nonzero. Trying a 3way and then a 2way, the same thing happens with actor C.
Halstrom Posted July 23, 2012 Posted July 23, 2012 Cool hal' date=' thanks for that. Not quite sure what to say about the Geck issues though? I haven't had any problems myself with V8, has anyone else? V9 is giving me all kinds of trouble still, really not sure what's going on. If anyone could look at the code @ sourceforge and provide insights, I'd really appreciate it. Seeing bizarre behavior in game that isn't duplicated via the console, like: ; testing set actorab to NX_GetEVFo "Sexout:Start::actorA" set actorbb to NX_GetEVFo "Sexout:Start::actorB" set actorcb to NX_GetEVFo "Sexout:Start::actorC" printc "SexoutCSEs: %n - %n (%i) %n (%i) %n (%i)", self, actorab, actorab, actorbb, actorbb, actorcb, actorcb printc "SexoutCSEb: %n - %n (%i) %n (%i) %n (%i)", self, actora, actora, actorb, actorb, actorc, actorc NX_SetEVFo "Sexout:Start::actorA" actorA NX_SetEVFo "Sexout:Start::actorB" actorB NX_SetEVFo "Sexout:Start::actorC" actorC set actora to NX_GetEVFo "Sexout:Start::actorA" set actorb to NX_GetEVFo "Sexout:Start::actorB" set actorc to NX_GetEVFo "Sexout:Start::actorC" printc "SexoutCSEa: %n - %n (%i) %n (%i) %n (%i)", self, actora, actora, actorb, actorb, actorc, actorc Resulting in this the first run (test run with actora & actorb) SexoutCSE: callver 0 SexoutCSEs: Deputy Beagle - (00000000) (00000000) (00000000) SexoutCSEb: Deputy Beagle - Deputy Beagle (000D7F59) Wyoming (00000014) (00000000) SexoutCSEa: Deputy Beagle - Deputy Beagle (000D7F59) Wyoming (00000014) (00000000) And then this the 2nd run (masturbation attempt, only actorA set) SexoutCSEs: Wyoming - (00000000) (00000000) (00000000) SexoutCSEb: Wyoming - Wyoming (00000014) (00000000) (00000000) SexoutCSEa: Wyoming - Wyoming (00000014) Wyoming (00000014) (00000000) This should obviously not happen.. actorb was 0 on the 2nd attempt, as the first line indicates.. but setting it and pulling it back out, it's not there. It's almost like A is being duplicated into B's slot, and then overwritten but only if nonzero. Trying a 3way and then a 2way, the same thing happens with actor C.[/quote'] I'm not sure if it's related but I know trying to do things like GetHealthPercent on a vacant slot or RemoveItem for a NULL reference crashes a script.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Script isn't crashing.. it's something wrong in the extender.
ashmedai Posted July 23, 2012 Posted July 23, 2012 btw, I updated the NVSE fork with the save game hook. It seems stable so far.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Cool, thanks for that. I won't be able to give it a try until I get the current issue sorted out, one problem at a time. Lots of updates to the sourceforce project if you want to pull them in.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 nvse_ex_evformmap[thisObj->refID].count(key) Is returning odd values at times.. not 0 or 1 like it should always be for an unordered map, but something that looks almost like a pointer (or a ref ID from somewhere else..).. 6046496 (0x5C4320), 1628268 (0x18D86C) etc. Thought the CLR functions might be messing things up so I commented the function bodies out in the extender code, no help. Basically grasping at straws here. Have I mentioned I don't actually know C++ or C.. not really anyway.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Changed from unordered map to a regular map w/ pair key, same thing.. this is really strange. typedef std::pair NVSE_EVKey; typedef std::map NVSE_EXEVRefFloatMap; typedef std::map NVSE_EXEVRefFormMap; .. with subsequent changes in everything using them to use std::make_pair on the key, e.g. *result = nvse_ex_evfloatmap[std::make_pair(thisObj->refID, key)]; GET values, they're fine (all 0). SET values to (1, 2, 0). GET values, they're fine (1, 2, 0). SET values to (1, 0, 0). GET values, NOT fine, comes back 1, 2, 0 again. The values are definitely getting set to 0 in the map, but the function is somehow returning an old value.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 Tested set (1,2,0) get worked, 1,2,0. set 3,2,0 get worked, 3,2,0 set 2,0,0 annnnd get is wrong, comes back 2,2,0.
prideslayer Posted July 23, 2012 Author Posted July 23, 2012 9beta3 available in OP - CLR functions enabled and should be working. - Fixes a bug that causes NX_SetEVFo to fail when a null form is given. This bug is, I believe, present in v8! - Back to unordered_maps. - Count logic currently stripped out, will return later.
prideslayer Posted July 24, 2012 Author Posted July 24, 2012 With that BS out of the way, it's back to work on serializing the data for save/load. Some progress being made. Log file capture of test save during a scene. START: save settings EVFO d7f59, sexout:start::actora = d7f59 d7f59, sexout:start::actorb = 14 d7f59, sexout:start::actorc = 0 d7f59, sexout:start::actorx = 0 d7f59, sexout:start::raper = 0 d7f59, sexout:start::bactorablockcrotch = 0 d7f59, sexout:start::cbdialogx = 0 d7f59, sexout:start::cbdialoga = 0 d7f59, sexout:start::cbdialogb = 0 d7f59, sexout:start::cbdialogc = 0 d7f59, sexout:start::cbspella = 0 d7f59, sexout:start::cbspellb = 0 d7f59, sexout:start::cbspellc = 0 d7f59, sexout:start::cbspellx = 0 d7f59, sexout:start::cbitemx = 0 d7f59, sexout:start::cbitemc = 0 d7f59, sexout:start::cbitemb = 0 d7f59, sexout:start::cbitema = 0 d7f59, sexout:start::cbpackx = 0 d7f59, sexout:start::cbpackc = 0 d7f59, sexout:start::cbpackb = 0 d7f59, sexout:start::cbpacka = 0 d7f59, sexout:start::bodya = 0 d7f59, sexout:start::bodyb = 0 d7f59, sexout:start::bodyc = 0 d7f59, sexout:start::refsurface = 0 d7f59, sexout:core:partners:a = d7f59 d7f59, sexout:core:partners:b = 14 14, sexout:core:partners:a = d7f59 14, sexout:core:partners:b = 14 EVFL d7f59, sexout:start::callver = 0.00000 d7f59, sexout:rotchanged = 0.00000 d7f59, sexout:poschanged = 0.00000 d7f59, sexout:start::animb = 932.00000 d7f59, sexout:start::raper = 0.00000 d7f59, sexout:start::duration = 0.00000 d7f59, sexout:start::isvaginal = 0.00000 d7f59, sexout:start::fvoffsetc = 0.00000 d7f59, sexout:start::fvoffsetb = 0.00000 d7f59, sexout:start::fvoffseta = 0.00000 d7f59, sexout:start::anima = 932.00000 d7f59, sexout:start::isanal = 0.00000 d7f59, sexout:start::isoral = 0.00000 d7f59, sexout:start::animc = 932.00000 d7f59, sexout:core:actors:count = 2.00000 d7f59, sexout:start::fhoffsetc = 0.00000 d7f59, sexout:start::fhoffsetb = 0.00000 d7f59, sexout:start::fhoffseta = 0.00000 d7f59, sexout:start::bdontredressc = 0.00000 d7f59, sexout:start::bdontredressb = 0.00000 d7f59, sexout:start::bdontredressa = 0.00000 d7f59, sexout:start::bdontundressc = 0.00000 d7f59, sexout:start::bdontundressb = 0.00000 d7f59, sexout:start::bdontundressa = 0.00000 d7f59, sexout:start::fsurfacez = 0.00000 d7f59, sexout:start::fsurfacey = 0.00000 d7f59, sexout:start::fsurfacex = 0.00000 d7f59, sexout:roty = -0.00000 d7f59, sexout:posy = 2094.73218 d7f59, sexout:start::fsurfaceangle = 0.00000 d7f59, sexout:start::noanim = 0.00000 d7f59, sexout:start::nusezaz = 0.00000 d7f59, sexout:start::bactorcmale = 0.00000 d7f59, sexout:start::bactorbmale = 0.00000 d7f59, sexout:start::bactoramale = 1.00000 d7f59, sexout:start::bactorablockcrotch = 0.00000 d7f59, sexout:rotx = 0.00000 d7f59, sexout:posx = 2023.94495 d7f59, sexout:start::bcanoral = 30.00000 d7f59, sexout:start::bcanvaginal = 60.00000 d7f59, sexout:start::bcananal = 10.00000 d7f59, sexout:start::focusz = 7300.75879 d7f59, sexout:start::focusy = 2094.73218 d7f59, sexout:start::focusx = 2023.94495 d7f59, sexout:core:sextype:vaginal = 0.00000 d7f59, sexout:core:sextype:anal = 0.00000 d7f59, sexout:core:sextype:oral = 0.00000 d7f59, sexout:rotz = 188.13611 d7f59, sexout:posz = 7300.75879 14, sexout:core:actors:count = 2.00000 14, sexout:start::fhoffseta = 0.00000 14, sexout:start::fhoffsetb = 0.00000 14, sexout:start::fhoffsetc = 0.00000 14, sexout:start::focusx = 2023.94495 14, sexout:start::focusy = 2094.73218 14, sexout:start::focusz = 7300.75879 14, sexout:start::fvoffseta = 0.00000 14, sexout:start::fvoffsetb = 0.00000 14, sexout:start::fvoffsetc = 0.00000 14, sexout:core:sextype:vaginal = 0.00000 14, sexout:core:sextype:anal = 0.00000 14, sexout:core:sextype:oral = 0.00000 14, sexout:start::nusezaz = 0.00000 14, sexout:rotx = 18.10547 14, sexout:posx = 2023.94495 14, sexout:roty = -0.00000 14, sexout:posy = 2094.73218 14, sexout:rotz = 8.13611 14, sexout:posz = 7300.75879 14, sexout:rotchanged = 0.00000 14, sexout:poschanged = 0.00000 END: save settings
prideslayer Posted July 24, 2012 Author Posted July 24, 2012 I'm pretty much settled on saving the data as an XML file, unless their are objections. Will make it easier for everyone to find and fix bugs in saved NX data without requiring a clean save/load cycle. File location will (should) be in the savegame directory with your existing savegames, with the same file name but ending in ".nx.xml", e.g. the data file for "autosave.fos" will be "autosave.fos.nx.xml", or something like that.
prideslayer Posted July 24, 2012 Author Posted July 24, 2012 Save is working as as simple csv. Will probably leave it that way until/unless the data structure becomes complicated enough that something else is needed. XML is overkill considering the hoops I need to jump through to use MSXML, XmlTextWriter, or libxml. FO, 884569, sexout:start::actora, 884569 FO, 884569, sexout:start::actorb, 20 FO, 884569, sexout:core:partners:a, 884569 FO, 884569, sexout:core:partners:b, 20 FO, 20, sexout:core:partners:a, 884569 FO, 20, sexout:core:partners:b, 20 FL, 884569, sexout:start::animb, 904 FL, 884569, sexout:start::anima, 904 FL, 884569, sexout:start::animc, 904 FL, 884569, sexout:core:actors:count, 2 FL, 884569, sexout:posy, 2132.99 FL, 884569, sexout:start::bactoramale, 1 FL, 884569, sexout:posx, 2033.94 FL, 884569, sexout:start::bcanoral, 30 FL, 884569, sexout:start::bcanvaginal, 60 FL, 884569, sexout:start::bcananal, 10 FL, 884569, sexout:start::focusz, 7297.05 FL, 884569, sexout:start::focusy, 2127.99 FL, 884569, sexout:start::focusx, 2033.95 FL, 884569, sexout:rotz, 179.886 FL, 884569, sexout:posz, 7297.05 FL, 20, sexout:core:actors:count, 2 FL, 20, sexout:start::focusx, 2033.95 FL, 20, sexout:start::focusy, 2127.99 FL, 20, sexout:start::focusz, 7297.05 FL, 20, sexout:rotx, 13.8656 FL, 20, sexout:posx, 2033.95 FL, 20, sexout:posy, 2127.99 FL, 20, sexout:rotz, 359.886 FL, 20, sexout:posz, 7297.05
Chase Roxand Posted July 24, 2012 Posted July 24, 2012 Sounds great! Random question: what happens to the EVs when a temporary NPC is unloaded? Are they cleared, too?
prideslayer Posted July 24, 2012 Author Posted July 24, 2012 Sounds great! Random question: what happens to the EVs when a temporary NPC is unloaded? Are they cleared' date=' too? [/quote'] No.. the extender doesn't know if/when a temporary form has been unloaded/destroyed. I could periodically check that the form IDs in the arrays are valid and clear the invalid ones. Depending on how intensive that call is (I imagine it's pretty fast) I can revalidate all the formIDs that EVs are assigned to every time an NX_Get* is performed. This would be done on all the keys for EVFl and EVFo, as well as on all the values in EVFo.
prideslayer Posted July 24, 2012 Author Posted July 24, 2012 Oh just so everyone knows, when it comes time to test the save/load functionality, you're going to have to use a version of NVSE specifically built to support it. I'm hopeful that the testing will go smoothly, at least as far as that is concerned, and then I'll send a patch to the silverlock guys to include it in the official release. It may take some time for them to get around to doing that, though.
prideslayer Posted July 27, 2012 Author Posted July 27, 2012 If there have been no problems with the current beta (v9) for those using it (required by current sexout beta), I'm going to promote it to release later today. Speak up if it's broken.
Recommended Posts