Jump to content

ObjectReference - Getting Type and maybe editing values


Zorkaz

Recommended Posts

What I originally wanted to do (But failed)

I wanted to make a utility gun that could add actor values and keywords to activators and static objects.

Yet MagicEffects currently only allow Actors to be edited and even recognized

 

Question

So is there another way to get what kind of object I'm pointing at in-game, checking what keywords or values it has and maybe even change it?

Link to comment
Share on other sites

  • 3 weeks later...

Sorry I might be misunderstanding it, but you can use the HasKeyword, AddKeyword, RemoveKeyword and GetValue, SetValue functions on ObjectReferences.

ObjectReference Property myObjRef Auto Const
Keyword Property myKeyword Auto Const
ActorValue Property myAV Auto Const

myObjRef.HasKeyword(myKeyword)

myObjRef.GetValue(myAV)

myObjRef.AddKeyword(myKeyword) / myObjRef.RemoveKeyword(myKeyword)

myObjRef.SetValue(myAV, newValue)
Link to comment
Share on other sites

You can also use GetBaseObject to check for type if you know what you're looking for.

Form Base = MyObjectRef.GetBaseObject() 

If Base as Weapon 
    ;MyObjectRef is a weapon, do something 
Elseif Base as Armor 
    ;MyObjectRef is an armor, do something. 
Endif
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...