• 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.

[Trigger] Spawn unit if destination is passable

Status
Not open for further replies.
Level 1
Joined
May 1, 2017
Messages
2
I am currently making a map that makes a unit (a merchant) to spawn in his town and go to a destination where it is possible for him to travel by foot. My map has small islands and his current spawning condition is that it checks every nearby allied town within his 3300 radii. But given the problem earlier, if I build a town in an island and build another town in an island next to it, the unit spawns and gets stuck in the shore.

Is there any way I check if the position of a nearby town and the town where the unit spawns possible to be traveled in foot?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I am thinking, you could make an insanely fast dummy unit that would "walk" the distance and give a go if it arrives at the target.
The problem with this is that the insanely fast max speed is 522, which is insanely slow :|
There is a system in the resources section that increases this limit, but I am not sure how much it would break the game.

Otherwise, you could devise your own A* method in a grid with cell size of 50.
50 should be big enough to allow units to pass and small enough avoid any mess-ups while keeping reasonable computation.
Still, this may or may not cause a lag spike, depending on how big is your map is.

I would be amazed if nobody has put anything similar around... ever ?

Edit// Went around looking for things
MoveSpeedX for GUI v1.1.0.0 unfortunately this requires JNGP and Jass Helper...
 
Last edited:
Level 1
Joined
May 1, 2017
Messages
2
I am thinking, you could make an insanely fast dummy unit that would "walk" the distance and give a go if it arrives at the target.
The problem with this is that the insanely fast max speed is 522, which is insanely slow :|
There is a system in the resources section that increases this limit, but I am not sure how much it would break the game.
This method works and this is the one I was looking for. Thanks a lot! +rep

You could make the merchant "amphibious," if you don't mind the guy walking/swimming in water.

Thanks for the reply. But I don't want a pack horse walks over the water just to reach to the other town in the next island... Hehe.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
This method works and this is the one I was looking for. Thanks a lot! +rep



Thanks for the reply. But I don't want a pack horse walks over the water just to reach to the other town in the next island... Hehe.

Don't forget to give it some kind of expiration so it does not walk forever when it gets blocked.
e.g. make it so it stops the check after... 60s sounds like a reasonable time.

Also, depending on how many routes can be ran at the same time, how long they are and how many you'd expect to need for a game,
a better approach would be re-using dummies instead of getting rid of them.

hope this helps!
-Ned
 
Status
Not open for further replies.
Top