TimeLapse

sunshinex3

You can change this now in User CP.
Could i get some one to double check this trigger its not working for me.

Code:
Time Lapse Caster Initialization
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Time Warp (Nordizumu)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                timeLapse_currentInstances Equal to 0
            Then - Actions
                Countdown Timer - Start timeLapse_timer as a Repeating timer that will expire in 0.10 seconds
            Else - Actions
                Set timeLapse_whichUnit = (Triggering unit)
                Set timeLapse_currentInstances = (timeLapse_currentInstances + 1)
                Set timeLapse_caster[timeLapse_currentInstances] = timeLapse_whichUnit
                Set timeLapse_casterLoc[timeLapse_currentInstances] = (Position of timeLapse_whichUnit)
                Set timeLapse_casterHealth[timeLapse_currentInstances] = (Life of timeLapse_whichUnit)
                Set timeLapse_casterMana[timeLapse_currentInstances] = (Mana of timeLapse_whichUnit)
                Set timeLapse_casterFacing[timeLapse_currentInstances] = (Facing of timeLapse_whichUnit)

Second Trigger....



Code:
Time Lapse Periodic Event
    Events
        Time - timeLapse_timer expires
    Conditions
    Actions
        For each (Integer A) from 1 to timeLapse_currentInstances, do (Actions)
            Loop - Actions
                Set timeLapse_casterFacing[(Integer A)] = (Facing of timeLapse_caster[(Integer A)])
                Set timeLapse_casterHealth[(Integer A)] = (Life of timeLapse_caster[(Integer A)])
                Set timeLapse_casterMana[(Integer A)] = (Mana of timeLapse_caster[(Integer A)])
                Custom script:          if (udg_timeLapse_casterLoc[bj_forLoopAIndex] != null) then
                Custom script:              call RemoveLocation(udg_timeLapse_casterLoc[bj_forLoopAIndex])
                Custom script:    endif
                Set timeLapse_casterLoc[(Integer A)] = (Position of timeLapse_caster[(Integer A)])
Third Trigger....

Code:
Time Lapse Actions
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Time Warp (Nordizumu)
    Actions
        Set timeLapse_whichUnit = timeLapse_caster[(Integer A)]
        For each (Integer A) from 1 to timeLapse_currentInstances, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        timeLapse_whichUnit Equal to timeLapse_caster[(Integer A)]
                    Then - Actions
                        Unit - Move timeLapse_caster[(Integer A)] instantly to timeLapse_casterLoc[(Integer A)], facing timeLapse_casterFacing[(Integer A)] degrees
                        Unit - Set life of timeLapse_whichUnit to timeLapse_casterHealth[(Integer A)]
                        Unit - Set mana of timeLapse_whichUnit to timeLapse_casterMana[(Integer A)]
                        Special Effect - Create a special effect at timeLapse_casterLoc[(Integer A)] using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
                        Special Effect - Destroy (Last created special effect)
                        Skip remaining actions
                    Else - Actions
                        Do nothing
thats it unless i need more it looks like it should work im useing the roar ability with this trigger.
 

Accname

2D-Graphics enthusiast
I dont think we can help you with your triggers unless you tell us what those triggers are supposed to do and what they are doing wrong.
 

sunshinex3

You can change this now in User CP.
it's supposed to be time lapse from dota.

these triggers are used with an ability time lapse once that ability is cast then a timer is started and after the timer ends the units:

position
angel facing
health
mana

are all reset to what they were when the ability was cast.

i can see were it stores the variables not sure if anything else works... it doesnt do anything as of right now.
 
Last edited:

Accname

2D-Graphics enthusiast
I dont know dota.

Is this ability supposed to be used by more than 1 unit at a time? Or will there ever be only 1 unit using it? Will it be 1 unit total or 1 unit per player?
 

sunshinex3

You can change this now in User CP.
1 unit per-player hero ability

their can only be 12 maximum units in game each belonging to a different player.
 
Last edited:

Accname

2D-Graphics enthusiast
Here is a solution that uses 2 triggers:

This first trigger is called when the time travel ability is used
Trigger:
  • OnUse
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Travel
    • Actions
      • -------- Player number is used as an index into all of our array data structures --------
      • Set tmpInt = (Player number of (Owner of (Triggering unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeTravel_Unit[timeTravel_Count] Equal to No unit
        • Then - Actions
          • -------- We count the number of units currently using time travel with this variable --------
          • -------- We only increment this variable if our unit was not already using time travel --------
          • Set timeTravel_Count = (timeTravel_Count + 1)
          • Trigger - Turn on OnPeriodic <gen>
        • Else - Actions
          • -------- The unit was already using time travel, we dont have to count it twice --------
      • -------- We store all the unit state which is supposed to be reset in time travel in these arrays --------
      • Set timeTravel_Unit[tmpInt] = (Triggering unit)
      • Set timeTravel_Hp[tmpInt] = (Life of (Triggering unit))
      • Set timeTravel_Mp[tmpInt] = (Mana of (Triggering unit))
      • Set timeTravel_Facing[tmpInt] = (Facing of (Triggering unit))
      • Set timeTravel_Pos[tmpInt] = (Position of (Triggering unit))
      • -------- This is the time (in tenths of a second) until the time travel effect starts --------
      • Set timeTravel_Timer[tmpInt] = 90


This second trigger is running down the timers and doing the actual time travel stuff
Trigger:
  • OnPeriodic
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • timeTravel_Count Greater than 0
    • Actions
      • -------- Iterate over all player numbers --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • -------- We just set this for convenience --------
          • Set tmpInt = (Integer A)
          • -------- Check whether this player is currently using time travel --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • timeTravel_Timer[tmpInt] Greater than 1
            • Then - Actions
              • -------- Count down the time travel timer for this player --------
              • Set timeTravel_Timer[tmpInt] = (timeTravel_Timer[tmpInt] - 1)
            • Else - Actions
              • -------- Check whether time travel is just ending for a player --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • timeTravel_Timer[tmpInt] Equal to 1
                • Then - Actions
                  • -------- Copy all the saved state of the unit from before. --------
                  • -------- Attention! This will fail if the unit is dead! You need extra code for that. --------
                  • Unit - Set life of timeTravel_Unit[tmpInt] to timeTravel_Hp[tmpInt]
                  • Unit - Set mana of timeTravel_Unit[tmpInt] to timeTravel_Mp[tmpInt]
                  • Unit - Move timeTravel_Unit[tmpInt] instantly to timeTravel_Pos[tmpInt], facing timeTravel_Facing[tmpInt] degrees
                  • -------- Clean up the location data to avoid memory leaks --------
                  • Custom script: call RemoveLocation(udg_timeTravel_Pos[udg_tmpInt])
                  • -------- Count down the number of active time travel users --------
                  • Set timeTravel_Count = (timeTravel_Count - 1)
                  • -------- Reset the unit data. We use this variable to check whether we are already time traveling in the OnUse trigger --------
                  • Set timeTravel_Unit[tmpInt] = No unit
                • Else - Actions
      • -------- We can stop this trigger to save performance if it is not needed --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeTravel_Count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


These are the variables used: (Player number is used as an index into all array variables)
* timeTravel_Count // used to count how many units are currently using time travel. This is only a performance thing so that we can stop the periodic trigger if it is not needed
* timeTravel_Unit[] // the unit doing the time travel.
* timeTravel_Timer[] // a time (in tenths of a millisecond) until a players unit is supposed to travel back in time.
* timeTravel_Facing[] // saves the facing angle of the time travel unit.
* timeTravel_Pos[] // saves the position of the time travel unit. Needs to be cleaned to avoid memory leaks.
* timeTravel_Hp[] // saves the HP of the time travel unit.
* timeTravel_Mp[] // saves the MP of the time travel unit.
* tmpInt // used only for convenience to make the triggers more readable.


I also attached an example map where you can test these triggers out.
 

Attachments

sunshinex3

You can change this now in User CP.
YES thank you!! this trigger makes time laps work perfectly let me state these variable types

* timeTravel_Count // Integer
* timeTravel_Unit[] // Real Array(1)
* timeTravel_Timer[] // Real Array(1)
* timeTravel_Facing[] // Real Array(1)
* timeTravel_Pos[] // Point Array(1)
* timeTravel_Hp[] // Integer Array(1)
* timeTravel_Mp[] // Unit Array(1)
* tmpInt //Integer

I made these variables and then coppied the triggers over enabled the action the disabled its self automaticly upon copy and it worked perfectly again useing this trigger with roar ability works great ty accname.
 
Last edited:
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    it is not that power consumption went up it was available capacity went down with power plants freezing
  • Varine Varine:
    What a fucking disaster. Are all of the Texas people okay? I see TH is, are we the only two?
  • Varine Varine:
    How have the other states held up? I just got power back so I have no idea what's going on, we didn't get warning
  • Varine Varine:
    Why the fuck didn't they fix this ten years ago when it happened?
  • Blackveiled Blackveiled:
    I'm in it with you and TH as well. My power has been in and out, and I have a ruptured pipe that I need to fix, shouldn't be too bad to fix myself.
  • Varine Varine:
    I hope you're staying warm! Apparently the supply is coming up so hopefully we can get back to normal power soon, mine has been on for six hours now.
  • M Mulciberxp:
    My power has been off most of the last 2 days. We had a generator installed 3 years ago though, so we're staying warm. Water is another issue...
  • The Helper The Helper:
    Where I live has a pool so we are using that to get water to flush the toilets. We have enough bottled water to drink and brush teeth and stuff but it has been a few days and no shower though....
  • Varine Varine:
    I had some water in gallon jugs, and got our water back on yesterday. We don't seem to have any leaks, but I haven't crawled down there to look yet.
  • The Helper The Helper:
    still no water I cannot remember when I last showered now I know how they felt in the old west lol
  • Varine Varine:
    My poor plants are happy, they aren
  • Varine Varine:
    aren't used to going this long without water or lights or normal heat. I think a couple of them froze, but they look like they'll make it
  • Varine Varine:
    Well one of them is pretty rough but I think it was sick to begin with, that one always had some problems.
  • jonas jonas:
  • jonas jonas:
    ???
  • Ghan Ghan:
    That is such a Texas thing to say lol
  • midnight8 midnight8:
    a positive could come out of this. So many people trapped at home could put a dent in the covid numbers in Texas
  • Varine Varine:
    That dude, Tom Boyd, is really upset about the backlash from his "it's your fault you're freezing" thing because he claims he resigned before saying it, so it wasn't like he said it in his official capacity or anything.
  • jonas jonas:
    Almost as if he was saying "screw you guys, I'm going home"
  • Varine Varine:
    I'm fairly new here still but that seems to be the analogous message by several of our politicians.
  • vypur85 vypur85:
    Nobody?
  • jonas jonas:
    Hi vypur85, long time no see
  • tom_mai78101 tom_mai78101:
    Hi vypur85, long time no see.
  • The Helper The Helper:
    We are all somebody
  • Varine Varine:
    I kinda like being nobody tho.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top