Jump to content

xEdit scripting, how to read/write/remove linked lists?


varx

Recommended Posts

No syntax I've tried has worked.

    seev(e, 'Linked References', ''); // Dialog "Linked References" can not be edited
    seev(e, 'Linked References', null); // FRUITLESS

I can't even read them.

    // nope    geev(e, 'XLKR\0\Keyword');    geev(e, 'Linked References\XLKR #0\Ref');

I need to be able to check for the presence of Linked References, as well as be able to add them and, crucially, remove them from within my xEdit script.

Link to comment
Share on other sites

If 'e' is a reference type record (REFR, ACHR, etc) record, then

 

Check that Linked References element exists

if ElementExists(e, 'Linked References') then

Getting existing Linked References element

linkedrefs := ElementByPath(e, 'Linked References')

Adding Linked References container to the REFR record, note that it will create a new empty entry inside by default

linkedrefs := Add(e, 'Linked References', True);

Adding a new linked reference entry to the existing container

lref := ElementAssign(linkedrefs, HighInteger, nil, False);

Getting entry by index from linked references container

lref := ElementByIndex(linkedrefs, 5); // index starts from 0

Changing values of particular linked reference

SetElementEditValues(lref, 'Keyword/Ref', 'MinFlareGunStart [KYWD:00157CB8]');
SetElementEditValues(lref, 'Ref', 'PrewarRadioTransmitterREF [REFR:000BA504]');
// or simply
SetElementEditValues(lref, 'Keyword/Ref', '00157CB8');
Link to comment
Share on other sites

  • Recently Browsing   0 members

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