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

[Spell] Detect pathing for buildings and destructables

Status
Not open for further replies.
To my horror I found out IsTerrainPathable( x, y, PATHING_TYPE_WALKABILITY) only checks for terrain pathing and ignores pathing by destructables and buildings. How would I go about detecting this.

My triggers runs ALOT so I assume creating units and seeing if they have moved would cause too much overhead.

Any alternatives? Just detecting destructables would be enough for my needs.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
You can also create items. ;)
Not sure if that is that much better.

An alternative would be to have a matrix, that stores pathing information of your destructables. You can initialize it at map init and update it whenever a destructible gets killed.
A guess using a hashtable, this would be rather easy, but you need to keep the operation limit in mind.
I recently made a trigger for my map, that stores terrain type of every cell in a hashtable and I think it worked nice, so doing the same for destructables should work too.
 
Given that this is linked to a "sight" system that runs every 0.04 second for every unit in a faction, I don't want to create anything really. I wonder if SetTerrainPathable at the start of the map and updating it whenever a destructible dies would be the solution. Does come with the down side of having to follow the already existing terrain tiles I guess.

Edit: Okay, SetTerrainPathable works for 1x1 (16x16 units) sizes, aka, the smallest pathing square, so that will have to be the solution to my problem unless someone has a better idea.
 
Last edited:
As of right now, it's the most reliable and fastest way of doing it shown here. However, Dusk does state that the thread will crash much sooner "if you run it 1500 times in a row with 10 in the way". It would be great to hear how it performs in your map though. You might want to just use MoveLocation() on CP_Point instead of creating a new location for it every time.
 
Status
Not open for further replies.
Top