Zorkaz Posted May 9, 2022 Posted May 9, 2022 Could it be that getlinkedref is only working in one direction? I've create an object (ZiplineStart) that spawns another object (ZiplineEnd) From ZiplineStart to ZiplineEnd I can travel using SplineTranslateToRefNode but not vice versa. Any insights? That's the script on the ZiplineEnd Keyword Property Zipline Auto Event OnActivate (ObjectReference AkActionRef) ObjectReference TheOtherLine = GetLinkedRef(Zipline) Game.Getplayer().SplineTranslateToRefNode(TheOtherLine, "SpawnPoint2", 50, 400) EndEvent And that's the script for ZiplineStart Activator Property ZLConnector2 Auto Keyword Property Zipline Auto ObjectReference Property TheLIne Auto Event OnWorkshopObjectPlaced(ObjectReference akReference) TheLine = Self.PlaceAtNode("SpawnPoint", ZLConnector2 , 1, TRUE, FALSE, FALSE, False) Self.Setlinkedref (TheLine, Zipline) EndEvent Event OnActivate (ObjectReference AkActionRef) ObjectReference TheOtherLine = GetLinkedRef(Zipline) Game.Getplayer().SplineTranslateToRefNode(TheOtherLine, "SpawnPoint2", 50, 400) EndEvent Event OnWorkshopObjectDestroyed(ObjectReference akReference) ObjectReference TheOtherLine = GetLinkedRef(Zipline) TheOtherLine.DisableNoWait(false) TheOtherLine.Delete() TheOtherLine.SetLinkedRef(None) EndEvent
DlinnyLag Posted May 10, 2022 Posted May 10, 2022 You can set linkref in both directions explicitly. Self.Setlinkedref (TheLine, Zipline) TheLine.Setlinkedref(Self, Zipline) ; <-- reverse link Moreover, such calls will create you links chain. I.e. Self->TheLine-> Self. This chain can be retrieved by GetLinkedRefChainAnd yes, you will need to clean up linkrefs later
DieFeM Posted May 10, 2022 Posted May 10, 2022 GetLinkedRefChildren( keyword apKeyword ) This function returns an array of the references linked to it with the given keyword. That makes the reverse function to GetLinkedRef, I would say that's what you're looking for.Note that you can link to a reference with a keyword to only one reference, but a reference can be linked form multiple references with the same keyword, like for example workshop references, which are all linked to the workshop with WorshopItemKeyword, and you can get em all with this function: WorkshopRef.GetLinkedRefChildren(WorshopItemKeyword).
Zorkaz Posted May 10, 2022 Author Posted May 10, 2022 Okay, wow, thanks for the extensive info. Will put it into use
Recommended Posts