Hi there,
So i wanted to make this time travel ability for a hero to go back in time like 20 sec or some. I searched the forum for the ability or an idea that was cinda the same and found this:
First create a Game Cache:
Trigger:
Events
Map Initialization
Conditions
Actions
Game Cache - Create a game cache from TimeTravel.w3v
Set GameCache = (Last created game cache)
Then Store the Unit:
Trigger:
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Game Cache - Store <unit> as <string> of <string> in GameCache
Then load it
Trigger:
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Time Travel
Actions
Game Cache - Restore <string> of <string> from GameCache for (Owner of TimeTravel) at <point> facing <angle>
So if you would want to be able to go back 5 seconds in time you could use the following actions:
Trigger:
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TimeTravel Less than 10
Then - Actions
Set TimeTravel = (TimeTravel + 1)
Else - Actions
Set TimeTravel = 1
Game Cache - Store TimeTravelUnit as (Time + (String(TimeTravel))) of Time in Game Cache
Set TimeTravelPoint[TimeTravel] = (Position of (TimeTravelUnit))
Set TimeTravelAngle[TimeTravel] = (Facing of (TimeTravelUnit))
Then load the values
Trigger:
Events
Unit - A unit Finishes casting an Ability
Conditions
(Ability Being Cast) Equal To Time Travel
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TimeTravel Equal to 10
Then - Actions
Set TimeTravelTemp = 1
Else - Actions
Set TimeTravelTemp = (TimeTravel + 1)
Unit - Remove (Casting unit) from the game
Game Cache - Restore (Time + (String(TimeTravelTemp)) of Time from GameCache for (Owner of (Casting unit)) at TimeTravelPoint[TimeTravelTemp] facing TimeTravelAngle[TimeTravelTemp]
Camera - Pan camera for (Owner of (Casting unit)) to TimeTravelPoint[TimeTravelTemp] over 0.00 seconds
Selection - Add (Last restored unit) to selection for (Owner of (Casting unit))
Tho as bad as i am in editor i never worked with game cache before, so the question is what are the variables in this giving example and what cind of variables are they. Like
Game Cache - Restore (Time + (String(TimeTravelTemp)) of Time from GameCache for (Owner of (Casting unit)) at TimeTravelPoint[TimeTravelTemp] facing TimeTravelAngle[TimeTravelTemp]
Time is a variable i guess but what cind of variable just an real variable as in time in real time or? and same goes for the other variables.
So i wanted to make this time travel ability for a hero to go back in time like 20 sec or some. I searched the forum for the ability or an idea that was cinda the same and found this:
First create a Game Cache:
Trigger:
Events
Map Initialization
Conditions
Actions
Game Cache - Create a game cache from TimeTravel.w3v
Set GameCache = (Last created game cache)
Then Store the Unit:
Trigger:
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Game Cache - Store <unit> as <string> of <string> in GameCache
Then load it
Trigger:
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Time Travel
Actions
Game Cache - Restore <string> of <string> from GameCache for (Owner of TimeTravel) at <point> facing <angle>
So if you would want to be able to go back 5 seconds in time you could use the following actions:
Trigger:
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TimeTravel Less than 10
Then - Actions
Set TimeTravel = (TimeTravel + 1)
Else - Actions
Set TimeTravel = 1
Game Cache - Store TimeTravelUnit as (Time + (String(TimeTravel))) of Time in Game Cache
Set TimeTravelPoint[TimeTravel] = (Position of (TimeTravelUnit))
Set TimeTravelAngle[TimeTravel] = (Facing of (TimeTravelUnit))
Then load the values
Trigger:
Events
Unit - A unit Finishes casting an Ability
Conditions
(Ability Being Cast) Equal To Time Travel
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TimeTravel Equal to 10
Then - Actions
Set TimeTravelTemp = 1
Else - Actions
Set TimeTravelTemp = (TimeTravel + 1)
Unit - Remove (Casting unit) from the game
Game Cache - Restore (Time + (String(TimeTravelTemp)) of Time from GameCache for (Owner of (Casting unit)) at TimeTravelPoint[TimeTravelTemp] facing TimeTravelAngle[TimeTravelTemp]
Camera - Pan camera for (Owner of (Casting unit)) to TimeTravelPoint[TimeTravelTemp] over 0.00 seconds
Selection - Add (Last restored unit) to selection for (Owner of (Casting unit))
Tho as bad as i am in editor i never worked with game cache before, so the question is what are the variables in this giving example and what cind of variables are they. Like
Game Cache - Restore (Time + (String(TimeTravelTemp)) of Time from GameCache for (Owner of (Casting unit)) at TimeTravelPoint[TimeTravelTemp] facing TimeTravelAngle[TimeTravelTemp]
Time is a variable i guess but what cind of variable just an real variable as in time in real time or? and same goes for the other variables.