158 posts Serbia & Montenegro, Serbia, Belgrade. joined
#1
Need help creating a Rewind spell.
I'm trying to create a spell based of PoP: Rewind Time. I tried it with GUI by setting a rewind region every 5 seconds, but when I cast the spell, it gets me to center of map. Can somebody help me 'cus I didn't understood Daelin's JASS Tut? But note this: Since I don't have any patch(I use game version 1.07)those who have patches won't do me any good. The spell could use nice effect of walking backwards.
158 posts Serbia & Montenegro, Serbia, Belgrade. joined
#3
Don't tell me that you don't know Prince of Persia! Well, if anyone played any Prince of Ubisoft series then he will know what I mean. I need to rewind time and bring my hero back where he has been 10 seconds ago. Got it?
Rewind Cast Events: A unit begins casting an ability Conditions: Ability being cast equal to Rewind Actions: Instantly move casting unit to RewindPos[RewindGen-10]
Rewind Generate Events: Every 5.00 seconds Conditions: Actions: Set RewindPos[RewindGen]=RewindPos[RewindGen+1] and I can't go any further
EDIT:I also could use the nice backwards walking effect during transport.
Backwards walking effect is an animation, and unless a unit already has that animation, I believe you'd have to create it, or set Unit> Animation Walk to -100% or something if you can do anything like that.
Try setting the variable when the spell is cast, instead of every 5 seconds, unless that's actually what the spell is, then nevermind.
Oh, I see your problem, you're not setting either variable to the position of the hero. The default position is the center of the map (0,0) so unless you specify a point or a unit, it just keeps using that point.
you will ahve to give a better picture of what you want this spell to do. Firstly does it freeze all other units or does Prince only become invincible. Second to make the Prince "walk backwards" you will need to set looping walk animation and use looping move unit instantly facing direction GUI. Something like
action: set PrinceLoc=locationunit(prince) set D=(distancefrom(PrinceOriginalLoc)toLocationofUnit(Prince))/20 For every integer 1-(D) do set animation Prince(walk) wait .1 seconds (GUI cant do less than .1, JASS can) set PrinceNewLoc=pointwpolaroffset PrinceOriginalLoc offset distance ((D-intA)*20) offset degrees (angle between PrinceOriginalLoc and locationunit(Prince) Move instantly to PrinceNewLoc facing (PrinceLoc) endloop set PrinceOriginalLoc=location of unit(prince) customscript: Set udg_PrinceLoc=null customscript: set udg_D=null