Help with gauge creation Created 2 weeks ago2019-06-04 19:33:14 UTC by Pharaoh Savage Pharaoh Savage

Created 2 weeks ago2019-06-04 19:33:14 UTC by Pharaoh Savage Pharaoh Savage

Posted 2 weeks ago2019-06-04 19:33:14 UTC Post #342690
Hello!

I'm fairly new when it comes to making maps and using hammer on the original HL/TFC. I've only been playing around with it for a year now. I'm trying to create a gauge, or a loading bar that fills relative to the buttons that activate it. So one button would make it fill a little bit, while the other would make it fill a lot.

Its a bit of a tweak from an idea I saw here. The biggest differences are that:
  • I'm using the version of Hammer that doesn't have outputs and inputs in its properties
  • I don't want the bar to load on a timer. I want it to increase either a little bit or a lot when a button is pushed.
I've never made anything like this before, but I think its a cool idea. I just have no idea how I should go about making it actually work. Maybe a multi-manager?

If anyone has any ideas, I'd love to try them out! I'm not asking anyone to do the work for me... unless you want to ;)
Posted 2 weeks ago2019-06-04 20:23:22 UTC Post #342691
I remember a map that had something similar.

My idea is a high-speed func_train, that stops itself automatically after either 0.05 seconds or 0.10 seconds, depending on the button.
More the time, the more distance the bar will travel.

Now, the way this would be done is not hard, I believe.
You've essentially got 3 main entities: a func_train and two func_buttons. Then you've got peripheral entities that do the logic: two multi_managers and two trigger_relays.

A func_button will trigger a multi_manager, which triggers the train, and the relay. The relay will, after 0.05 seconds, trigger the train, making it stop.
Another func_button will trigger a different multi_manager, which triggers the train, as usual, but this time, a different relay (the one with a 0.10 secs delay).

Essentially, what happens is the following:
If you press button A, the train will start moving, and stop moving after 0.05 seconds and move, say, 8 units. It'll give an effect that you are filling the progress bar with each press.
If you press button B, the train will start moving, and stop moving after 0.10 seconds, and move 16 units. Same effect, but with a bigger fill.

The func_train will have a set of 2 path_corners, and once it reaches the last one, it will halt, and it can then trigger something the moment it hits the end.
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 weeks ago2019-06-05 09:27:31 UTC Post #342694
I think path_corner's "Wait for retrigger" flag can work here. For example, if you have four buttons, you will have five path_corners (one is for starting position, others are for bar levels). Buttons trigger the bar (func_train), the bar moves to next path_corner and waits for retrigger.
Posted 2 weeks ago2019-06-05 10:46:03 UTC Post #342695
That would work too, but would require many path_corners for very precise fills.
Also, how would you handle the button that fills the bar more than the other buttons?
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 weeks ago2019-06-05 11:06:26 UTC Post #342696
I don't know :P
Posted 2 weeks ago2019-06-05 13:23:51 UTC Post #342699
But then again, I haven't even tested what I proposed, so no-one knows if it's gonna really work. :P
Admer456 Admer456Lean, mean, mapping machine :3
Posted 2 weeks ago2019-06-05 22:51:39 UTC Post #342700
This is from a Zombie Panic! Source map I made years ago.

Each "tick" (white brush) is a "func_brush" with a different name. At the beginning of the round, I call the "Color" input on all of them with the red color to tell "0%". There are 10 ticks so one tick = 10%, when the objective would reach 10%, I call the "Color" input on the first tick in green and I would repeat for the next tick every 10%.

A potential GoldSrc equivalent of this system would be to use "func_wall" instead of "func_brush", "env_render" instead of "Color" input and a "multi_manager" to replace Source's I/O system.
Shepard62700FR Shepard62700FRHalf-Cat is watching...
Posted 1 week ago2019-06-09 18:47:04 UTC Post #342716
Thank you all for the input! I'm going to play around with some of these ideas when I get a chance - I'll let you know if any of them work out!
You must be logged in to post a response.