LittleBaron Posted November 24, 2012 Posted November 24, 2012 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
EnterSevenSeven Posted November 24, 2012 Posted November 24, 2012 (edited) 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 November 24, 2012 by Enter_77
LittleBaron Posted November 25, 2012 Author Posted November 25, 2012 Thank you! I will try it out. +Kudo
Recommended Posts