wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-14-2006, 10:24 PM   #1
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default Jumping Spell Template v2

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: jpg Jump.jpg (168.5 KB, 501 views)
Attached Files
File Type: w3x Jumping Spell Template v2.w3x (102.9 KB, 386 views)
__________________

Last edited by emjlr3 : 04-19-2008 at 07:23 PM.
emjlr3 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-14-2006, 10:40 PM   #2
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

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.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 03-15-2006, 04:19 AM   #3
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

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
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 03-15-2006, 06:31 AM   #4
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

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
__________________
emjlr3 is offline   Reply With Quote
Old 03-15-2006, 07:26 AM   #5
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

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.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 03-15-2006, 03:07 PM   #6
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

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?
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 03-15-2006, 07:13 PM   #7
mikke95
User
 
mikke95's Avatar
 
Join Date: Mar 2006
Posts: 92

Submissions (2)

mikke95 is on a distinguished road (18)

Default

Hey cool 3/5 ;) do more good spells!
mikke95 is offline   Reply With Quote
Old 03-15-2006, 09:15 PM   #8
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

3/5....what is wrong, why is this template only 60% complete, please tell me so i can improve it
__________________
emjlr3 is offline   Reply With Quote
Old 03-15-2006, 09:57 PM   #9
Jacek
Banned
 
Join Date: Dec 2004
Posts: 1,095

Submissions (1)

Jacek is a jewel in the rough (164)Jacek is a jewel in the rough (164)

Send a message via MSN to Jacek
Default

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.
Jacek is offline   Reply With Quote
Old 03-21-2006, 01:23 PM   #10
nooK
n1nja
 
nooK's Avatar
 
Join Date: Dec 2005
Posts: 211

nooK will become famous soon enough (30)nooK will become famous soon enough (30)

Default

runs smooth, very good, but it needs the possibility to stun on impact. then it would be 5/5 :)
nooK is offline   Reply With Quote
Old 03-21-2006, 01:29 PM   #11
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

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
__________________

Last edited by emjlr3 : 03-21-2006 at 01:30 PM.
emjlr3 is offline   Reply With Quote
Old 04-07-2006, 09:11 PM   #12
moonliterhythm
User
 
Join Date: Mar 2006
Posts: 71

moonliterhythm has little to show at this moment (8)

Default

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
moonliterhythm is offline   Reply With Quote
Old 04-07-2006, 11:18 PM   #13
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

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.

Last edited by shadow1500 : 04-07-2006 at 11:21 PM.
shadow1500 is offline   Reply With Quote
Old 04-08-2006, 12:58 AM   #14
PipeDream
Moderator
 
PipeDream's Avatar


Code Moderator
 
Join Date: Feb 2006
Posts: 1,405

Submissions (6)

PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)

Default

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.

Last edited by PipeDream : 04-08-2006 at 12:59 AM.
PipeDream is offline   Reply With Quote
Old 04-08-2006, 01:53 AM   #15
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

i dont think anyone can click accuratly enough to hit the exact center of the unit..
shadow1500 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 06:32 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services