• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] make dummy unit stick to unit

Status
Not open for further replies.
Level 21
Joined
Mar 29, 2020
Messages
1,237
hey,

I know this has been asked many times before, and I have bumped into answers about this in the past - but obviously now that I am actively looking for it I can't seem to find it anywhere...

how do I get a dummy unit to move in tandem with a unit? is there a different way than insta-moving it periodically? - I feel like this would create a lot of extra memory and would rather avoid it if there is a better way. (using -follow unit just makes it follow from a distance...)

its just for adding hero glow to units who's models I rescaled, whereas adding the glow via an ability scales the glow too and makes it humongous,and by doing this through a dummy unit i can rescale the glow model as needed...
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
You can uncheck Art - Scale Projectiles for your unit in the Object Editor and there's also Art - Required Animation Names - Attachments that can resize effects. Mountain Giant has the "large" animation name for example.

These two fields can potentially fix your scaling issues.

And how to move a unit periodically. Note that Periodic Intervals minimum is 0.03125 seconds, so despite me using every 0.01 seconds, it will default to 0.03125. If you use a Timer you can get around this minimum.
  • Example
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitX(udg_Dummy, GetUnitX(udg_Unit))
      • Custom script: call SetUnitY(udg_Dummy, GetUnitY(udg_Unit))
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
You can uncheck Art - Scale Projectiles for your unit in the Object Editor and there's also Art - Required Animation Names - Attachments that can resize effects. Mountain Giant has the "large" animation name for example.

interestingly enough this worked great with one out of the two units i tried it with, and didn't do anything to the other one, so i'll trigger that one. (both with the same ability, but the one it didn't work on was enlarged more, so maybe it worked but only a little).

It seems i have been unnecessarily trying to avoid using periodic triggers. I figured if leaks are such a big thing, and every little bit of extra memory counts, than triggers that fire so frequently are probably also a problem.

thanks guys!
 
Level 12
Joined
Jan 30, 2020
Messages
875
Well it is usually a good thing to avoid short repeating timers in an event-driven scripting context.

But sometimes there is absolutely no viable alternative, or avoiding them ends up increasing complexity to a point where it becomes counter-productive.

This said in your case you don't need any triggers, but the behavior you are describing is quite strange.
its just for adding hero glow to units who's models I rescaled,

If you resized the model in a model editing program, the glow model should not scale with the model if you attach it as an sfx
This usually rather happens when setting the field "Art - Scaling value" different from 1.0 in the object editor.

If this is an imported model, changing its size in something like Retera Model Studio to make it fit the size you want while keeping the Scaling Value to 1.0 should fix your problem without any dummy.

If it is a original game model, it is probably better to make a dedicated version of the glow model by resizing it to fit this specific unit.
Glow models are made of a few planes with a specific Team Color texture, so they are ridiculously small in size.

You could even consider making one for each of your units requiring a glow, to have full control of the glow size for each and everyone of them.


That would be the proper clean and efficient way to deal with this.


Hope this helps !!!
 
Level 12
Joined
Jan 30, 2020
Messages
875
Yes very easy, all you have to do is import the glow model, tick everything on the list of elements in the left panel, then select the scale tool on the right panel, then make sure the part inside the square angle is highlighted.
This means it will scale the model in all directions (if only the angle part looking like \\ is selected, you will only scale it on the current side of the view.

If you have difficulties with it, I would recommend quickly watching some of @Retera's videos from his YouTube channel :
Retera
 
Status
Not open for further replies.
Top