How do you change the distance at what a unit follows another?
Basically I'm having a problem where a unit can walk over buildings (think lowered depos) but if you click directly on the lowered depo, it will only walk just next too it, instead of on top of it. I haven't been able to figure out how to change that.
If you don't actually need to interact with the buildings then adding the untargetable flag to the unit you want to walk on top of will accomplish this.
Unfortunately it does still need to be possible to a-click to attack them. They're platforms over lava, so you need to be able to target them to cause enemies to fall into the lava.
Looks like this can also be done by modifying the unit's footprint. Changing the supply depo's footprint from 2x2 Underground to 2x2 No Collision seemed to allow for proper right click movement while maintaining a+left click targeting. Not sure how this would affect units walking on top of floating platforms, so if that interaction gets messed up you may need to use some sort of dummy unit to readd ground collision.
That's why I suggested a dummy unit. I imagine you'd set up two units in the data editor, then do something in the trigger editor like this:
Spawn two platforms at the same location, one that is untargetable and one with a no collision footprint. You can then visually hide the untargetable one with SendActorMessagetoUnit - Set Opacity 0 (the Hide Unit action makes it so you can't interact with a unit). This should create the effect you want in regards to platforms. Then you just need to link them somehow so that one dies, you kill the other with a trigger. Either save them to arrays/records at matching spots, or just search for units on death. ie
Event - Unit dies - Unit Type CustomPlatformNoFootprint
Pick each unit within 0.2 of triggering unit of type CustomPlatformUntargetgable
Remove Picked Unit from the game
It is a little bit of a hack, but I imagine it would function very well.
So I knew your idea would work in theory, but I'm already using some hacks to get the system working (and its was very tricky to get it all working to begin with) so I thought attempting to make that work without interfering with my other hacks might be more work than it was worth, considering it was a relatively unimportant problem.
I did run into several issues trying to get it to work (buildings with a build time of 0 don't register unit construction events, and changing the footprint on the platform caused a different event searching for the platforms to decide if buildings built on the platforms are now in lava or not to fail) but eventually I got it working. Thanks for the help.
The map is Probe Wars (been published for a while now) if you want to see what I was using this for.
How do you change the distance at what a unit follows another?
Basically I'm having a problem where a unit can walk over buildings (think lowered depos) but if you click directly on the lowered depo, it will only walk just next too it, instead of on top of it. I haven't been able to figure out how to change that.
If you don't actually need to interact with the buildings then adding the untargetable flag to the unit you want to walk on top of will accomplish this.
@ZMilla93: Go
Unfortunately it does still need to be possible to a-click to attack them. They're platforms over lava, so you need to be able to target them to cause enemies to fall into the lava.
@TheSkunk2: Go
Looks like this can also be done by modifying the unit's footprint. Changing the supply depo's footprint from 2x2 Underground to 2x2 No Collision seemed to allow for proper right click movement while maintaining a+left click targeting. Not sure how this would affect units walking on top of floating platforms, so if that interaction gets messed up you may need to use some sort of dummy unit to readd ground collision.
Yeah, that breaks the platforms. Oh well, if thats really how its done I guess I'm out of luck.
@TheSkunk2: Go
That's why I suggested a dummy unit. I imagine you'd set up two units in the data editor, then do something in the trigger editor like this:
Spawn two platforms at the same location, one that is untargetable and one with a no collision footprint. You can then visually hide the untargetable one with SendActorMessagetoUnit - Set Opacity 0 (the Hide Unit action makes it so you can't interact with a unit). This should create the effect you want in regards to platforms. Then you just need to link them somehow so that one dies, you kill the other with a trigger. Either save them to arrays/records at matching spots, or just search for units on death. ie
It is a little bit of a hack, but I imagine it would function very well.
So I knew your idea would work in theory, but I'm already using some hacks to get the system working (and its was very tricky to get it all working to begin with) so I thought attempting to make that work without interfering with my other hacks might be more work than it was worth, considering it was a relatively unimportant problem.
I did run into several issues trying to get it to work (buildings with a build time of 0 don't register unit construction events, and changing the footprint on the platform caused a different event searching for the platforms to decide if buildings built on the platforms are now in lava or not to fail) but eventually I got it working. Thanks for the help.
The map is Probe Wars (been published for a while now) if you want to see what I was using this for.
All to do with collision radius.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg