varx Posted December 5, 2015 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.
zilav Posted December 5, 2015 Posted December 5, 2015 If 'e' is a reference type record (REFR, ACHR, etc) record, then Check that Linked References element existsif ElementExists(e, 'Linked References') thenGetting existing Linked References elementlinkedrefs := ElementByPath(e, 'Linked References')Adding Linked References container to the REFR record, note that it will create a new empty entry inside by defaultlinkedrefs := Add(e, 'Linked References', True);Adding a new linked reference entry to the existing containerlref := ElementAssign(linkedrefs, HighInteger, nil, False);Getting entry by index from linked references containerlref := ElementByIndex(linkedrefs, 5); // index starts from 0Changing values of particular linked referenceSetElementEditValues(lref, 'Keyword/Ref', 'MinFlareGunStart [KYWD:00157CB8]'); SetElementEditValues(lref, 'Ref', 'PrewarRadioTransmitterREF [REFR:000BA504]'); // or simply SetElementEditValues(lref, 'Keyword/Ref', '00157CB8');
varx Posted December 5, 2015 Author 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..?
zilav Posted December 6, 2015 Posted December 6, 2015 On 12/5/2015 at 9:49 PM, varx said: 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');
Recommended Posts