Jump to content

Help with a simple script on DLC2DwePtnWallAnim01


crgobi

Recommended Posts

DLC2DwePtnWallAnim01 is an animated section of dwemer partition that raises up from the floor. I'm attempting to make it so that when you pull a lever it goes up if it's in the down position, and vice versa. The problem I'm having is that it will go up once, down once, and then stops working entirely. I can't see why it wouldn't continue to animate based on the script. I would appreciate any help with this. :ermm:

 

The animated wall section is connected via activate parent to a vanilla dwemer lever. The script on the wall is as follows:

bool property startsUp = false auto
bool property isUp = false auto hidden

Event OnCellAttach()
	if startsUp == true
		playAnimation("stage1")
		isUp = true
	endif
EndEvent

Event onActivate(ObjectReference akActionRef)
	if isUp == false
		playAnimation("stage1")
		isUp = true
	elseif isUp == true
		playAnimation("stage2")
		isUp = false
	endif
EndEvent

I'm guessing it might have something to do with the animations this object has rather than the script, because from what I can see there should be no reason why you couldn't pull the lever indefinitely to raise and lower the wall.

Link to comment
Share on other sites

Looks to me like it should work, so my tidbits are going to be of limited value.

 

You could try adding some debug.notification() lines to make sure the variables are being set as you expect them to be. e.g., after if isUp == false, add debug.notifcation("isUp = false").

 

 

Also, you could try PlayAnimationAndWait instead of PlayAnimation. If it really is a problem with the animation not ending, you will know it because the object won't activate at all after that. The script will be busy.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
I suspect that setting "isUp = true", followed by "elseif isUp == true" is the problem. That will cause the "down" animation to play when you don't want it to. Just replace "elseif isUp == true" with "else".
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...