Jump to content

Enabling/disabling a fire node with the press of a button?


jamesmorlock

Recommended Posts

I'm making a torture-chamber mod, and so far have been successful at avoiding having to write my own scripts, but I have a very cool idea with fire and need help writing the script to

 

1) Enable the fire at the press of a button if it's disabled

 

2) Disable the fire if it's enabled

 

3) Without sacrificing the fire damage effect

 

Any code you can provide to get me started, or if I can do this without writing a script, is much appreciated.

Link to comment
Share on other sites

What exactly do you mean by "the press of a button"? Do you mean a keyboard button or a switch on the wall, lever, etc?

 

I mean the use of an activator in game. More specifically, the flame node will be under a cage with a prisoner in it, when I press a button on the wall (or pull a lever) the flame node activates, also causing fire damage, then when I press the button again, the flame node deactivates.

Link to comment
Share on other sites

That's easy then. You need an activater, the flame node and a script. Find the flame node and activater you want and make a copy of them by giving them a name you like. Place the copied node and activater into your torture chamber, add a reference ID to the flame node and set it as a persistant reference and initially disabled.

 

Next, create this script:

 

ScriptName [NameYouWantToGiveYourScriptInOneWord]

Short FlameEnableState

Begin OnActivate player

If FlameEnableState == 0
Set FlameEnableState to 1
[FlameNodeRefID].Enable
PlayGroup forward  <= Add this is only if the activater animates when activated
ElseIf FlameEnableState == 1
Set FlameEnableState to 0
[FlameNodeRefID].Disable
PlayGroup backward  <= Add this is only if the activater animates when activated

This one is a bit tricky. If the activater only has one animation (Ayleid pushswitch, for example), it should say "forward". If there are two or more animations (example: lever switch), you must keep "backward".

EndIf

End

 

Save this as an object script and attach it to your activater. Job done!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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