Open Lock Script

Post » Tue Jun 19, 2012 12:06 am

Whilst trying to come up with an open lock script, I got stuck.

So far I have

Scriptname SIMSUnlockScript extends ActiveMagicEffectObjectReference property target autoObjectReference property doorRef autoActor casterObjectReference casterRefObjectReference doorToOpenfloat xPosfloat yPosfloat zPosEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCaster;casterRef = (caster as ObjectReference)target.Enable()target.MoveTo(caster)xPos = target.GetPositionX()yPos = target.GetPositionY()zPos = target.GetPositionZ()doorToOpen = game.FindClosestReferenceOfType(doorRef, xPos, yPos, zPos, 5)doorToOpen.lock(false)endEVENT

But this doesn't seem to work at all.

So I thought of using http://www.creationkit.com/RegisterForAnimationEvent_-_Form to and then a light projectile like Mage Light, so when a door plays that animation, it unlocks. But I'm not sure where to start there.

Any help would be appreciated.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Tue Jun 19, 2012 12:43 am

I haven't managed to use FindClosestReferenceOfType at all, but I am trying to pass it a Form as it says in the wiki, not an object reference. Are you getting any error in the logs while trying to use an ObjectReference?


As for your script, how do you define target and doorRef?

I have managed to get a working one using FindClosestReferenceOfAnyTypeInList instead, but you have to fill the FormList with a list of doors/whatever that you want to be opened. Check the first script in the first post and then the fourth post if you want to use the place an object approach.

http://www.gamesas.com/topic/1348198-placing-an-activator-with-a-spell-without-a-target-and-findclosestreference-functions-question/


EDIT: Forgot to add the link...
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Tue Jun 19, 2012 5:54 am

I'll move the discussion to your thread, you've got further than me at least :D.
User avatar
Krystal Wilson
 
Posts: 3450
Joined: Wed Jan 17, 2007 9:40 am

Post » Mon Jun 18, 2012 3:16 pm

Locked by OP's request.
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am


Return to V - Skyrim