Triggering blocks Created 5 years ago2019-05-12 14:10:55 UTC by stertyr stertyr

Created 5 years ago2019-05-12 14:10:55 UTC by stertyr stertyr

Posted 5 years ago2019-05-12 14:10:55 UTC Post #342605
Hello

Is there any way to trigger blocks?
My concept op map is to make the whole map with grey brick. I need to colllect colored bricks to make this map colored with 8 colors. So lets say first I need to find red cube which will activate 1/8 of the map with red color. Do you have any idea how to make it? Is it even possible? There could be like only 32-unit cubes which map is build from(also rooms etc). Then I find red cube which activates red cubes to appear on the map instead of those grey. Dunno if func_ like that exists. Also what if I make those color cubes textures with lights.rad. Will the light also appear with blocks?
Posted 5 years ago2019-05-12 15:06:34 UTC Post #342607
You can make those cubes using func_wall_toggle to turn them on, and render mode color with a render color set to have a single uniform color.
Posted 5 years ago2019-05-12 23:39:01 UTC Post #342609
ok but how to activate func_wall_toggle? I mean in game
Posted 5 years ago2019-05-13 03:53:05 UTC Post #342610
There's lots of ways to trigger entities in the way you're looking to do it. For this, I'd probably use either a func_button or a trigger_once.
func_button is, well, a button, which you press with the 'use' key ingame to have it trigger something. trigger_once is a zone which triggers something when you enter it (the zone is invisible). Both entities have a "Target" attribute, which should have the name of the func_wall_toggle in.

There's more detailed tutorials on this very site if you need to know more about the basics of working with entities.
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-13 14:53:08 UTC Post #342611
Ok thank you. But do you know how to make the first cube disapear? I mean like let's say there is one 32x32 grey cube, when I enter with my character to trigger_once block it should trigger func_wall_toggle to make red cube appear on it's place. But how to make the grye cube disapear? Something like on this video, when they are bhoping one block disapers and one apears: https://www.youtube.com/watch?v=P5ECGsLiW58 (but you can see still "shadow" of the block, its propably func_ilusionary but I don't want this effect).
Posted 5 years ago2019-05-13 22:27:06 UTC Post #342612
Well, you could make the grey cube a func_wall_toggle as well, one that starts visible. If you trigger it at the same time as the red cube, it'll give the appearance of the cube changing.
To trigger it at the same time, you can give the grey cube the same name as the red cube. When you enter your trigger_once, it'll target everything with that name.
Alternatively, if you wanted finer control, or to add other effects or so on, you could use a multi_manager. That would let you target the cubes individually at set times, along with other sound effects and sprites or whatever else you might like to spice the effect up (if you wanted those). You can check out Tutorial: Multi_Manager for info on how to use that.
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-15 10:12:11 UTC Post #342618
That is working but how to make it turn-on lighting textures? I mean the light is visible before I even toggle it.
Posted 5 years ago2019-05-15 10:43:45 UTC Post #342619
Making texture lights toggleable is a bit more complex, but quite doable. Check out this example map.
Loading embedded content: Vault Item #1941
The "style" attribute of the func_wall lights is important, as is having a matching light entity.
There might be a more specific tutorial or forum thread somewhere on TWHL. If you're having trouble with it, try using the search to find more info.
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-15 11:45:22 UTC Post #342620
It might be working but since I want to divide map with like more than 5000 32x32 blocks I can't make 5000 light entities. Is there any possibility to not use light entity? Just lights.rad ?
Posted 5 years ago2019-05-15 15:29:30 UTC Post #342621
I think the tutorial Jessie posted is the old way of doing switchable texture lights. Nowadays, with Vluzacn's Half-Life Tools, you can get a better result when you use the light_surface entity.

Quote from VHLT version 23:

Provide a convenient way of creating texture lights.
Usage: Place a light_surface entity near the face which you want to emit light.
'Texture name' shall be the name of texture of the face.
'Filter max distance' can exclude faces whose centers are far from this light_surface.
'Texture brightness' is the brightness value that the face obtains. 80 is enough to ensure brightness of the texture itself.
'Inner angle' and 'Outer angle' are 90 and 'Adjust emit scale' is 1.0 for normal texture lights by default. Smaller angle and larget scale can be used to simulate spotlight.
'Fast' is useful when the face is large and brightness is low. The result of fast lighting is very similar to bounce lighting.
The light_surface can be triggered and have appearance like other light entities. Actually its classname will be changed to 'light' or 'light_spot' according to your choice.
Note: If you want to set any of these value to 0, fill in 0.0 instead. Otherwise Hammer will ignore the keyvalue.
Posted 5 years ago2019-05-15 15:49:54 UTC Post #342622
@The Mad Carrot

Thank you for response
I am mapping with Quake Army Knife, I wonder if it's possible to add this entity to this program.
Posted 5 years ago2019-05-15 16:36:44 UTC Post #342623
QuArK has an FGD converter, I believe. So just download VHLT v34, and convert its FGD. :D
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 years ago2019-05-15 20:27:47 UTC Post #342624
The Mad Carrot said:I think the tutorial Jessie posted is the old way of doing switchable texture lights. Nowadays, with Vluzacn's Half-Life Tools, you can get a better result when you use the light_surface entity.
Oh, cool, I didn't know about this! That sounds much simpler and more flexible.
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-17 09:06:01 UTC Post #342629
Guys take a look at 1:45 of this video:
https://www.youtube.com/watch?v=BfhBm6be7WM
Seems this is texture lighting, I guess it's done the way The Mad Carrot suggested?
Posted 5 years ago2019-05-17 13:03:11 UTC Post #342630
Seems this is texture lighting, I guess it's done the way The Mad Carrot suggested?
Certainly looks like it.
Posted 5 years ago2019-05-18 05:14:39 UTC Post #342631
I imagine the method I suggested and the one TMC suggested are pretty much the same thing done in different ways (though I'd use TMC's).
I'm, uh, curious about the 5000 blocks thing you mentioned though. That sounds... impractical. Could you detail exactly what you're trying to do there?
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-19 13:35:25 UTC Post #342633
I have done a sample of my map which you can check: https://www.sendspace.com/file/e7nqwl
It's for counter-strike
Really time-consuming map. Everything is done with 32x32 blocks. I wonder how to make those small collectable blocks dissapear after "collecting" them, i guess I need to make them also func_wall_toggle. Also I wonder how to add sound when collecting them, I think its multimanager you suggested to me Jessie.

I had to cover whole map with box because it says there is a leak. Its propably because everything was an entity.

So I want to make kreedz/bhop map like that where you have to find color so the whole map will change. I am not sure if it's worth try, I mean if everything will be fine and won't be laggy. There will be many blocks included in func_wall_toggle.
There is only func_wall_toggle and trigger_once for each color.
Any ways of suggesting how to improove it or is it fine?
Posted 5 years ago2019-05-24 16:51:42 UTC Post #342648
I have found another problem. Whenever I restart round with sv_restart 1 command, then the blocks aren't resetting to theirs initial position.
Posted 5 years ago2019-05-25 00:37:52 UTC Post #342650
To make those blocks disappear after collecting them, yes, I'd make them a func_wall_toggle and trigger them along with the wall blocks. A multi_manager would help with that, as well as for adding sounds.
If your walls are entirely made of entities, then yes, you will have to have a non-entity brush sealing them off from the void. I'd keep that brush up against the walls (that is, don't just drag a big ol' box around everything) so that you're not wasting any resources.

For what you seem to be going for, what you've got going at the moment is probably the ideal way to do it. However, when the walls are made up of so many separate brushes, you might run into framerate issues. I'm not really knowledgeable about how much you can cram into goldsrc before you start running into that on modern computers, but if you enter r_speeds 1 and developer 1, you'll see that even in that small, rectangular room, you're hitting over 2000 wpolys (which is quite a lot). If, when you're building your map proper, you start to run into poor framerate, you'll probably have to make some changes. I'd definitely put the null texture on any faces you can't see if you're not doing that already, since that will help ensure the engine isn't trying to render things it can't see.
If that isn't enough, you could make your blocks bigger, or design the levels such that areas you aren't looking at as much are made of a neutrally coloured block texture that doesn't have to change (and thus are not made up of small blocks). Exactly what you do is up to you, and with luck, it won't be a problem either way.

As for things that happen on a round reset, I can't help much there, as I don't map for CS. You're definitely not the first person to have that kind of trouble though, so maybe try searching the site. I'm sure that info is on here somewhere.
Jessie JessieTrans Rights <3
Posted 5 years ago2019-05-25 01:12:16 UTC Post #342651
Thank you for answer.
Gotta test it then with these commands.
I already used null texture, so that should help a little. I think of doing small rooms instead of big ones, so maybe that won't cause fps drops.

I have tried to search over internet and I even asked some really good and experienced kreedz mappers, but no one knew how to make func_wall_toggle restart. I managed to do it with one way. I changed trigger_once to func_door and that's seems to be working. However there is another problem. It causes light_surface to switch on, on sv_restart 1. For the first round it's fine, I can toggle both blocks and light_surface, but after restart blocks are back to initial position, so that's fine, but light_surface is already on.

And also when I make func_door movable then When it back's to position light's go off. Making it non-movable is working but if it's gonna be bhop map then there is a problem without moving blocks.
You must be logged in to post a response.