Making a prop change size constantly.

Ermac

L1: Registered
Aug 5, 2014
13
0
I need to have a prop in my map change size constantly back and forth, any ideas how I would go about doing this?
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
You could create a vertex animation for that and recompile the prop.
 
Mar 23, 2013
1,013
347
You could create a vertex animation for that and recompile the prop.

Why so complicated? I thought TF2 has an input for that

"SetModelScale <string> Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over."

So just give a prop_dynamic the SetModelScale Input with a parameter of "2 5" this should inflate the model to trice the size in 5 seconds. I expect colision to be buggy though! It might not scale at all.
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
That does work and I did think about Source-wise model scaling, but I'm really really sure that it doesn't interpolate between the sizes.
 
May 25, 2015
390
307
You could have a math_counter with min 1 and max how many times bigger you want the model to be, let's say 2 for this example. You can then have a logic_timer with a refiring rate of 0.01 seconds that adds 0.01 to the math_counter. The math_counter would then fire the SetModelScale input to the prop_dynamic using the OutValue output and an empty value.
Then you can have another logic_timer that subtracts 0.01 every 0.01 seconds that's enabled when the math_counter hits max, while also disabling the first logic_timer.
 
Mar 23, 2013
1,013
347
Scale change is instant.

From VDC prop_dynamic page:

So if you want a smooth animation youll have to make an animated model.

But you forgot another quote from that website:

Model Scale modelscale <float> A multiplier for the size of the model. As an input, it takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over.

Setting this can cause the game to hang for ten seconds at the start of and in between rounds in a TF2 Special Delivery map. Using a logic_relay to set the scale after a delay seems to prevent this.

This is also what hammer says. Well, all you can do is test if it works as the wiki describes it.

Personally I wouldn't use Dr. Orange's idea. Wouldn't it cause a lot more traffic on the server since he has to update the model 100 times a second to ever player? :s You could do it on a smaller scope, but it wouldn't look as good and of course wouldn't be the most efficient method but could be an option if the input doesn't work as it is intended and you really don't want to look into adding an animation for the model
 

Tumby

aa
May 12, 2013
1,084
1,192
The model scale input does in fact work as sd_doomsday_event uses it to make the cool effects when the hammer hits the button after somebody won the round.
The only problem I see is that the model grows and shrinks at a constant speed and therefore switches between the two instantly, aka not smoothly. [being all mathematical: The first derivative of the size as a function of time is not continuous.]
To make it smooth you will need to make actual animations. And not vertex animations as Crowbar suggested, because you can't use them in from hammer.
And maybe Dr. Orange's suggestion can be taken a step further to create a sinewave-ish function which would have maximum smoothness, but that hypothesis needs to be tested by a smart person.
 

Freyja

aa
Jul 31, 2009
2,994
5,813
What makes you think you can't use vertex animations in hammer? A vertex animated model doesn't matter because the model compiler adds a bone anyway. Then it's treated like any other model animation that can be activated via inputs
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Pertinent question: Is this model going to be inside the field of play, where players can potentially get stuck inside it when it grows past their hitbox?