Jump to content

Rearm Traps?


umdar

Recommended Posts

A trap door is not a trap, its a door. You can close it via script with SetOpenState

 

Thanks for the reply but that doesn't help me a whole lot... do I add this line to the existing one? do I make a new script?

 

(I found auto close script *** http://geck.bethsoft.com/index.php/Useful_Scripts *** but I don't know how to add it into the script I am already using) how would I combine them so that I use the original scn TrapSidewalkGrateSCRIPT but add auto close.

 

Scriptname AutoClosingDoor

 

float doorTimer

short closeDoor

 

Begin GameMode

if closeDoor == 1

if doorTimer > 0

set doorTimer to doorTimer - getSecondsPassed

elseif GetOpenState == 1 ; if the door is still open

SetOpenState 0 ; close the door

set closeDoor to 0

endif

endif

End

 

Begin OnActivate

if GetOpenState == 3 ; if the door is closed

if IsActionRef Player == 0 ; if it should work for the player remove this...

set doorTimer to 5

set closeDoor to 1

endif ; ...and this

endif

Activate

End

 

The script I am using is~

 

scn TrapSidewalkGrateSCRIPT

; this grate swings open when stepped on or activated.

 

;========================================================;

 

short doOnce

 

;========================================================;

 

begin onTriggerEnter

 

if doOnce == 0

playgroup unequip 1

playsound3D TRPTrapdoor

set doOnce to 1

endif

 

end

 

;========================================================;

 

begin onActivate

 

if doOnce == 0

playgroup unequip 1

playsound3D TRPTrapdoor

set doOnce to 1

endif

 

end

Link to comment
Share on other sites

Try this:

 

scn TrapSidewalkGrateSCRIPT
; this grate swings open when stepped on or activated.

;========================================================;

short doOnce
Float Timer

;========================================================;

begin onTriggerEnter

if doOnce == 0
	playgroup unequip 1
	playsound3D TRPTrapdoor
	set doOnce to 1
	Set Timer to 10
endif

end

;========================================================;

begin onactivate

if doOnce == 0
	playgroup unequip 1
	playsound3D TRPTrapdoor
	set doOnce to 1
	Set Timer to 10
endif

end

Begin GameMode
If Timer > 0
	Set Timer to Timer-GetSecondspassed
ElseIf DoOnce == 1
	SetOpenstate 0
	Set DoOnce to 2
EndIf
End

 

I never used playgroup to animate a door before. What object are you using as your trap door?

Also, setup like this, the open then close will only happen once, you will not be able to open it agian. Is that what you want? If you want the whole thing to be repeateable, just change the Set DoOnce to 2 to Set DoOnce to 0 at the bottom of the script.

Link to comment
Share on other sites

Lol never mind... I just used a normal door turn on it's side and used an electrical switch to open and close. Thanks for your help... I will try yours, because my "trap door" looks silly using and shack door.
Link to comment
Share on other sites

Try this:

 

scn TrapSidewalkGrateSCRIPT
; this grate swings open when stepped on or activated.

;========================================================;

short doOnce
Float Timer

;========================================================;

begin onTriggerEnter

if doOnce == 0
	playgroup unequip 1
	playsound3D TRPTrapdoor
	set doOnce to 1
	Set Timer to 10
endif

end

;========================================================;

begin onactivate

if doOnce == 0
	playgroup unequip 1
	playsound3D TRPTrapdoor
	set doOnce to 1
	Set Timer to 10
endif

end

Begin GameMode
If Timer > 0
	Set Timer to Timer-GetSecondspassed
ElseIf DoOnce == 1
	SetOpenstate 0
	Set DoOnce to 2
EndIf
End

 

I never used playgroup to animate a door before. What object are you using as your trap door?

Also, setup like this, the open then close will only happen once, you will not be able to open it agian. Is that what you want? If you want the whole thing to be repeateable, just change the Set DoOnce to 2 to Set DoOnce to 0 at the bottom of the script.

 

 

Nope it didn't work...

 

Scripts: Script 'TrapSidewalkGrateSCRIPT' , line 37:

Syntax Error. Unknown command 'Timer-GetSecondspassed'.

 

Context: DEFAULT

'Yes to all' will disable all warnings for this context.

 

 

**I hit "yes"**

 

 

SCRIPTS: Script 'TrapSidewalkGrateSCRIPT' , line 37:

Syntax Error. Missing expression in set command.

 

 

**then nothing happens, meaning it won't save***

Link to comment
Share on other sites

I guess "Timer-GetSecondspassed" needs to be "Timer - GetSecondspassed" with spaces before and after the minus sign. There also might be an issue with using playgroup to animate the door opening and using SetOpenState to animate its closing. Like I said, I have never used Playgroup to open a door before, so I have no experience with mixing and matching like that. If it doesn't work (but compiles) try either using "playgroup unequip" for the close or "setopenstate 1" for the open.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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