#About using texts and timers in a hammer

1 messages · Page 1 of 1 (latest)

junior solar
#

Is there any way to create a timer via game_text or smth same? I just need a cheap timer if it can exist.

young fable
junior solar
young fable
#

Oh!

#

I actually had that thought a while ago, and came up with an answer in the form of lua_run

#

When it comes to do annoying complicated stuff like this, I just slap a lua_run down and write a small piece of code to do it.

#

game_text seems to not be changable

#

Though I think I know a way to display it using chat

junior solar
junior solar
young fable
#

Technically if you were a mad scientist you could probably string together logic and a bunch of individual numbers on game_text to create a display, but that's silly.

young fable
#

Or area specific?

junior solar
#

Nah, just like electronic clock

young fable
#

So, not the chat box?

junior solar
#

Not really

young fable
#

Maybe I can find a lua thing that essentially does what game_text does.

junior solar
#

Would be fine

young fable
#
#

This has multiple settings.

#

PrintMessage(HUD_PRINTCENTER, 'hello world')

junior solar
young fable
young fable
#

But it cant change internal variables (like the text contents) unless theres a method to output to

#

In the screenshot you can see me using lua_run to print a message to the screen

junior solar
# young fable

This is a text on a screen, I still need it in a current place

young fable
#

Alright, where?

junior solar
#

In some place on map

young fable
#

You mean, floating in 3d space?

junior solar
#

On alarm clock prop for example

junior solar
young fable
#

oh I actually have no idea how to do that.

#

Sounds like lua coding is required.

#

I don't know any easy shortcuts

junior solar
#

That's the problem, I don't know lua at all

young fable
#

What exactly is this timer doing?

#

Is it just cosmetic?

junior solar
young fable
#

Or does it need to be logical?

junior solar
young fable
#

It is technically possible if you make a mechanical clock.

junior solar
#

Like it has current time changing

young fable
#

So like, you take a wheel, put numbers on it, and rig it to rotate.

#

Something like that.

junior solar
#

Thanks for idea

young fable
#

If you want I can construct it and send you a prefab, since it seems really simple

junior solar
#

But I wud try to get it to electronic level

young fable
#

I think my brain understands what needs to be done

#

I've had a eureka moment.

junior solar
young fable
#

But here's the thing.

#

You make it logical by having it be syncronized to a counter/timer that holds the value representing the clock's time.

#

And then using the counter/timer for logic.

young fable
#

If you want it to stop, you stop both.

junior solar
young fable
#

You could even reverse it.

young fable
junior solar
#

Sounds like what I needed

#

But where's to get a counter?

#

And where would it displays?

young fable
#

Looking the exact names up on google gives you the helpful wiki page

young fable
#

See, it doesnt need to output a value to a display because the rotating number wheel would store it in parallel.

#

Since the number wheel is rotating, and mirrors it by being at an angle

#
  1. turn on loop that increments counter
  2. turn on rotation of clock
  3. Both are now synchronized
  4. the clock is the display
  5. the counter is for logic
junior solar
#

That's about wheel solution. What about electronic clock? Could it be done with that entity?

young fable
#

Hmmm. Seems difficult.

junior solar
#

Hehe

young fable
#

Do you have textures for the display?

junior solar
#

Not really

young fable
#

That's probably the first issue lmao

#

Though I think there are sprites for it.

#

My answer would be "you need lua"

junior solar
#

😦

young fable
#

You could also compromise and just make a traditional clock with two hands.

#

That's straighforward.

#

Do you want me to make a analogue clock and send it to you so you can dissect it?

junior solar
#

No if we talking about classic rotating clocks cuz I can figure out by myself how to make it

young fable
#

The number wheel one

#

Same thing basically

junior solar
#

Here's the reason I'm here: I'm mostly needs electronic clock

young fable
#

Hmmmmm.

#

It is possible, but it will be ugly and tedious

#

Like, I can think of some really hacky ways to do it with hammer parts

junior solar
#

It's desirable to make it without using changing vtm :)

young fable
#

vtm?

#

Oh, like texture stuff.

#

I think it's possible.

junior solar
#

That's thelast way I'll go if there would be no other

junior solar
young fable
#

Would you be fine with a wheel-based clock but the numbers glowed?

junior solar
#

It's better to don't use that

young fable
#

UGHHH

#

Is this clock 4 digits?

#

If it's a low amount of digits we can start using more brute force methods.

junior solar
#

Ye, MM:SS; M is mins, S is secs.

#

Maybe even M:SS

junior solar
young fable
#

You could make an event output for individual digit changes.

#

That would leave you with probably 1 timer and 40 outputs to write.

junior solar
#

Oh hell

young fable
#

It doesn't seem too bad.

#

Actually depending on how its made it might need more

junior solar
#

The problem is that gonna load my map

young fable
#

I don't think that would be an issue

#

Many maps have a lot of I/O connections

#

Like I would guess that the average tf2 map has at least 100.

junior solar
young fable
#

Not timers.

#

Outputs.

#

The timer would only exist so the clock could reset.

#

Assuming that's what you want it to do.

junior solar
#

Nah. I mean I need more than one

#

Like up to 10, please don't ask why

#

I'm about timers now

young fable
#

Oh.

#

Why do you need all of those?

#

Oh right you ask-

#

IM ASKING ANYWAY

#

TELL ME

#

I don't know why you'd need so many

junior solar
#

Alr bro I'm sorry I have to sleep

#

See ya later

young fable
#

Aight

junior solar
#

Ye I needed it to let people know when the next train, it should be located at the stations sad
That's the last message I'll send till I gotta sleep
BB

young fable
#

If you want me to come back some other time ping me, I'm letting myself forget this weirdness.

junior solar
#

Im here again and as I see nobody can help

#

sadly

junior solar
young fable
junior solar
#

the doors aren't working as well

#

I'm using filter_name and trigger_mulltiple. in a second one I've used "lock" command

#

can it be angles problem?

young fable
#

For debugging these things, you can type developer 3 in the console to get a text readout of what your circuit is doing

#

That should also tell you if anything happens to go nowhere.

#

Try using that, and then triggering your setup

junior solar
#

yea man, it says doors are opening

#

(58.69) output: (trigger_multiple,) -> (r1rd,Lock,10.0)()
(58.69) output: (trigger_multiple,) -> (r1rd,Unlock)()
(58.69) output: (trigger_multiple,) -> (r1ld,Lock,10.0)()
(58.69) output: (trigger_multiple,) -> (r1ld,Unlock)()
(58.69) output: (trigger_multiple,) -> (r1c3,Resume,12.0)()
(58.69) output: (trigger_multiple,) -> (r1c3,Stop)()
(58.69) input : r1rd.Unlock() (x4)
(58.69) input : r1ld.Unlock() (x4)
(58.69) input : r1c3.Stop()

#

what's the problem then?

young fable
#

How exactly did you use this filter?

#

It would also be appreciated to screenshot the I/O windows

junior solar
#

please hold on a minute

#

r1c3 - tanktrain

#

i'm here

#

where are you?

#

bro I got few mins left

young fable
#

Hm.

#

Are you sure that r1c3 is supposed to go to the tanktrain?

junior solar
#

it's named r1c3

young fable
#

Yes

#

Does r1filt have an output that you can use?

junior solar
#

I'm not sure

young fable
#

I'll just look up the wiki for it I guess

junior solar
#

like I'm using OnTrigger output

young fable
#

filter_activator_name has an output for things that pass

#

Instead of linking it from r1c3 to the tanktrain, try r1filt -> "onpass" -> tanktrain

junior solar
#

I'm using it in trigger_muptiple, in Filter Name string

#

wait bro

#

that's what Im doing

young fable
#

Ohhhhh

#

Sorry, I misunderstood.

junior solar
#

there's an entity filter_activator_name

junior solar
junior solar
young fable
#

Can you screenshot the I/O going from the trigger_multiple to the filter name please?

#

You're using the TestActivator input right?

junior solar
#

no?

young fable
#

How is your trigger multiple communicating with your name filter?

#

Explain maybe?

junior solar
#

all I got

junior solar
#

there's no I/O between multi and filter

young fable
#

Reading these helps.

junior solar
#

oh shoot

young fable
#

The name filter is supposed to rigged like a checkpoint.

junior solar
#

I'm not sure I understood what to do

young fable
#

Rather than a surrogate creature

#

You need to get the trigger to feed the name filter the entity you want to test, and then it will branch into pass or fail

#

Then you link the pass ouput to the input onwards

junior solar
#

da strange thing about that is that one part of trigger works and one doesn't

#

like the doors aren't opens but tanktrain stops

young fable
#

It isn't obvious that it passed the entity, but throughout this process, the original activator of any event is stored and can be read.

#

So the name filter can dig up the root cause of these events, and go "time to test your name, perpetrator!"

junior solar
#

Wait. What the difference between unlock/lock and open/close?

#

What inputs are for func_door?

#

It can be the problem

junior solar
#

There are both options

#

Hmm what does that means?

#

I've used lock and unlock

#

So maybe that's my error, maybe I want to use close/open

#

And maybe there we go

young fable
#

What is your ultimate goal here?

#

To make a security door?

junior solar
#

To make doors opens and closes

junior solar
#

Like I'm making a train

young fable
#

Right, I see.

junior solar
#

That's just the train doors

young fable
#

When do the doors need to open?

junior solar
#

OnTrigger ig

#

Alr lemme turn on my laptop and check the version about open/close

#

Btw why don't you want to chat in DM?

#

Map is compiling, it gotta take a minute to check

young fable
#

Setting compile modes to fast often makes it only a few seconds for me

#

Good for debugging

junior solar
#

Hell yeah

#

That works

young fable
# junior solar OnTrigger ig

You could just have the doors open whenever somebody touches them, and locked whenever the train is about to move

junior solar
#

Next time when someone asks how to make doors closes and opens just tell em to send you multi's outputs

junior solar
#

Wait

#

It's already works and automatic bruh

young fable
#

There exists a simple flag for doors which makes them open when you bump into them

junior solar
#

Nah, that's not exactly what I want

#

Maybe I'll send you the map when I release it

young fable
#

Fair enough, I think I understand why you need the trigger now