Jump to content

xEdit script access to PCMB and VISI (timestamps)


tk421storm1

Recommended Posts

I see that the UI of xEdit (v4.0.3) has nice access to the timestamps for precombines (PCMB) and previs (VISI). I'm looking to export that information to a CSV file using a .pas script. However, I'm unusure how to proceed.

 

Getting the timestamp for the header was easy, since there is already a function defined for GetFormVCS1. However there is no equivalent function for PCMB or VISI (that I can find). I can get some kind of data out by exporting with:

GetElementEditValues(e, 'PCMB')

However the data is in a format I don't understand, and am not even sure is related to the timestamp, ex "AD 20" or "24 1F". Maybe someone smarter than me can make sense of those :wink:

 

Thanks for your help!

 

-Mike

Link to comment
Share on other sites

That is the hex code that is actually in the plugin, it is converted to the timestamp you see.

 

If you need to copy the VCI1 header info from one copy of a record to a copy from another plugin, you can use the "Copy version control info from another plugin.pas" script included in xedit. You would just need to remove the bits that check for identical masterlists (those were put in at the request of someone, I confirmed with zilav (maker of the script), that they are not truly needed. Here is a copy of the plugin with the masterlist check removed:

{
  Copy Version Control Info inside Record Header between plugins.
  Apply script to destination records, then select the source plugin.
  Both plugins must have the same masters list, records are matched by FormIDs.
}
unit CopyVCInfo;

var
  fromPlugin: IInterface;


  
//==================================================================================
function Process(e: IInterface): integer;
var
  frm: TForm;
  clb: TCheckListBox;
  i: integer;
  r: IInterface;
begin
  // plugins selection window for the source plugin to copy from
  if not Assigned(fromPlugin) then begin
    frm := frmFileSelect;
    try
      frm.Caption := 'Select plugin to copy from';
      frm.Width := 420;
      clb := TCheckListBox(frm.FindComponent('CheckListBox1'));

      // add files except the current one
      for i := 0 to Pred(FileCount) do
        if not SameText(GetFileName(e), GetFileName(FileByIndex(i))) then begin
          clb.Items.AddObject(GetFileName(FileByIndex(i)), FileByIndex(i));
          Inc(i);
        end;

      // get the first checked file
      if frm.ShowModal = mrOk then
        for i := 0 to Pred(clb.Items.Count) do
          if clb.Checked[i] then begin
            fromPlugin := ObjectToElement(clb.Items.Objects[i]);
            Break;
          end;

      // if nothing is checked then abort
      if not Assigned(fromPlugin) then begin
        Result := 1;
        Exit;
      end;

    finally
      frm.Free;
    end;
  end;

  // copy VC info
  r := RecordByFormID(fromPlugin, FixedFormID(e), False);
  if Assigned(r) then begin
    SetFormVCS1(e, GetFormVCS1(r));
    SetFormVCS2(e, GetFormVCS2(r));
  end;
end;


end.
 

Also, to be clear on how the VISI and PCMB are used: they are compared to the VCI1 of the REFRs listed under them in that copy of the CELL (i.e. the REFR records your mod touches) that are part of the precombined mesh. The way you can tell which ones are part of a precombined mesh, is they will have brackets (i.e. [Placed Object] rather than Placed Object). That denotes REFRs listed in the XCRI subrecord of the CELL.

Link to comment
Share on other sites

Thank you so much for this awesome description! This is going to be really helpful for my next step.

 

Ultimately, I'm trying to find a list of all cells in my modded game install that have broken/disabled precombines. If I were to do this by xEdit script, can I access the VCI1 record of each REFR under the cell using that same GetFormVCS1 function?

 

Once I have the VCS of the REFR and the PCMB/VISI, I would do a date comparison, if older = ok, if newer = game will disable precombines here.

 

Is there any other criteria I would need to look for to find broken PCMB/VISI cells?

 

Thanks!

 

-Mike

Link to comment
Share on other sites

  • Recently Browsing   0 members

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