Help - Search - Members - Calendar
Full Version: Trigger happy
Unknown Worlds Forums > Natural Selection > Natural Selection Creation > Mapping Forum > Mapping Help and Troubleshooting
schkorpio
Its me again tounge.gif

I'm trying to make a button which can be deactivated by destroying a func_breakable next to the button. however with not much luck.
I've tried doing it like this

Func_button, "Master" value pointing at a multisource entity
Now the button should function as normal, and when the nearby func_breakable is destroyed it switches off the master (multisource entity) therefore locking the button.



my problem is that the button starts locked, and when you destory the func_breakable it unlocks the button - which is the exact opposite of what i'm trying to achieve lol.

How would I make the button unlocked to begin with ? smile-fix.gif (btw it doesnt need to b ea button, just something that can be triggered multiple times until the breakable is destroyed)

I've tried playing with relays and such, but its not looking good so far :S
Of course i can always hide the button behide a door and then have the door close once the breakable is destroyed, but its not very elegant.
schkorpio
I think I may have figured it out - I'm away from my pc which has steam installed so I can map but not test sad-fix.gif

Can I use a trigger once, which triggers a trigger_relay to set the multisource to on? or will that just mean it will only do 1/2 of the job, as in i'll still need to destroy the breakable and trigger the trigger_once for it to do it. :s confused.

IPB Image

The idea being that the player walks through the trigger_once, and which goes thru the relay which turns the multisource ON, making the button active.
Then if the breakable is broken it triggers the second relay which turns the multisource OFF making the button inactive - i could also have it kill target the first relay so that if the breakable is destroyed before the button cannot be re-enabled.

Any one know if this might work?
Faskalia
QUOTE(schkorpio @ Aug 7 2007, 01:53 AM) [snapback]1642444[/snapback]

The idea being that the player walks through the trigger_once, and which goes thru the relay which turns the multisource ON, making the button active.
Then if the breakable is broken it triggers the second relay which turns the multisource OFF making the button inactive - i could also have it kill target the first relay so that if the breakable is destroyed before the button cannot be re-enabled.

Any one know if this might work?


I have no real mapping experience, so this is just a guess:

Why not make 2 glass shields, that encase the button? (think like the nuke button hl, except that there are 2 shields)
When you walk through the trigger_once the glass shield retracts, allowing access to the button.
When the breakable gets broken the 2nd glass shield (which has been retracted the whole time) will encase the button sealing access off.

As already said: I have no idea how feasible this is.
Kouji_San
Just use the multisource as it was intended ^_^ it's basically an AND switch. You can use it like this.

If func_button AND func_breakable are, active trigger the multisource.

Also I vaguely remember there being a problem with the func_breakable not resetting properly when a new round starts. Meaning if you break it once during round 1, it will still be broken in the second round...

QUOTE(For this I'd use a func_button @ multisource and button_target)


button_target:
- Flags: Start on
- Class info:
-- Target: master

Note:
With these settings it will only be triggered by shooting it, you could then create 2 custom textures like a monitor and a broken monitor. If you shoot it, the broken monitor texture should show. Just give the two texture these names: +0-youtexturename and +a-youtexturename

func_button:
- Flags: whatever you like to use
- Class info:
-- Target: master

multisource:
- Class info:
-- Name: master
-- Target: whatever you want activated by pressing the func_button.

Note 2:
The button_target will start as active, but once it is triggered (by shooting it) it will be inactive, this will result in the multisource not being able to trigger it's target. It needs both the button_target AND the func_button to be active. So once the button_target is inactive, you can press the func_button all you want and nothing will happen.


The only problem I forsee right now is that it will be active again once you shoot it once more tounge.gif I'll have a look at how this is fixable though ^_^



QUOTE(Hmm @ here we go. First the ones from above with a tiny modification (button_target = func_door))

func_door:
- Flags: start open,
- Class info:
-- Name: buttontarget
-- Target: master
-- delay before close: -1
-- Lip: the exact with of the moverange minus 1 to make it instant and perhaps show another texture on a brush inside the func_door
-- Fire on close: buttonmanager
-- Health: whatever you want

func_button:
- Flags: whatever you like to use
- Class info:
-- Target: master

multisource:
- Class info:
-- Name: master
-- Target: whatever you want activated by pressing the func_button.

And add this one:
mulitmanager:
Name: buttonmanager
Target1: buttontarget
optional target2 sound?
optional target3 spark?
optional target3 explosion?
optional target3 shake?

Now if the door is closed it should be deactivated and will also deactivate the mulitsource, I hope biggrin-fix.gif


Note 3:
I'll leave the testing of it to you since I don't feel like it tounge.gif
schkorpio
thank you kind sirs smile-fix.gif

Both solutions did the trick so thank you both biggrin-fix.gif

In my testing I did find a lovely entity called change_target which as you would expect changes another entities target.
So all I did was make it so when the breakable is broken, but buttons target is changed to a env_spark, so when you press the button instead of a door opening, sparks fly out instead ! which adds to the effect of brokenness.

I thought breakables did come back each round? oh well we shall soon see biggrin-fix.gif

I can't really test it as my round doesn't seem to end when the hive or cc is dead - guessing i need a proper server to test that.
Kouji_San
Yeah, the change_target is also quite usefull, just make sure you also change the target back with a second change_target to it's original target when the second round starts. You could create a mulimanager to do all this if you have multiple things which need to be reset properly and call that multimanager gamestartedstatus or use the trigger_random reset thingy (go search for trigger_random and see what I mean tounge.gif)
Spawn_of_Chaos97
schkorp: When you test in SP, you probably turn on cheats to allow you to play alone and have the round start, right? Well, as long as cheats are on, neither team can win. If you kill the hive/cc then turn off cheats, the team without their hive/cc will lose and the round will restart.
schkorpio
QUOTE(Spawn_of_Chaos97 @ Aug 9 2007, 07:13 AM) [snapback]1642866[/snapback]

schkorp: When you test in SP, you probably turn on cheats to allow you to play alone and have the round start, right? Well, as long as cheats are on, neither team can win. If you kill the hive/cc then turn off cheats, the team without their hive/cc will lose and the round will restart.


Thank you kind Sir smile-fix.gif
Kouji_San
I recently found a nifty command for it to work without the hassle of turning sv_cheats on and off all the time:

console --> endgame

When testing a map by yourself, the team you are NOT on will lose if you type endgame in the console smile-fix.gif
carioca
interesting now i will play with function since i know how to end the game =D
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.