What Controls Unit Speeds?

Discussion in 'Modding' started by Ftoomsh, Oct 27, 2017.

  1. Ftoomsh

    Ftoomsh Well-Known Member

    I tried this as a test in dmscript.global.

    gc_obj_speed_hardhorse = 96; // was 56
    gc_obj_speed_fasthorse = 96;

    It did nothing.

    I tried this as a test in unit.script

    objbase.speed := (gc_obj_speed_fasthorse - 28);

    It did nothing.

    I tried this as a test in unit.script (to change a usually fasthorse to a hardhorse as a test)

    objprop.usage := gc_obj_usage_hardhorse;
    objbase.speed := gc_obj_speed_hardhorse;

    It did nothing.

    The one thing that did work is this test;

    objprop.walkintervalfactor := .5;

    which slows down the animation but not the speed.

    Logically, I can't think what else to try to affect the speed of a unit. Why would a global constant not change anything when changed?
  2. Wralth

    Wralth Active Member

    Pretty sure its hardcoded somewhere so id look for the state constant for movement and see where its checked then try to backtrack it all from there.
  3. Ftoomsh

    Ftoomsh Well-Known Member

    General has explained to me how his formation speed changes work. It's very clever and it does not rely on finding the hard-coded speed. Rather it changes formation speed (of a particular type of unit) by changing a ratio. One can set an arbitrary base of say 25. Then if the formation has an fAddSpeed (I think it's called) of -5 then then the new speed becomes (25-5)/25 = 20/25 = 4/5ths of standard speed. He does this by putting delays between the "ticks" I think. But General can explain it better than me. The key code is in progress/nothing.inc if I recall correctly.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice