Background for Starfield
Member of the ScriptObject script
varfunctionGetPropertyValue(stringasPropertyName)Native

Description

Wiki Description

Gets the current value of a property on this script by name.

Documentation Comment

Gets the value of a property on this script specified by name. Note that the compiler cannot
check that the property exists. Will error if the property doesn't exist on the object, or
is write-only


Caveats

CK Wiki - Notes

  • If the property name don't exist, the function will error. You may want to check for the existence of the mod you want to talk to before using this.
  • The compiler cannot check the property name for you, so make sure to triple check everything!

Parameters

  1. stringasPropertyName

    CK Wiki Description

    The name of the property


Examples

; Get the value of the "TargetActor" property from the "CombatOverhaul" script
; We use CastAs to make sure we don't depend on the script we want to call the function on
ScriptObject combatScript = FormFromOtherMod.CastAs("CombatOverhaul")
Var result = combatScript.GetPropertyValue("TargetActor")
Actor target = result as Actor
if target
  target.Kill() ; Kill them all!
endIf

Auto-Generated Example

string myString__asPropertyName

var returnedValue = myScriptObject__toCallFunctionOn.GetPropertyValue(myString__asPropertyName)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.