GetLinkedRef

From the Fallout3 GECK Wiki
Revision as of 02:13, 13 March 2017 by imported>Jokerine (Added completed script.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

GetLinkedRef gives the reference that is currently linked to the current reference. For example, if a switch opens a door, you can link the switch to the door and if the switch is activated you get the door reference and activate it. It is called on a reference and takes no parameters.

Syntax

[ObjectREF.]GetLinkedRef

Examples

A simple, completed example of a switch script that uses GetLinkedRef is below.

The activator that will hold this script should have an enable parent added to it as its linked ref.

scn SwitchScript

ref MyMarker 

Begin OnActivate

Set MyMarker to GetLinkedRef

    if MyMarker.GetDisabled == 0 ;if marker is enabled...
         PlaySound OBJSwitchButtonB
         MyMarker.Disable

else
         PlaySound OBJSwitchButtonA
         MyMarker.Enable

endif
end


See Also