Need help with script - GetLinkedRef

Post » Tue Apr 02, 2013 12:52 pm

Hey guys, I usually try to slog scripting issues out but this one isn't going anywhere with GetLinkedRef(). Here's what I want to do:

I have an object. 3 other (unique) objects are linked to this main object by using the Linked Ref tab in the Reference window, and selecting the main object. Each of these has a unique keyword on the base object. No keyword is set in the link itself. My script needs to randomly choose one of these 3 objects and force it into an alias, and then enable it. My overall quest does this by filling aliases from the main linked parent, and selecting aliases from that at random. This one however is tricky because the marker itself doesn't fill an alias until it itself is selected at random from 4 other markers.

Here is my script. I think I might just be using the GetLinkedRef() function wrong. Can anyone help? :smile:

Function SecondClue()	; This section chooses which second clue will be enabled	ObjectReference ClueRef01 = AnimalMarkerMain.GetReference().GetLinkedRef(HISAnimalHuntClue0201)	ObjectReference ClueRef02 = AnimalMarkerMain.GetReference().GetLinkedRef(HISAnimalHuntClue0202)	ObjectReference ClueRef03 = AnimalMarkerMain.GetReference().GetLinkedRef(HISAnimalHuntClue0203)	TargetClue2Index = Utility.RandomInt(iMinClue02, iMaxClue02)	if (TargetClue2Index == 1)		TargetSecondClueAct = ClueRef01		Debug.MessageBox("Second Clue Chose = 1")	elseif (TargetClue2Index == 2)		TargetSecondClueAct = ClueRef02		Debug.MessageBox("Second Clue Chose = 2")	elseif (TargetClue2Index == 3)		TargetSecondClueAct = ClueRef03		Debug.MessageBox("Second Clue Chose = 3")	endif	Clue02.ForceRefTo(TargetSecondClueAct)	Clue02.GetReference().Enable()		; sets the clue number to the global variable for conditions	myClue2Global.SetValue(TargetClueIndex)EndFunction

I have tried setting a keyword in the link to and that didn't work.

SQV shows the alias Clue02 = none, and TargetSecondClueAct in the script = none.
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Return to V - Skyrim