Glimpse [dotA]

n1mr0d

Member
Reaction score
1
As the name says, this spell is from dotA, basically this spell makes 1 target to back to their pervios location. (4 seconds ago).

I have been wondering since it appeared this spell in dotA, how can i program it, but still i got nothing, any tip how can i do it :D ? And also it's the same as Time Lapse makes the caster to go back where he was 5 seconds ago.

Please any ideas . :D ?
 

Solu9

You can change this now in User CP.
Reaction score
216
I have never played DotA.

You could have 4 periodic triggers running at the same time with 1 second between them.

You will have 4 point variables.

The four triggers will be identical but will be started with 1 second off.

Point triggers will look like this.
---------------------------------------
Events - Every 1 sec game time
Conditions
Actions
Set Point_1 = Position of "your unit"

Events - Every 1 sec game time
Conditions
Actions
Set Point_2 = Position of Point_1

Events - Every 1 sec game time
Conditions
Actions
Set Point_3 = Position of Point_2

Events - Every 1 sec game time
Conditions
Actions
Set Point_4 = Position of Point_3
--------------------------------------------

To start them with different interval make 3 triggers like this

Events - Game time elapsed 1 second
Conditions
Actions - Turn on Point 2 trigger

Events - Game time elapsed 2 second
Conditions
Actions - Turn on Point 3 trigger

Events - Game time elapsed 3 second
Conditions
Actions - Turn on Point 4 trigger


That's my best answer. It seems a bit unstable though.
 

n1mr0d

Member
Reaction score
1
I think there is an easier way to make it , but for the 1st comment seems logically XD. Btw after i have posted, i have been thinking about the same idea as you :p.
 

Solu9

You can change this now in User CP.
Reaction score
216
Hm yeah. At first I thought placing a point every 4 seconds. But that means if the Glimpse ability is used 1 to 3 seconds after the point has been placed the unit will not travel 4 seconds back.

How about a 4 second periodic event

Conditions
Actions -
Set Glimpse_Point
wait 1 sec
Set Glimpse_Point
wait 1 sec
Set Glimpse_Point
wait 1 sec
Set Glimpse_Point

Then there will automatically go 1 more second until the trigger runs again.
This way the point will always be 4 seconds ago.

Edit: This will make the spell not MUI though.
 

thorhunter

You can change this now in User CP.
Reaction score
32
You could have one trigger that runs periodically eg. once every 0,25 seconds, that will give you how exact timing of your spell will be.

Depending how precise and how far into the past your spell is, you'll need certain number of arrays, eg:

4/0,25 = 16 arrays

Depending on how much data you want to store, each will use 16 arrays, that means:
16 point arrays - point,
16 real arrays - health
16 real arrays - mana
etc, etc.

Each one array stores the value of units on the entire map at certain moment.

First trigger:

Every 0,25 seconds of the game:

Array 16 is destroyed.
Arrays from 1 to 15 are sorted into 2 to 16.
Array 1 is filled with present data.

Second trigger:

Ability is being cast:

Set all of the paremeters of the units affected into ones from array 16.


The above solution makes it kinda tiresome since for good precision and high time leap youll need a great number of variables. It's rather for large group of units and small time leaps.

But, taking the assumption that only one unit per player is affected. you can transpose the arrays into one per player value to store giving you the possibility of storing 8192 intervals per player which, assuming precision to 1/4 second will give you 2048 seconds into the past.
 

n1mr0d

Member
Reaction score
1
well this kinda sounds chinese for me , could you make an example ? that would be helpfull.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set UnitNumber = (UnitNumber + 1)
          • Set Unit[UnitNumber] = (Picked unit)

Trigger:
  • UnitEnters
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set UnitNumber = (UnitNumber + 1)
      • Set Unit[UnitNumber] = (Triggering unit)

Trigger:
  • Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to UnitNumber, do (Actions)
        • Loop - Actions
          • Set TempInt = (Integer A)
          • Custom script: call RemoveLocation (udg_UnitPoint1[udg_TempInt])
          • Set UnitPoint1[(Integer A)] = UnitPoint2[(Integer A)]
          • Set UnitPoint2[(Integer A)] = UnitPoint3[(Integer A)]
          • Set UnitPoint3[(Integer A)] = UnitPoint4[(Integer A)]
          • Set UnitPoint4[(Integer A)] = UnitPoint5[(Integer A)]
          • Set UnitPoint5[(Integer A)] = UnitPoint6[(Integer A)]
          • Set UnitPoint6[(Integer A)] = UnitPoint7[(Integer A)]
          • Set UnitPoint7[(Integer A)] = UnitPoint8[(Integer A)]
          • Set UnitPoint8[(Integer A)] = (Position of Unit[(Integer A)])

Trigger:
  • Trigger
    • Events
      • Player - Player 1 (Red) types a chat message containing sas as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to UnitNumber, do (Actions)
        • Loop - Actions
          • Set TempInt = (Integer A)
          • Set TempReal1 = (X of UnitPoint1[(Integer A)])
          • Custom script: call SetUnitX(udg_Unit[udg_TempInt],udg_TempReal1)
          • Set TempReal1 = (Y of UnitPoint1[(Integer A)])
          • Custom script: call SetUnitY(udg_Unit[udg_TempInt],udg_TempReal1)
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
These are a little messy and you will have to remove the leaks your self but they will do what you want for a game with up to 6 players, you can increase the players by changing the 6 multiples in the trigger.
Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Footman
            • Then - Actions
              • Set Abilitypoint[((Player number of (Owner of (Picked unit))) + ((Custom value of (Picked unit)) x 6))] = (Position of (Picked unit))
              • Set AbilityHealth[((Player number of (Owner of (Picked unit))) + ((Custom value of (Picked unit)) x 6))] = (Life of (Picked unit))
              • Set AbilityMana[((Player number of (Owner of (Picked unit))) + ((Custom value of (Picked unit)) x 6))] = (Mana of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Less than 3
                • Then - Actions
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
                • Else - Actions
                  • Unit - Set the custom value of (Picked unit) to 0
            • Else - Actions


Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • For each (Integer A) from 0 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Triggering unit)) Equal to (Integer A)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Equal to 3
                • Then - Actions
                  • Set AbilityInterger = 0
                • Else - Actions
                  • Set AbilityInterger = (AbilityInterger + 1)
              • Unit - Move (Triggering unit) instantly to Abilitypoint[((Player number of (Owner of (Triggering unit))) + (AbilityInterger x 6))]
              • Unit - Set life of (Triggering unit) to AbilityHealth[((Player number of (Owner of (Triggering unit))) + (AbilityInterger x 6))]
              • Unit - Set mana of (Triggering unit) to AbilityMana[((Player number of (Owner of (Triggering unit))) + (AbilityInterger x 6))]
            • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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