Jump to content

Home

A little help with switchable stuff?


Dart Zaidyer

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 months later...

Archived

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

×
×
  • Create New...