Keeping a unit incredibly close

Pigger

New Member
Reaction score
13
Oi, me again. I'm working on a spell that needs a unit to stay incredibly close to a unit at all times, almost directly behind it (as in a shadow unit) that will copy every move the guy it is following does.

As in O = Hero
() = Shadow

......(O --> (Arrow meaning movement)

So that half of the shadow unit is "inside" of the hero it follows around.

I hope this is clear enough :S
 

Kenoriga

Ultra Cool Member
Reaction score
34
That seems hard to me... Tried having a the unit model attached to the unit? Maybe it works. (just a guess lol)
 

Psiblade94122

In need of sleep
Reaction score
138
you can try something like this
<NOT MUI, if you want it mui ask me and ill recode>
<this is a general idea, it shuld work, but its too late for me to test atm, why the hell am i still up @.@>
Variables
Host <unit variable> = the hero affected
Shadow <unit variable> = the shadow... thats being the shadow
L and L2 are both point variables
Code:
events
every .05 seconds
conditions
actions
set L = unit position of Host
set L2 = L at a offset of 25 <might be smaller or bigger depening on the size of your unit> at an angle of (unit faceing of host -180)
Unit - move Shadow instantly to L2 faceing (unit faceing of host)
call RemoveLocation (udg_L)
call RemoveLocation (udg_L2)
 

Pigger

New Member
Reaction score
13
Yeah Psi, that's what I was originally thinking, I made a trigger similar to that just to see what would happen. The problem with that is with the move instantly the unit will never play a walk animation or anything, it will just constantly be doing the same thing while the host/hero will be walking normally.

I appreciate the effort (and hope you finally got to sleep lol)

Oh, and .03 would be much better than .05 (I tested both) because .03 goes a lot smoother where as .05 seems a little clunky, just fyi for movin things a lot.

EDIT: Kenoriga, I'm not 100% sure of what you mean by attatching it to the model. If by making a dummy ability with an attachment of a model is what you mean, I have tried and it does not work for what I want. Thanks though :D
 

SaintMorose

New Member
Reaction score
26
Have you tried changing the follow range in Gameplay Constants and then Issuing Follow Orders?
 

Pigger

New Member
Reaction score
13
I was thinking of that, the only problem is, that would end up affecting gameplay for other people and units if they are ever ordered to follow.

I suppose it's the only solution I can think of.
 

Sefiraat

New Member
Reaction score
15
Uhm, i got no idea if this is what you want, but couldnt you make some triggers telling the dummy(shadow) unit to copy the main unit, but when it comes to moving offset the order by -25 opposing the main units facing degree? Im not sure what this will look like :)
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
E: Every Second
A: Order <Sahdow> to move to Hero's Location

That should do it with walking animation.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
Rheias, what you suggest would be like a "Pet". Which would be fun, but a totally different concept.

I think what Pigger wants is like a shadow-partner; a unit that imitates the Hero in every action he does; Something like a shadow of the hero, but is 3D and have an attack. So when the hero moves, the shadow moves, when the Hero attacks, the shadow does the same.

Given that he wants "half" of the shadow to be within the Hero, the only way I can think of is remodel the hero character, including the shadow; like having two sets of "bones" with identical movements, one behind the other. Maybe set with different "skins". Attacks can be done via dummys.
 

Pigger

New Member
Reaction score
13
Rheias, what you suggest would be like a "Pet". Which would be fun, but a totally different concept.

I think what Pigger wants is like a shadow-partner; a unit that imitates the Hero in every action he does; Something like a shadow of the hero, but is 3D and have an attack. So when the hero moves, the shadow moves, when the Hero attacks, the shadow does the same.

Given that he wants "half" of the shadow to be within the Hero, the only way I can think of is remodel the hero character, including the shadow; like having two sets of "bones" with identical movements, one behind the other. Maybe set with different "skins". Attacks can be done via dummys.

@Second Paragraph - Exactly!

So far the only two possibilities that may work are the changing gameplay constants of follow, which would adversly affect the rest of the map, or to edit the model, which I have no expirience in doing :S.

I shall stick to the problem but so far I would like to thank you guys for helping.
 

IceWarrior98

New Member
Reaction score
12
I tried to do this myself but the only problem I come to is that the "shadow" does not play animations. What I did was:

Two Variables Required:
Shadow : Point - The dummy's target position with offset. I made this with arrays for multiple shadows cause i'm cool that way.
Unit : Point - The Units position the shadow is copying
Code:
Shadow
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Set SP = (Position of Knight 0045 <gen>)
        Set ST[1] = (SP offset by -25.00 towards (Facing of Knight 0045 <gen>) degrees)
        Set ST[2] = (ST[1] offset by -25.00 towards (Facing of Knight Shadow 0046 <gen>) degrees)
        Set ST[3] = (ST[2] offset by -25.00 towards (Facing of Knight Shadow 0047 <gen>) degrees)
        Set ST[4] = (ST[3] offset by -25.00 towards (Facing of Knight Shadow 0048 <gen>) degrees)
        Set ST[5] = (ST[4] offset by -25.00 towards (Facing of Knight Shadow 0049 <gen>) degrees)
        Unit - Move Knight Shadow 0046 <gen> instantly to ST[1], facing (Facing of Knight 0045 <gen>) degrees
        Unit - Move Knight Shadow 0047 <gen> instantly to ST[2], facing (Facing of Knight Shadow 0046 <gen>) degrees
        Unit - Move Knight Shadow 0048 <gen> instantly to ST[3], facing (Facing of Knight Shadow 0047 <gen>) degrees
        Unit - Move Knight Shadow 0049 <gen> instantly to ST[4], facing (Facing of Knight Shadow 0048 <gen>) degrees
        Unit - Move Knight Shadow 0050 <gen> instantly to ST[5], facing (Facing of Knight Shadow 0049 <gen>) degrees
        Custom script:   call RemoveLocation(udg_ST[1])
        Custom script:   call RemoveLocation(udg_ST[2])
        Custom script:   call RemoveLocation(udg_ST[3])
        Custom script:   call RemoveLocation(udg_ST[4])
        Custom script:   call RemoveLocation(udg_ST[5])
        Custom script:   call RemoveLocation(udg_SP)

Also this makes each shadow follow the one infront of it so they don't look like a stick or something.

I also did this to the dummys (pre-placed dummies for test)

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Visibility - Disable fog of war
        Visibility - Disable black mask
        Unit - Turn collision for Knight Shadow 0046 <gen> Off
        Animation - Change Knight Shadow 0046 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 20.00% transparency
        Animation - Change Knight Shadow 0047 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 40.00% transparency
        Animation - Change Knight Shadow 0048 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 70.00% transparency
        Animation - Change Knight Shadow 0049 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 80.00% transparency
        Animation - Change Knight Shadow 0050 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 90.00% transparency

This just makes them sort of see-through and makes the first dummy be able to go inside the real unit. The other dummys don't seem to need it.

shadow5.jpg
shadow3.jpg

shadow2.jpg
 

SaintMorose

New Member
Reaction score
26
Heres an idea that would require a change in the shadow units collision size

Code:
Events
        Unit - A unit owned by <you> Is issued an order targeting a point
    Conditions
        (Issued order) Equal to (Order(move))
    Actions
        Set TempPoint = ((Target point of issued order) offset by -25.00 towards (Facing of (Ordered unit)) degrees)
        Unit - Order <shadowunit> to Move To TempPoint

see if that works?
 

0zaru

Learning vJASS ;)
Reaction score
60
Did you tryied playing the unit animation ? like Play Unit Animation - "move" (I think that that is the animation)
 

IceWarrior98

New Member
Reaction score
12
> Did you tryied playing the unit animation ?
Yes but to make it look good you'd have to make a seperate trigger that detect when the unit the shadow follows moves and i don't want to get into that right now. I just wanted to show what I came up with real quick for someone else to build on, or perhaps dismantle and redo.

EDIT: I just looked up and it looks like Saints got the idea. But you have to remember when it's being move instantly it pretty much cancles the move command because you only told the real unit to move once.

I suppose you can make it so if its out of the specified point to move back into it, but I don't know that can be done using variables or not. I don't have WE open.
 

NapaHero

Back from the dead...
Reaction score
43
Heres an idea that would require a change in the shadow units collision size

Code:
Events
        Unit - A unit owned by <you> Is issued an order targeting a point
    Conditions
        (Issued order) Equal to (Order(move))
    Actions
        Set TempPoint = ((Target point of issued order) offset by -25.00 towards (Facing of (Ordered unit)) degrees)
        Unit - Order <shadowunit> to Move To TempPoint

see if that works?

This will not work because:

You forgot to put in the conditions what is the type of the Ordered Unit, so if any unit that is owned by him moves, the trigger takes effect.

You need to change Ordered Unit by Triggering Unit, so that the trigger can work perfectly.

And remove the TempPoint or it will leak:

Custom script: call RemoveLocation (udg_TempPoint)
 
General chit-chat
Help Users
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top