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.
 

Kahem

New Member
Reaction score
2
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"
 

Rainther

I guess I should write something of value here...
Reaction score
61
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.
 

Joccaren

You can change this now in User CP.
Reaction score
54
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)
 

Kahem

New Member
Reaction score
2
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
 

Rainther

I guess I should write something of value here...
Reaction score
61
You're welcome. I figured it'd be easier to use dummy units since they store both health, mana and position all in one.
 

MurderMode

Giving new meaning to co-op... slowly
Reaction score
154
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
 

roXplosive

New Member
Reaction score
15
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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top