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

Reverse Time

Status
Not open for further replies.
Level 6
Joined
Apr 15, 2012
Messages
205
I'm making a hero that controls time. I want him to be able to reverse the time of all units on the map by 5 seconds. This means that they should move back to where they were 5 seconds before he uses the ability. Which is the most effective way of doing this?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It is possible in replays so check if there is some interface exposing the time system used by replays.

Otherwise you will have to itterate through all active units every second on the entire map and store all their position data in a 5 second buffer. Not very efficient. Only turn such a system on if the hero learns the skill.
 
Level 6
Joined
Apr 15, 2012
Messages
205
Ok, do you have any clue of how they did it with the Disruptor or the Nerubian Weaver in DotA?
 
I suggest you have the ability trigger, then 5 seconds later it fires reversing time. This way you don't have to start tracking units until the ability fires. Otherwise you're going to have some serious triggering on your hand.

As for DOTA it's fairly easy because if my memory serves me right it only reversed heroes.. therefore you're only tracking 10 units at any given time.
 
Level 6
Joined
Apr 15, 2012
Messages
205
Ok, I liked your idea, I might use it. In my map, there are a total of 11 units out on the map. We'll see how it ends up.
 
Ok, I liked your idea, I might use it. In my map, there are a total of 11 units out on the map. We'll see how it ends up.

Oh that's simple.
When the ability fires move a region to the unit's location,
5 seconds later move the unit to the centre of the region.

that or..

constantly have variables of x and y updating as the unit moves around.
when the ability fires pause the tracking, then move the unit back to those co-ords later.

again I highly dis-recommend you have the ability reverse time immediately both for imba reasons and the fact the code you'd have to use would be a bit insane.. I cant really think of anything off hand you could even use..

plus if you wait 5 seconds then you can give some kind of visual queue to the players that time will be reversed which prevents imba.

edit:

actually.. take the idea with the x and y values and just have the trigger not update it for 5 seconds.
>_>
 
Status
Not open for further replies.
Top