HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Jump Template

03-14-2006, 09:24 PM#1
emjlr3
Jumping Spell Template v2

A re-release of my old jump template, the first of its kind mind you, that I simply ported to structs and updated some of the non-optimized parts of. Its a simple template for simple needs, however, its easy to use and works as intended.
This allows you to jump a unit from here to there, while being able to edit every little aspect you can think of: speed, animation, effects, area, damage, arc, and even the offset between where the unit lands and where the spell was cast.

Version Info:
  • 3: Jumping Spell Template v2 - Now works in radians, a few other minor improvements to the code, a pathability check is now ran to keep jumping units in the map, now damages all ground units correctly
  • 2: Jumping Spell Template v1 - Ported to structs, updated some stupid coding methods, made it an actual template :), new test map!
  • 1: Jump Template - Original release
Expand spell code:

Please test, comment, and enjoy!
Attached Images
File type: jpgJump.jpg (168.5 KB)
Attached Files
File type: w3xJumping Spell Template v2.w3x (102.9 KB)
03-14-2006, 09:40 PM#2
Blade.dk
I don't see why you are using a custom "fly trick" ability, when you could just have used Medivh's Crow Form ability, which is already in the game and works perfectly?

Also, a thing that could be changed to optimize it would be using Atan2 instead of Atan2BJ. Then the returned angle would also be in radians, so you would not have to convert it everytime, hitting performance.

I also think that allowing users to change the distance between the targeted point, where he hits the ground with his sword, and the point where he actually lands should be changeable by the user.

Some models does not work too well with normal animation names, so an option to use animation indexes instead would be nice. Just a suggestion though.

Else it is pretty good, not really very original though. I am approving it anyways, but try to do some thing with the two things I've mentioned above.
03-15-2006, 03:19 AM#3
Chuckle_Brother
Gives a pretty decent arc to it. But it still uses handles, which are lame. Also it uses locations. Which are also super lame.

But meh, looks pretty cool. GJ
03-15-2006, 05:31 AM#4
emjlr3
updated to comply with Blades suggestions(even though Atan2BJ was used only once, i changed that too), though I didnt really get what you meant about the "animation indexes", i duno what those are

btw, I use 'Fly Trick', which is just meta, which does the same thing as crow form(AFAIK), allows the units fly height to be changed

and Chuckle, I use 1 location, once, which is an unavoidable one, this alone does not slow the spell down nor make it 'lame'

And handlers too are fine, if ppl prefer tables, it just a matter of changing the names of the things to that for tables
03-15-2006, 06:26 AM#5
Blade.dk
Don't call them handlers. The name of the type is handle, handles in the plural. The functions are called the Local Handle Vars. This is not to nitpick, but it is sad to see a guy asking for help with his script that is bugged, because he saw someone typing interger or handler and then writes that in his script. Please aviod that.

And yes, I know Metamorphosis can do the same, but what is the need for a custom ability when it can do without?

And yes, you only use Atan2BJ once, but you converted the real it returns in degress several times to radian everytime the timer expired, which was worthless.

Animation indexes are a way to play a specific animation of a unit, for example SetUnitAnimation does not always play the right animation, when you want to play an attack animation and the unit has multiple. SetUnitAnimationByIndex takes an integer instead of a string that integer is the number that the animation comes in in the mdl file of the model.
03-15-2006, 02:07 PM#6
Chuckle_Brother
Quote:
Originally Posted by Blade.dk
Animation indexes are a way to play a specific animation of a unit, for example SetUnitAnimation does not always play the right animation, when you want to play an attack animation and the unit has multiple. SetUnitAnimationByIndex takes an integer instead of a string that integer is the number that the animation comes in in the mdl file of the model.

Teacher teacher, I have a question!

Since he used the slam anim though, and he slowed down the animation(to properly align the ending with the landing), is there any way to get the length of an animation with jass? or do you need to throw in a calc to properly slow down the unit along with a value given in a constant function in the config section?
03-15-2006, 06:13 PM#7
mikke95
Hey cool 3/5 ;) do more good spells!
03-15-2006, 08:15 PM#8
emjlr3
3/5....what is wrong, why is this template only 60% complete, please tell me so i can improve it
03-15-2006, 08:57 PM#9
Jacek
Quote:
Originally Posted by emjlr3
3/5....what is wrong, why is this template only 60% complete, please tell me so i can improve it
Ignore him... he probably gave you 3/5 because it isn't DotA direct damage spell with crap eyecandy.
03-21-2006, 12:23 PM#10
nooK
runs smooth, very good, but it needs the possibility to stun on impact. then it would be 5/5 :)
03-21-2006, 12:29 PM#11
emjlr3
add a dummy caster at the end, order him to stomp when u land

maybe ill add that in later, i guess a jump template isnt complete w/o an end AOE spell casted
04-07-2006, 08:11 PM#12
moonliterhythm
how do you add this spell to a map?

i copied the jump ability, the fly trick ability, and the actual trigger, but when i go to run the game, i get a ton of script errors
04-07-2006, 10:18 PM#13
shadow1500
i think a good tool would be a spell importer, which would import all object data from one map to another, and not copy a functionif it already exists in a map (handle variables?)
I've been asked like 5 times already on how to import my system/spell.
04-07-2006, 11:58 PM#14
PipeDream
Quote:
And yes, you only use Atan2BJ once, but you converted the real it returns in degress several times to radian everytime the timer expired, which was worthless.
Collapse JASS:
    local real ang = bj_RADTODEG * Atan2((GetLocationY(l)-uy),(GetLocationX(l)-ux))
    local real x = GetLocationX(l) - Jump_Template_Difference() * Cos(ang * bj_DEGTORAD)
    local real y = GetLocationY(l) - Jump_Template_Difference() * Sin(ang * bj_DEGTORAD)   
bj_DEGTORAD*bj_RADTODEG = 1.0 was Blade.dk's point- Convert to Atan2 so that you don't have to use them at all.

Additionally, you don't need to compute Cos/Sin more than once, or even at all.
http://www.wc3campaigns.net/showthread.php?t=81954

I suggest making the number of times the loop runs be a general parameter or, make it clear how to modify it. Instead of giving the user a .01s timer control, I would give them a measure of graininess (distance moved per step), along with a speed (distance moved per time between steps) and then compute the rest of your parameters.

Collapse JASS:
function Jump_Template_Parabola takes real dist, real maxdist,real curve returns real
    local real t = (dist*2)/maxdist-1
    return (-t*t+1)*(maxdist/curve)
endfunction
Embarassed I didn't notice this when I wrote it, but this will divide by zero and fail out if you maxdist is 0, IE when you target your own location. Cheap and dirty fix: (maxdist+0.01) or put (+0.01) in the square root.
04-08-2006, 12:53 AM#15
shadow1500
i dont think anyone can click accuratly enough to hit the exact center of the unit..