Frostcrag Reborn Hidden Door Switch Script Help!

Post » Thu Sep 08, 2011 10:23 pm

Hi.

I have this (slightly modified) script that was in Frostcrag Reborn. It doesn't properly work, and doesn't work at all if I include a distance check for the player.

Spoiler
scn FrostcragSpireHiddenDoorSCRIPT01ref mySelfref myTargetfloat timershort openshort busyshort dustFallbegin onActivate	set mySelf to getSelf	set myTarget to getParentref	if isActionRef player == 0 && open == 0 ;;open		if busy == 0			mySelf.pms effectshockshield			playgroup forward 0			;;message "open"			FRDoorOpenCloseREF.enable ;;open 			set open to 1			set timer to 1			set busy to 1			return				endif			elseif isActionRef player == 0 && open == 1;;close		 		if busy == 0			set open to 0			;;message "close"			FRDoorOpenCloseREF.disable ;;close			mySelf.pms effectshockshield			playgroup backward 0			set timer to 1			set busy to 1			return			endif	endifendbegin gameMode	if (GetStage DLCFrostcragSpire >= 40) && (FRDoorOpenCloseREF.Getdisabled == 1);;Im disabled therefor outside variable says Im closed and player is close enough then open. There used to be an && (player.GetDistance FRMainGate <=300) check here too, but if I include that it just doesn't work at all.			FRDoorOpenCloseREF.enable			playgroup forward 0	endif	if open == 1 && busy == 1		if timer > 0			set timer to timer - getsecondspassed		elseif timer <= 0 && dustFall == 0			myTarget.activate mySelf 1			set dustFall to 1		endif	endif	if open == 0 && busy == 1		if timer > 0			set timer to timer - getsecondspassed		elseif timer <= 0 && dustFall == 1			myTarget.activate mySelf 1			set dustFall to 0		endif	endif	; Get rid of effect when wall stops moving	if busy == 1 && IsAnimPlaying == 0		mySelf.sms effectshockshield		set busy to 0	endifend


So the problem with the above code is that it doesn't play the effectshockshield, and there is no wait for the timer, the door just opens.

The second script is;

Spoiler
scn FrostcragMainGateSwitchshort activatedshort busyshort frontfloat timerref mySelfref targetrefbegin OnActivateif busy == 0 && front == 0	playgroup forward 1	set front to 1	set busy to 1	set activated to 1	set timer to 3	FRDoorOpenCloseREF.enable;;open	;;message "anim forward"elseif busy == 0 && front == 1	playgroup backward 1	set front to 0	set busy to 1	set activated to 1	set timer to 3	FRDoorOpenCloseREF.disable;;close	;;message "anim backward"endifENDbegin gameMode	if isAnimPlaying == 0 && busy == 1		set busy to 0	endif	if activated == 1		set mySelf to getSelf		set targetref to getParentref		if timer > 0			set timer to timer -getSecondsPassed		endif		if timer <= 0				targetref.activate mySelf 1				set activated to 0		endif	endifEND


This script is attached to a switch which controls the door. When this script runs, the door plays the effectshockshield like it's supposed to, but it doesn't open and close. It just opens (if it's already open it moves back to the closed position, and then proceeds to open).

The first script is a modification of the vanilla script in Frostcrag Reborn. Both scripts seem to contain a redundant dustfall ref, which I presume the BGS guys forgot about.

Any help/advice would be appreciated!
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Return to IV - Oblivion