Problem with moving unit 5s back

arcano

New Member
Reaction score
0
So i created a spell to move the caster to it's position, 5 seconds back in time. But it's not working and i can't find the problem.

PT learn
Events
Conditions
Actions
Set PT_caster = (Triggering unit)
Trigger - Turn on Thomas Position <gen>
Trigger - Turn off (This trigger)

Thomas Position
Events
Time - Every 1.00 seconds of game time
Conditions
(PT_caster is alive) Equal to True
Actions
Set PT_counter = (PT_counter + 1)
Set PT_parray[PT_counter] = (Position of PT_caster)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PT_counter Greater than 6
Then - Actions
Custom script: call RemoveLocation (udg_PT_parray[udg_PT_integer - 6])
Else - Actions
Do nothing

Past Tense
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Past Tense
Actions
Unit - Order PT_caster to Stop
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PT_counter Less than or equal to 6
Then - Actions
Unit - Move PT_caster instantly to PT_parray[1]
Custom script: call RemoveLocation (udg_PT_parray[1])
Special Effect - Create a special effect attached to the origin of PT_caster using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
Else - Actions
Unit - Move PT_caster instantly to PT_parray[(PT_counter - 5)]
Custom script: call RemoveLocation (udg_PT_parray[udg_PT_counter - 5])
Special Effect - Create a special effect attached to the origin of PT_caster using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl

Wtf, reading this i see that i forgot one event. *goes on testing*

Edit: it works now nvm this thread XD
 

Jagan

New Member
Reaction score
30
When you said 5 seconds back, do you mean something like DotA's Time Lapse? If so, try this:

Time Lapse (A0CT)
Based on Channel.

When the skill is first learnt, create a timed trigger every 0.5 seconds, and save "Unitvar" to the cache.

The periodic trigger recovers "UnitVar" from the cache, then sets for i=1 until i>10, set "TLX(i-1)" to be "TLXi" (aka TLX1 becomes what used to be TLX2, TLX2 becomes what used to be TLX3, ..., TLX9 becomes TLX10), then do the same for "TLYi", "TLLifei" and "TLManai", then increase i by 1. After the loop, set "TLX10" as "UnitVar" X position, "TLY10" as "UnitVar"'s Y position, "TLLife10" to its CurrentLife and "TLMana10" to its CurrentMana.

Now, when Time Lapse goes into effect, the trigger recovers "TLLife1", "TLMana1" (if any of those two is lower than 1 then that value is used instead, "TLX1" and "TLY1" from the cache, now if TLLife1 is strictly bigger than 1 and the casting unit is alive, show the especial event on top of the casting unit, then set the unit's X and Y, Life and Mana to the values just retrieved, remove all negative buffs from the unit and then create a timed event to run 0.0 seconds after the spell has been cast, while saving "Unit" (Weaver) and "Mana" (Weaver's CurrentMana) to the cache.

The timed trigger set "Unit"'s CurrentMana to be equal to "Mana". <- This is done because the whole trigger happens before Time Lapse takes the mana away from the unit, so this is needed so you don't end up with the expectedmana-the mana cost of Time Lapse.

Do note that Time Lapse actually make Weaver go back in time between 4.5 and 4.99 seconds, depending on the time you first learnt Time Lapse.
 

arcano

New Member
Reaction score
0
Yeah it's like time lapse, but i found out the problem as soon as i posted this. XD

PT learn
Events
Conditions
Actions
Set PT_caster = (Triggering unit)
Trigger - Turn on Thomas Position <gen>
Trigger - Turn off (This trigger)

should be:

PT learn
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Past Tense

Actions
Set PT_caster = (Triggering unit)
Trigger - Turn on Thomas Position <gen>
Trigger - Turn off (This trigger)

lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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