Jump to content

Reading a variable property from a non-quest object


LittleBaron

Recommended Posts

Hello & thanks for reading about my scripting problem / question...

 

I need to grab an integer property variable from 36 different activator items that all use the same script. I have tried understanding this wiki page : Variables and Properties. I think if I was trying to grab variables from a QUEST I could fudge my way through it, but I am not and I am also apparently not bright enough to understand how to convert the example scripts for use with something other than a Quest. The wiki page seems to suggest at some point that you should be able to grab property variables from 'any' script but I don't get how to do it.

 

I would be much obliged to anyone who could post an example script showing how to read an integer property value from some other activator/script. Many thanks in advance!

 

LB

Link to comment
Share on other sites

Under Warnings, an example is given on how to retrieve a value from a non-quest script.

 

There are two ways that this can be done. It works the same way as importing a quest script since a quest is also treated like an object:

; NOTE: Define only the needed property
ObjectReference property scriptParent auto
MainScript property myScript auto

; Retrieve int from a references script by casting
(scriptParent as MainScript).myInteger

; Retrieve int directly from the references script
myScript.myInteger

 

If there are 36 activators with similar integer property names, an array of scripts can be created to simplify access:

MainScript[] property myScript auto

Edited by Enter_77
Link to comment
Share on other sites

  • Recently Browsing   0 members

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