• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

CreateUnit question

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
When I use CreateUnit(myPlayer, 'h001', x, y, 0) for a unit that has locust ability, it still adjusts the unit's position as though it had collision. I can get around that by setting the unit's position afterwards, so it's not really a problem.

Though, I was wondering. Is it possible that spawning the dummy unit somewhere where it is less likely to spawn on top of another unit is faster? It would not need to calculate and adjust the position of the unit when it spawns it. I have to set the unit's position after, anyway, so it is the same code, just I would change the above code to something like CreateUnit(myPlayer, 'h001', 0, 0, 0) (assuming 0, 0 is a good spot to spawn them).
 
Level 12
Joined
May 22, 2015
Messages
1,051
Why don't you just make your dummies have flying movement?
Doesn't that solve the problem?
Or you aren't talking about dummies, but other units with locust?

Is there a way to make flying units not change their height near cliffs? I'd also need to fix it for near buildings, but at least I know how to do that part.

The problem with making them fly is that they move up near cliffs, so something like chain lightning would appear to come out of the air instead of out of the unit.

I am also using some of them for animations, so those animations would be floating when I don't want them to be.
 
Hmm, that's actually an interesting question. I assume that it would indeed be faster to create units at a spot without any pathing obstructions, thought that would depend on the map itself since there could be something at (0, 0).

So if anyone knows, I would like to know the answer to this question as well :p
 
Level 12
Joined
May 22, 2015
Messages
1,051
0, 0 is a fine spot for my map, so I can just use that. It's less likely to have a unit in the way than the 100% chance of having a unit in the way from spawning it on top of another unit. May as well take the speed boost if it does anything lol. I doubt it will ever be noticeable. It was just something I started thinking about.
 
Status
Not open for further replies.
Top