• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Waygate portal cooldown

Status
Not open for further replies.
Level 11
Joined
Jan 23, 2015
Messages
788
How do I make a cooldown for the Waygates to prevent units from spamming it, like:

Unit A is chasing unit B, unit B enters a waygate and teleports to the other side, unit A goes after him, then unit B goes back, unit A goes back too and so on to infinity.

I'm planning to make a cooldown of 5 seconds for each unit, and I still haven't come up with an idea on how to do that, and it's also not very efficient, cause after 5 seconds you can tp again, maybe I'll have to make it longer but I still need your ideas on this.
 
Don't think there is an "easy" fix to this one. You'd have to make your own teleportation trigger and with that you would lose some of the autmatic path-finding that the waygate provides. But if you don't care about that then it should't be too hard. (Meaning, when you right-click the tp is when you order to tp, and not when you click on the mini-map near the area you want to walk to.)
 
Lets say waygates are A and B, and letter M represents mountains/cliffs.


A........MMMMMMM..............B

Even though path between A and B is blocked, when you move a unit from A to B it detects there is a waygate which leads to point B and goes to that waygate.
 
That's actually possible, but I need to check every time a unit moves, which will make the game lag hardly.
Well, I guess I'll just have to remove the waygates, they aren't really suitable for my map after all. Anyways, thank you guys! :)
 
Actually I think there is a way of detecting waygate use by combinating region enter/leave events.
 
If you want a 5s cooldown for every single unit, you need some sort of unit indexer. If you don't want to use unit indexers you can add an dummy ability with x number of levels as a count reference.

I myself often add a dummy ability with x number of levels, maybe 5 levels in your example. Set the ability at level 5 when entering the gameway (ability that is hidden, (phoenix fire for example with 1 range, target nothing)) and decrease 1 level pr sec and then remove the unit from the unit group and the ability when its level 1 which acts as a index counter for that unit.

You need 2 Different abilities as each region end will be triggered before actually entering the gateway (but perhaps you can make the region smaller than the range of the gateway and thus avoid this.)
 
Status
Not open for further replies.
Back
Top