Enabledisable OnActivate - which is the Activator?

Post » Sat Jun 07, 2014 12:57 pm

Re-posted as it seems to have been buried in a thread.

On a very similar subject I have set up a drawbridge using a few "spare parts" and the retractable bridge Activator + a lever. Setup works perfect except on my drawbridge I have added chains so it looks like something is supporting it, chains hang off a gantry. When drawbridge is open it looks good, but when closed (up) the chains hang supporting nothing. So I thought a simple enable/disable on activate script should do it. I put a reference on 1 chain as the "master" and the other as a "slave" (activate parent setup basically 1 chain takes its enable/disable property from the other) I wrote the script and put it on the lever - chains don't disable/enable. So I put it on the drawbridge, same result no enable/disable on the chains. The script looks fine to me but can't figure out what object to put it on. Help please.

ObjectReference Property myObj01  AutoEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()        If myObj01.IsDisabled()            Enable()        EndIfIf myObj01.IsEnabled()            Disable()EndifEndifEndEvent
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Sun Jun 08, 2014 12:40 am

The two if-statements (IsDisabled and IsEnabled) should be one if-else-statement. As it is now the script checks if the object is disabled, then enables it if it is disabled, checks if it is enabled, and finally disables it if it is enabled.

If(akActionRef == Game.GetPlayer())	If(myObj01.IsDisabled())		Enable()	Else		Disable()	EndIfEndIf
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm


Return to V - Skyrim