Liandri
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Liandri

The forum offers unofficial support for UnrealEd users and serves as a comfortable rest-room for a friendly community.
 
HomeLatest imagesRegisterLog in

 

 Triggerable light that stays on for a limited time

Go down 
AuthorMessage
Murphy

Murphy


Posts : 147
Join date : 2008-10-18
Age : 37

Triggerable light that stays on for a limited time Empty
PostSubject: Triggerable light that stays on for a limited time   Triggerable light that stays on for a limited time Icon_minitimeThu Jul 23, 2009 8:53 am

How to create a light that can be turned on that stays on for only a specified amount of time:

First, here is how to create a light that can be switched on and off by pressing Use somewhere (typically in front of a light-switch of an electrical fuse box or whatever):

Place a TriggerLight. Change it's lighting settings to your liking.
Change Object -> InitialState to TriggerToggle.
Change Events -> Tag to SwitchHit (or something else you can remember).

Place a UseTrigger.
Change its Events -> Event to SwitchHit

Now on to making it turn itself off after a certain amount of time (while you can still turn it off manually!):

The TriggerLight has a variable called "RemainOn" which sounds like you could set a time there and it would turn itself off after that time, but it didn't work like that when I tested it. I read it up on UDN and it said this only works with InitialState set to TriggerPound, but that didn't work for me either (it stayed on indefinitely).

So here is the more complicated way (if someone knows a shorter way, please post it!)

Place a TriggerLight. Change it's lighting settings to your liking.
Change Object -> InitialState to TriggerToggle.
Change Events -> Tag to SwitchHit.
(I used two of them in the example map. They are identical except one of them flickers. This just makes it look nicer)

Place a UseTrigger.
Change its Events -> Event to HitSwitch

Place a ScriptedTrigger (Keypoints -> AIScript -> ScriptedSequence -> ScriptedTrigger)
In its properties, under AIScript, add the following Actions:

[0] Action_WAITFOREVENT
HitSwitch.
[1] Action_TriggerEvent
SwitchHit
[1] Action_WAITFORTIMER
The time the light must stay on in seconds (I have 5 in the example map).
[2] Action_TriggerEvent
SwitchHit.
[3] Action_Action_GOTOACTION 0

This creates a switch for a light that only stays on for 5 seconds. You can turn it off with the switch at any time and you can turn it back on at any time, but it will only stay on for max 5 seconds.

Here is an example map (for Killing Floor):
http://rapidshare.com/files/254673290/TriggerLightExample.rom
Back to top Go down
 
Triggerable light that stays on for a limited time
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Liandri :: = Tutorials :: UnrealEngine 2-
Jump to: