Jump to content

I really need help with a Timer Script


FuzeTek

Recommended Posts

Hey guys, Ive been messing with this for hours, check the Bethsoft useful scripts and searched the forums and I cant find anything that gives me what I want.

Basically I'm making an airlock, where you open the door, walk in and push a button. the door behind you closes, it enables steam jets for 10 seconds then disables them and set the door in front of you to openstate 1.

If anybody could please help me with this I would greatly appreciate it.

Here's the Script I'm currently using

 

 

 

ScriptName Bio2DeconTest01

float timer

 

begin onactivate

activate

set timer to 3

 

if timer < 1;

elseif Timer < 2;After One second, do the following

LabDeconSprayREF01.enable

LabDeconSprayREF02.enable

LabDeconSprayREF03.enable

LabDeconSprayREF04.enable

LabDeconSprayREF05.enable

LabDeconSprayREF06.enable

DeconDoorREF01.SetOpenState 0

elseif timer >15

;donothing

Endif

 

if Timer < 15

LabDeconSprayREF01.disable

LabDeconSprayREF02.disable

LabDeconSprayREF03.disable

LabDeconSprayREF04.disable

LabDeconSprayREF05.disable

LabDeconSprayREF06.disable

DeconDoorREF02.SetOpenState 1

Endif

End

Link to comment
Share on other sites

Try this script. I may not work exactly like you want straight out of the box, but it should get you started.

 

 

Scriptname Bio2DeconTestA

 

;I hope this works for you, you may have to play with it

;a little to get it just right---Death01.

 

;This is a object script

;Use this script on the switch activator, and make sure

;both doors have "Persistant Reference" checked.

 

;Effects references used here are checked as

;"Persistant Reference" and "Intially Disabled".

 

float showertime

short shutoff

 

;-------------GameMode Block START

 

;You need to run the timer in a game mode block and

;use the getsecondspassed function to count down.

;The shutoff short is used like a flip-flop to shut/open doors

;and turn effects on and off checking.

 

Begin GameMode

if shutoff == 1

if showertime > 0

set showertime to showertime - getSecondsPassed

elseif GetOpenState == 1 ; if shower still on

SetOpenState 0 ; shutoff the shower

LabDeconSprayREF01.disable

LabDeconSprayREF02.disable

LabDeconSprayREF03.disable

LabDeconSprayREF04.disable

LabDeconSprayREF05.disable

LabDeconSprayREF06.disable

DeconDoorREF02.SetOpenState 1

set shutoff to 0

endif

endif

End

 

;-------------GameMode Block STOP

 

;-------------OnActivate Block START

 

;activator section of script

;plus the set statement for the timer

 

Begin OnActivate

if (GetOpenState == 1 || GetOpenState == 3) ;checks state of switch

if GetOpenState == 3

set showertime to 10

set shutoff to 1

DeconDoorREF01.SetOpenState 0

DeconDoorREF02.SetOpenState 0

LabDeconSprayREF01.enable

LabDeconSprayREF02.enable

LabDeconSprayREF03.enable

LabDeconSprayREF04.enable

LabDeconSprayREF05.enable

LabDeconSprayREF06.enable

Else

LabDeconSprayREF01.disable

LabDeconSprayREF02.disable

LabDeconSprayREF03.disable

LabDeconSprayREF04.disable

LabDeconSprayREF05.disable

LabDeconSprayREF06.disable

DeconDoorREF02.SetOpenState 1

endif

Activate

endif

End

;-------------OnActivate Block STOP

Edited by Death01
Link to comment
Share on other sites

@Death01

Wow man this is way past my knowledge base. I tried it as is and it causes the activator button to do nothing at all.

As of late this is the first script Ive ever tried that had timers or getopenstates. I have a headache : /

Resident Evil 2 will be the death of me I swear.

Link to comment
Share on other sites

At least the doors should have opened and closed correctly....it was the effects I was

uncertain about.

 

Two lines in the script didn't work...i took them out and made a short mod for testing.

 

No great bells or whistles, it just does what you wanted in the simplest terms.

You can load it up in the CS and pick at the esp at your own pace, and see just

how things were done. Pay close attention to the reference flags set on the doors and

the spray FX.

 

I've included the mod esp as an attachment. To use it:

 

1.download/extract it and put it in your fallout 3 data folder.

2. put a check by "biodecontest" in data files.

3. load your game. hit the tithe key to bring up console, and type

 

coc biodecon

 

4.hit enter

 

Study the link blove posted, and here's a couple more:

 

http://modsreloaded.com/fallout3-modding-guide-t670.html

http://geck.bethsoft.com/index.php/Help:Welcome_to_the_Wiki

http://cs.elderscrolls.com/constwiki/index.php/Main_Page

 

Yeah, i know the last one's a TES4 link, but most of the scripting is the same,

and Oblivion's been around for a lot longer, so there's more info in some cases.

 

And above all, take 2 aspirin, and DON'T PANIC. :thumbsup:

 

Attachment:

Edited by Death01
Link to comment
Share on other sites

Hey, It works perfectly, I am extremely Happy. thank you very much, I'm adding you to my Credits for sure.

Be sure to check out the status of my mod if your a Resident Evil fan.

 

I've taken Excedrin Migraine, I'm calm ^_^ I find scripting a lot more difficult than learning 3d Modeling

 

Thanx again for the help and the links!

Link to comment
Share on other sites

Hello. I just wanted to take the time to extend my thanks to the both of you, as you've both helped answer a few questions I've had regarding timer scripts. Now I don't mean to take over this topic with my own questions, but how could you remove rads through the use of a script? This is all nice aesthetically, but actually removing rads would be a benefit as well.

 

- Quadratomic

 

Edit: Never mind. I wasn't thinking too clearly when I typed that out. Just went into the My First Infirmary script and found it: "player.RestoreAV RadiationRads 1000000"

Edited by Quadratomic
Link to comment
Share on other sites

just BEFORE the "Else" in the OnActivate Block, add these to lines for removing rads;

 

player.RestoreAV RadiationRads 1000000

Showmessage HD00InfirmaryRadsMessage

 

oh, BTW, anyone who wants to use the script or mod i've posted, don't bother me

with asking, just take it! :yes:

Edited by Death01
Link to comment
Share on other sites

  • Recently Browsing   0 members

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