varx Posted December 5, 2015 Share Posted December 5, 2015 No syntax I've tried has worked. seev(e, 'Linked References', ''); // Dialog "Linked References" can not be edited seev(e, 'Linked References', null); // FRUITLESSI 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 More sharing options...
zilav Posted December 5, 2015 Share Posted December 5, 2015 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 More sharing options...
varx Posted December 5, 2015 Author Share Posted December 5, 2015 Thanks a lot, that really helps. One thing I don't see is how to just delete the linked references altogether. Is there a delete function, do I set something to a null value, or..? Link to comment Share on other sites More sharing options...
zilav Posted December 6, 2015 Share Posted December 6, 2015 Thanks a lot, that really helps. One thing I don't see is how to just delete the linked references altogether. Is there a delete function, do I set something to a null value, or..? RemoveElement(e, 'Linked References'); Link to comment Share on other sites More sharing options...
varx Posted December 7, 2015 Author Share Posted December 7, 2015 ha, makes perfect sense. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts