Jump to content

Dev-Question: Are OBSE Arrays loadorder safe?


Recommended Posts

I'm currently in the process of rewriting MCS to be more readable and easier to maintain (and as a result, expandable without understanding japanese). I'm not sure i'll be able to pull this off entirely, but anyways, one thing i stumbled upon, is that MCS itself apparently doesn't require OBSE.... only MCSext uses some OBSE funcs.

 

Unfortunatelly, doing without OBSE had some really ugly consequences for the implementation of MCS.... miles of unrolled loops, companions are referenced via variables, instead of via indexes in an array..... this leads to lots of cases similiar to this one:

if IsPersistent == 0
   Set MCSQ.EntryN to 0
  elseif MCSQ.Comp1 == Actor && MCSChestC1Ref.GetItemCount MCSRubyAI > 0
   Set MCSQ.EntryN to 1
   Set MCSQ.Chest to MCSChestC1Ref
   Set MCSQ.Marker to MCSMarkerC1Ref
  elseif MCSQ.Comp2 == Actor && MCSChestC2Ref.GetItemCount MCSRubyAI > 0
   Set MCSQ.EntryN to 2
   Set MCSQ.Chest to MCSChestC2Ref
   Set MCSQ.Marker to MCSMarkerC2Ref
  elseif MCSQ.Comp3 == Actor && MCSChestC3Ref.GetItemCount MCSRubyAI > 0
   Set MCSQ.EntryN to 3
   Set MCSQ.Chest to MCSChestC3Ref
   Set MCSQ.Marker to MCSMarkerC3Ref
  elseif MCSQ.Comp4 == Actor && MCSChestC4Ref.GetItemCount MCSRubyAI > 0
   Set MCSQ.EntryN to 4
   Set MCSQ.Chest to MCSChestC4Ref
   Set MCSQ.Marker to MCSMarkerC4Ref
  elseif MCSQ.Comp5 == Actor && MCSChestC5Ref.GetItemCount MCSRubyAI > 0
...

This goes on and on.... 96 times, since thats how many companions MCS supports - and then it's done AGAIN in the above script to check for temporary actors... almost TWO HUNDRED unrolled iterations.

 

So, the obvious question is, why not use proper arrays, via OBSE? But then i remembered all the loadorder mess that tamagoclub causes, which does store all its data via OBSE structs IIRC. Then again, tamago consists of a master and a plugin, while MCS only consists of a single plugin.... i'm not sure if that matters - i still don't really understand the strange way how savedata is stored in oblivion, and how cross-mod references are handled - and how LO matters for all this.

 

But anyways, to put it simple: Would storing references to actors in OBSE arrays, instead of in variables, be more prone to break during loadorder changes?

Link to comment

Perhaps MCS was created before OBSE array feature was introduced.

But anyways, should be no worse than ref vars. Why not use arrays?

Though if you store them in a stringmap for easier search, (for example, string version refID of the actor as the string key) that's a different story.

Link to comment

Nope, was thinking of plain map (not array actually, since i need to allow for unused indexes).

 

Got a healthy chunk of code replaced today, all nicely sanitized and using function calls and iterators.

 

Saved it. Then loaded it into TES4Edit. All changes gone.

 

Looking around, i noticed i already had the plugin open in tes4edit before.... and therefore, CS acted as if it saved the changes, without actually saving anything (file in use)..... but also of course not informing me. Thank you, beth, you fucking piece of shit - 4 hours lost.

 

Maybe i'll try again in a few days.

Link to comment

Yup, news from the trenches:

 

Re-rewrote quite a bit of code again.... about 3 hours work. This time, i was extra careful, and outrightly closed down CS every fifteen minutes saving, then backupped the ESP.

 

Obviously, that was way too safe and nice, so my computer had to come up with an unrelated way to destroy userdata. My UMTS card did its bi-monthly BSOD, and along with it went the three scripts i was working on in a texteditor. That was a quite smart approach, because naively i didn't save those for an hour, cause how on earth could something as basic as notepad cause trouble, right?

 

Well, on the upside.... not everything lost this time: Two hours of work safely stored on disk, one hour lost. PROGRESS!

 

P.S.: I want my C64 back.

 

http://www.escapistmagazine.com/videos/view/loadingreadyrun/2516-Every-OS-Sucks

Link to comment

My condolences, but in my case (CS v1.2.0.404) when it fails to save file due it's in use by other program first time, CS makes it's copy with .tes extention - and after renaming to *.esp plugin works correct. But second attempt to save the same file (even if it is "free" now!) hangs my CS dead.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • 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