Declare Property Via Script Issue

Post » Mon Jul 01, 2013 3:48 am

Hey guys, I've been able to set script properties in the script itself before, but I'm really struggling with this one for some reason. I want the placed object to become a script property, so I can delete it when the object with this script attached is also deleted. However The property (when using SHOWVARS with the console) doesn't point to the placed object, and said placed object isn't removed. Any help? :smile:

Spoiler

Activator Property HISTrapActRabbitFork01 AutoMiscObject Property HISTrapMiscRabbit01 AutoObjectReference Property kSupportProp AutoActor Property PlayerREF AutoEvent OnLoad()	SetMotionType(Motion_Keyframed)	Utility.Wait(1.0)	ObjectReference kSupport = Self.PlaceAtMe(HISTrapActRabbitFork01, 1)	kSupport.SetPosition((GetPositionX()), (GetPositionY() - 46.0), (GetPositionZ() - 20.0))	kSupport.SetAngle(-180.0000, -90.0000, 135.0000)	kSupportProp = kSupport	BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef)	if akActionRef == PlayerREF		kSupportProp.Disable()		kSupportProp.Delete()		Disable()		Delete()		PlayerREF.AddItem(HISTrapMiscRabbit01)	endifEndEvent
User avatar
Zosia Cetnar
 
Posts: 3476
Joined: Thu Aug 03, 2006 6:35 am

Post » Sun Jun 30, 2013 5:59 pm

You can write properties? I can't. I think it'd be handy if Bethesda had made properties readable with the Creation Kit, so if you just need to replicate a few properties (with a few differences), it'd be nice, quick and easy.

User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Mon Jul 01, 2013 12:14 am

In the CK right-click on your script and select Edit Properties...

@BBD

I can't really help in it.
But I think you can write this instead and see if it works.
It MIGHT work.

Activator Property HISTrapActRabbitFork01 AutoMiscObject Property HISTrapMiscRabbit01 AutoActor Property PlayerREF AutoEvent OnLoad()	SetMotionType(Motion_Keyframed)	Utility.Wait(1.0)	ObjectReference kSupport = Self.PlaceAtMe(HISTrapActRabbitFork01, 1)	kSupport.SetPosition((GetPositionX()), (GetPositionY() - 46.0), (GetPositionZ() - 20.0))	kSupport.SetAngle(-180.0000, -90.0000, 135.0000)	OnActivate()	BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef)	if akActionRef == PlayerREF		kSupport.Disable()		kSupport.Delete()		Disable()		Delete()		PlayerREF.AddItem(HISTrapMiscRabbit01)	endifEndEvent
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am


Return to V - Skyrim