a time spell - help!

Kahem

New Member
Reaction score
2
Hello all
im trying to make a GUI spell like nerubian weavers "time lapse" from dota.
basicly what this spell does is records the location mana and hit points of the nerubian weaver each second, for up to 5 seconds.
so when the weaver casts time lapse it is instantly moved to the point where it was 5 seconds ago and its mana and life are set to what they were.

What i am trying to create is a GUI spell like this, but is hero targetable, friend enemy and self.
Hence it needs to be mpi (and gui)
so you are able to cast it on, say, a retreating enemy to move it back, or an friend who just got the crap nuked out of him to restore his hit points
im having trouble with it, especialy making it leak free.

if anyone can help me out i will be greatful
and if you can make me a full working demo map i would be even for greatful!
thanks for taking the time to help me out.
 
oh, the spell is 4 levels

"Sends a target 2/3/4/5 seconds back in time moving it to where it was, with the same hit points and mana"
 
Holy crap > _<.

My solution'd be to have 4 units (dummies) for each unit you can cast this on where you set their mana, health and location to the unit's position.
Basicly you have 4 units and each second you take the unit which have 5 seconds and put it infront of the line. Theese units should be hidden.
To simply it all, you should this ability should only work for 1 unit for each player.

There is no easy way to do this since historical data isn't saved from the game.
 
Use a game cache to save the unit, since it is hero targetable, I gather its more like the Sea captains ability where after x amount of seconds, the target unit is moved back to the place where the ability was cast on it. Try this (does not include game cache, ask if you need help with that part) :

Event:
*An ability is cast
Condition:
*Ability being cast equal to Moveback
Actions:
*Save (Target unit of ability) as (SpellTarget) of (Moveback) in last created game cache
*set (Tempoint) to (Position of (Target Unit of ability)
*Wait 'x' seconds
*Remove (Target unit of ability) from game
*Restore (SpellTarget) of (Moveback) at (Tempoint) for (Owner of ability being cast)


This will screw up if you have more than one unit able to use this ability (This means multiples of the one unit able to cast the ability, another copy of this unit owned by another player that can use this ability or any other unit that can use this ability)
 
HORAY! i did it!
thanks for the idea of making unit dummys!!!
originaly i used 5 point arays, and 10 real arays to record where each hero was on the map, its hp and mana, but they leaked! and to destroy a point ment i couldnt keep track of the location of each hero

BUT after you sujested to use a dummy unit i deleted all that and made 5 unit arays. heres the triggers for anyone else wanting to make this spell

Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set ForEachInt = 0
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Set ForEachInt = (ForEachInt + 1)
Set Remember5[ForEachInt] = Remember4[ForEachInt]
Set Remember4[ForEachInt] = Remember3[ForEachInt]
Set Remember3[ForEachInt] = Remember2[ForEachInt]
Set Remember2[ForEachInt] = Remember1[ForEachInt]
Unit Group - Pick every unit in (Units owned by (Player(ForEachInt)) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
Loop - Actions
Set TempPoint = (Position of (Picked unit))
Unit - Create 1 Dummy for (Player(ForEachInt)) at TempPoint facing (Facing of (Picked unit)) degrees
Set Remember1[ForEachInt] = (Last created unit)
Unit - Hide (Last created unit)
Unit - Set life of (Last created unit) to (Life of (Picked unit))
Unit - Set mana of (Last created unit) to (Mana of (Picked unit))
Unit - Add a 6.00 second Generic expiration timer to (Last created unit)


Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Time Portal
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Time Portal for (Triggering unit)) Equal to 4
Then - Actions
Set TempPoint = (Position of (Target unit of ability being cast))
Set PortalUnit = (Target unit of ability being cast)
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Position of Remember5[(Player number of (Owner of PortalUnit))])
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Set life of PortalUnit to (Life of Remember5[(Player number of (Owner of PortalUnit))])
Unit - Set mana of PortalUnit to (Mana of Remember5[(Player number of (Owner of PortalUnit))])
Unit - Move PortalUnit instantly to TempPoint, facing (Facing of Remember5[(Player number of (Owner of PortalUnit))]) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set PortalUnit = No unit
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Time Portal for (Triggering unit)) Equal to 3
Then - Actions
Set PortalUnit = PortalUnit
Set TempPoint = (Position of PortalUnit)
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Position of Remember4[(Player number of (Owner of PortalUnit))])
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Set life of PortalUnit to (Life of Remember4[(Player number of (Owner of PortalUnit))])
Unit - Set mana of PortalUnit to (Mana of Remember4[(Player number of (Owner of PortalUnit))])
Unit - Move PortalUnit instantly to TempPoint, facing (Facing of Remember4[(Player number of (Owner of PortalUnit))]) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set PortalUnit = No unit
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Time Portal for (Triggering unit)) Equal to 2
Then - Actions
Set PortalUnit = (Target unit of ability being cast)
Set TempPoint = (Position of PortalUnit)
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Position of Remember3[(Player number of (Owner of PortalUnit))])
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Set life of PortalUnit to (Life of Remember3[(Player number of (Owner of PortalUnit))])
Unit - Set mana of PortalUnit to (Mana of Remember3[(Player number of (Owner of PortalUnit))])
Unit - Move PortalUnit instantly to TempPoint, facing (Facing of Remember3[(Player number of (Owner of PortalUnit))]) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set PortalUnit = No unit
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Time Portal for (Triggering unit)) Equal to 1
Then - Actions
Set PortalUnit = (Target unit of ability being cast)
Set TempPoint = (Position of PortalUnit)
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set TempPoint = (Position of Remember2[(Player number of (Owner of PortalUnit))])
Unit - Create 1 Time Portal for (Owner of (Triggering unit)) at TempPoint facing (Facing of PortalUnit) degrees
Unit - Set life of PortalUnit to (Life of Remember2[(Player number of (Owner of PortalUnit))])
Unit - Set mana of PortalUnit to (Mana of Remember2[(Player number of (Owner of PortalUnit))])
Unit - Move PortalUnit instantly to TempPoint, facing (Facing of Remember2[(Player number of (Owner of PortalUnit))]) degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint)
Set PortalUnit = No unit
Else - Actions
 
You're welcome. I figured it'd be easier to use dummy units since they store both health, mana and position all in one.
 
instead of using dummy units I think you could use 5 hash tables (1 for each second) to store the mana, hp and position of the unit in seperate keys and it would work as mui without needing dummies for every unit
 
I have seen this thread and it looks just fine (the code right now) but I've been thinking about MUI . My solution would be : create a unit group that holds units with time lapse in it and an unit array for units with the ability . This calls for a few triggers :

1 On map init null the unit array
2 On ability learn if ability learned is time lapse add unit to unit group if not already there and do seek if in the units array from 5 to 5 positions you find a null spot occupy it with the learning unit
3 On unit creation / upgrade purchased check if the unit has the ability then add it to the array
4 On unit death if the dying unit has ability and is nonhero null every the postition it occupyes in the array and the other 4 positions for dummies but if it's a hero only null the dumies because heroes can be revived . Also remove nonhero units from the unit group
5 periodic refreshing timer that every 1 second for all the units in the array
and save the mana/life/position in the array for each unit recorded .
The units array is composed as follows : position 0 - first unit that has time lapse . Position 1 - position of unit 2 seconds ago and so forth .
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top