Any way to read an property of an ObjectReference?

Post » Tue Nov 20, 2012 11:10 am

I create an ObjectReference from an base object who contain scripts and properties,
the created object
Scriptname activatorscript extends ObjectReference int property isactivated=0 AutoEvent OnActivate ( ObjectReference akActionRef)	 isactivated=1Endevnt
Pretty simple.

Now the object who create the activator, this is craftable and placeable so I can not hardcode any links.
Scriptname basecript extends ObjectReference ObjectReference property activatorref Autoactivator  property myactivator Autofunction createactivator()	    activatorref=Placeatme(myactivator) endfunctionfunction checkstatus()    if activatorref.isactivated==1	    ;do stuff   endifendfunction
My problem is the
 if activatorref.isactivated==1 
who does not work
any tips, is this even workable?
User avatar
Shelby McDonald
 
Posts: 3497
Joined: Sat Jan 13, 2007 2:29 pm

Post » Tue Nov 20, 2012 2:16 pm

Hello, this is because ActivatorRef is of type ObjectReference rather than ActivatorScript. Either change the property's type or use this:
if (ActivatorRef as ActivatorScript).isActivated == 1
User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm

Post » Tue Nov 20, 2012 10:58 am

thanks, will check it out :)
User avatar
Katey Meyer
 
Posts: 3464
Joined: Sat Dec 30, 2006 10:14 pm


Return to V - Skyrim