Jump to content

Detoxification Room - Scripting Help


KnowMadic

Recommended Posts

Okay for my new mod I've decided to make the entrance room a detoxification room that when you enter the door to the base is locked and must be opened using a terminal. When you access the terminal you will have the option to "Begin detox" after selecting that the room gets flooded with gas and the Klaxon lights go off and after 3-5 seconds it all stops and the door to the vault opens. I know this is a handful to ask for and I will reward kudos and a place in the credit section of my mod.

 

What I need:

Make the door only operable by using the terminal.

Make the Klaxon lights turn off after 4 seconds (Use script I provided)

Make the room filled with gas (FXHeliosSteam) for 4 seconds

Make the door unlocked after 4 seconds

*Maybe* Make the player have the withdraw effect screen (Where you kinda fade a little and your vision is blurred) during the gassing

 

Klaxon Light Script

scn KlaxonLightsScript

short state		; 0 = off, 1 = flashing

begin OnLoad
if state == 1
	playgroup left 0
endif
end

begin onActivate
if state == 1
	set state to 0
	playgroup backward 0
else
	set state to 1
	playgroup forward 1
endif
end

begin gamemode
if state == 1
	if isAnimPlaying == 0
		playgroup left 0
	endif
endif
end

I don't require you to solve all of those at once, any little bit helps.

Edited by KnowMadic
Link to comment
Share on other sites

Well I hope you have some success because this idea sounds awesome.

Some tips: Never 'delay' a player for visual effect reasons, Its cool the first time, its cool the second time, its annoying as hell the 100th time. Add in a console they can hack to 'bypass decontamination', for whatever lore reason you want (You suspect the decontamination is not really doing YOU any good, who cares about <Whoever it was protecting>)

 

Second, I think you might want something like

float x

int state

if state < 10

set x to x + getsecondspassed

endif

if (x > 4)

set state to state + 1

set x to 0

if state == 0

dostuff

endif

(more ifstate == somethings)

 

 

endif

 

It will increment state untill state gets to 10, every 4 seconds. if you want to just do something once, do it during one state and increment the state after its done, without waiting for the next 'timer'

 

 

PS: Make sure to have a 'doonce' var that calls getsecondspassed for no real reason the first time your script runs, it seems to need to be called once as it will return a huge value on its first call (since its never been called before?)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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