Making a prop change size constantly.

Discussion in 'Mapping Questions & Discussion' started by Ermac, May 18, 2017.

  1. Ermac

    Ermac L1: Registered

    Messages:
    12
    Positive Ratings:
    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?
     
  2. Crowbar

    aa Crowbar perfektoberfest

    Messages:
    1,312
    Positive Ratings:
    888
    You could create a vertex animation for that and recompile the prop.
     
  3. Lampenpam

    Lampenpam L9: Fashionable Member

    Messages:
    668
    Positive Ratings:
    144
    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.
     
    • Agree Agree x 1
  4. Crowbar

    aa Crowbar perfektoberfest

    Messages:
    1,312
    Positive Ratings:
    888
    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.
     
  5. AsG_Alligator

    aa AsG_Alligator trigger_hiss

    Messages:
    297
    Positive Ratings:
    667
    Scale change is instant.

    From VDC prop_dynamic page:

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

    Dr. Orange L6: Sharp Member

    Messages:
    340
    Positive Ratings:
    253
    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.
     
  7. Lampenpam

    Lampenpam L9: Fashionable Member

    Messages:
    668
    Positive Ratings:
    144
    But you forgot another quote from that website:

    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
     
  8. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    891
    Positive Ratings:
    829
    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.
     
  9. Freyja

    aa Freyja Help I'm trapped in this post

    Messages:
    2,684
    Positive Ratings:
    4,233
    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
     
    • Agree Agree x 1
  10. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    891
    Positive Ratings:
    829
    We might not be talking about vertex animations the same way, because I can not remember being able to control the facial expressions of a prop_dynamic.
     
  11. Pocket

    aa Pocket When all you have is Hammer...

    Messages:
    4,268
    Positive Ratings:
    2,030
    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?