Jump to content

Shivering Isles Secret Door script


Recommended Posts

basically I'm making a house mod where all the rooms/storage are hidden behind the SI expansion 'secret walls' found in numerous dungeons. The problem is, the scripts for these doors are one-way only; you can open them, but not close them, atleast until the dungeon resets. Unofrtunately, I'm pretty awful at scripting, thus don't know how to write an appropriate script to do so. (I have enouhg knowledge about scripting to get a rough Idea of what some scripts do, but not enouhg to write my own).

 

The script used for the base secret wall is as follows:

 

scn RuinsTRAPSecretWallSCRIPT

short init
short busy
short open
short next
float timer
ref mySelf
ref myParent

begin onActivate

set mySelf to getSelf
set myParent to getParentRef

if isActionRef player == 0 && isActionRef myself == 0 && busy == 0
	if open == 0
		playgroup forward 0
		set open to 1
		enableLinkedPathPoints
	else
		playgroup backward 1
		set open to 0
		disableLinkedPathPoints
	endif
	set next to 1
	set busy to 1
	set timer to 1
endif

end

begin gameMode

if init == 0
	; set up ref vars
	set mySelf to getSelf
	set myParent to getParentRef
	; prepare linked pathsgrid points
	disableLinkedPathPoints
	set init to 1
endif

; daisy-chain activation
if next == 1 && timer <=0
	set next to 0
	myParent.activate mySelf 1
endif

if isAnimPlaying == 0 && busy == 1
	set busy to 0
endif

if timer > 0
	set timer to timer - getSecondsPassed
endif

end

begin onReset

reset3DState
;set open to 0
set next to 0
set busy to 0
disableLinkedPathPoints

end

 

Could some take the time to explain exactly how this script works and/or what changes I would need to make to make it do what I want?

 

Cheers

Link to comment
Share on other sites

The problem is, the player can't open or close the door. If you take out the condition "isActionRef player == 0", it'll work... But looking in the Construction Set, the doors are only supposed to be opened when you push a button. So, are you trying to activate the door directly, or through the button like in the vanilla game?

 

If you want to do it through the button, you'll need to change the button's script:

 

 

From:

scn RuinsButtonBothDoOnceSCRIPT

; Activates parent immediately & only works once, hence the creative name.

short triggered
ref mySelf
ref myParent

begin onActivate

if triggered == 0
	playgroup forward 0
	set mySelf to getSelf
	set myParent to getParentRef
	myParent.activate mySelf 1
	set triggered to 1
	Player.SetCrimeGold 0
endif

end


begin OnReset

reset3DState
set triggered to 0

end

 

To:

 

scn RuinsButtonBothDoMoreThanOnceSCRIPT

; Activates parent immediately & works more than once.

short triggered
short busy
ref mySelf
ref myParent
float timer

begin onActivate

if (triggered == 0 && busy == 0)
	playgroup forward 0
	set triggered to 1
elseif (triggered == 1 && busy == 0)
	playgroup backward 1
	set triggered to 0
endif

set mySelf to getSelf
set myParent to getParentRef
myParent.activate mySelf 1
set timer to 1
set busy to 1
Player.SetCrimeGold 0

end

Begin GameMode

if (timer > 0)
	set timer to timer - GetSecondsPassed
elseif (timer <= 0)
	set busy to 0
endif


begin OnReset

reset3DState
set triggered to 0

end

 

Edited by fg109
Link to comment
Share on other sites

I suggest you go ingame, find one of these secret walls, and open console.

 

First, type in "playgroup forward 1". Close the console, and you should now see the door open.

 

Now try the same thing, only with "playgroup backward 1". If it does nothing, or something weird, it has no closing animation... which I suspect to be the case.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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