PDA

View Full Version : A little help with switchable stuff?


Dart Zaidyer
10-13-2003, 02:35 AM
There aren't very many tutorials out there, and the supplied Raven maps don't have such a thing, so I need to know:

I want to create a light and a forcefield you can turn off at the same time with one switch.

I'd also like to know how to create a "wind" effect in a shaft to soften the player's fall, complete with visible wind.

WadeV1589
10-13-2003, 10:40 AM
You need to use one of the forcefield textures the game has and create a func_wall out of it.
Next create the light entity you want with the settings you want.
Make a button, func_usable or func_button or trigger_multiple, however u want to activate/de-activate the forcefield and light.
Finally make sure nothing is selected, then select the button first followed by the light and hit Ctrl+K. De-select everything again, select the button followed by the func_wall (forcefield) and hit Ctrl+K again.

After doing that you should get 2 lines running away from the button, one towards the light and one towards the func_wall.


For the "wind" effect I know to push the player up you'd make a trigger_push covered in the trigger texture pointing (Ctrl+K) to a target _position. You need to set 2 of the spawnflags for the trigger_push to tell it to push you relative to your position and to do it in a linear fashion - just press N after selecting the brush to get the entity window up.....although for the wind my best guess is it's an fx_runner.

If I missed anything out, sorry, just woke up and tired as hell :p

Dart Zaidyer
10-13-2003, 08:04 PM
So far I've got a static switch that deactivates the targeted light and forcefield only once, and then it becomes unusable.

What I need is a switch that visibly changes its' texture and can turn the forcefield and light off and on at an infinite basis.
There's a tutorial to do this with a func_door, would it work the same with the func_wall?

I also need to know the proper syntax to get the switch to make a sound when used, and to get the forcefield make a sound when toggled.

WadeV1589
10-13-2003, 09:20 PM
If you're using a func_usable as the button to activate/deactivate the light and func_wall then you need to set it to ALWAYS_ON with a wait value before it can be used again.


To change the texture on the switch, I'm sure you could do it with GLM's or something...but how about you just put another func_wall in front of the button to make it appear to change texture when in fact it's just making a non solid func_wall appear in front of the button.

Dart Zaidyer
10-14-2003, 12:48 AM
So far, all the methods I've tried either haven't worked very well or not at all, rendering the forcefield and even the breakable grate nearby completely intangible.

WadeV1589
10-14-2003, 11:12 AM
I quickly put this together to see if this is what you wanted, map file and bsp is included http://sgmod.crashespad.com/files/ForceField.zip .
You can test it straight away with /devmap forcefield if you put the pk3 in base.

I'll admit this is not the most efficient way, for example the lights could easily be a light emitting shader. You could also use lightstyles in order to making the light flicker slightly. Hopefully it will show you enough of what you need to get your map working though.

Dart Zaidyer
10-14-2003, 10:10 PM
Got it!

First, I created a usable trigger_multiple directly in front of the switch and targeted it at the light and forcefield.
The switch itself is actually two func_wall entities occupying the exact same space, one for on and one for off. They are each targeted by the trigger_multiple. Since the forcefield starts out as on, the "off" state of the switch is flagged as starting out "off", so it's invisible. Therefore, when you go to use the trigger, the "off" button actually turns on and becomes visible while the "on" button is deactivated and rendered invisible.
Finally, a target_speaker was added with an appropriate sound effect for the usage of the switch. (targeted also by the trigger_multiple.)

The result appears to be a single switch you must press to deactivate a glowing forcefield, complete with appropriate "on" and "off" textures!

WadeV1589
10-14-2003, 10:58 PM
Hope you at least looked at the file I made for ya cuz that's almost exactly what I put in :p

Hope it all goes ok from now on anyhow!

Dart Zaidyer
10-15-2003, 01:02 AM
Yeah, that little map you made did help me to see just how to get it all together.

I've also adapted it for several other situations I thought would have involved scripting, such as a few one-liners from your character whenever you walk into something or try to open a lock without a key. Essentially, I target a trigger with the desired parameters to a target_speaker with the "global" spawnflag enabled so you can't run away from your own speech.

WadeV1589
10-15-2003, 10:39 AM
so you can't run away from your own speech.That's a Quote of the Day :D

Jedi_Vogel
03-01-2004, 02:18 PM
This is ancient, I do realise, but I'm trying the "search before you ask" thing, with little success. Any chance I could see that ZIP file?

That would be fantastic if possible :)

WadeV1589
03-01-2004, 02:37 PM
That zip file died ages ago, unless he kept it...