HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How's this for a spell?

05-30-2006, 08:19 AM#1
CaptainPicard
I'm thinking of some spells for Aszune in Act II. I've not done much custom scripting of spells and special abilities so far--it's time to start!

But, for Aszune, I'm thinking of a spell called "Aurora" which elevates her off the ground (so she can no longer be attacked by land units) and then shoots arcs of lightning from her hands and feet as she channels the spell in mid-air.

I'm planning to script the lighting so that it really does "arc" (zig-zags in 3D) rather than just shoot in a straight line to its target. Also I'm thinking that each "strike" will consist of several 0.25-second arcs, all roughly the same shape but not quite, so the lightning looks really animated.

Finally, I'm thinking about making the spell a bit more intelligent in the way it strikes at opponents. It's a multi-target spell that covers an area within roughly 400 of the caster. As the ability level increases, I want to have less and less randomness in the way that targets get whacked so that the most vulnerable and / or the most important units are increasingly targeted.

Now, questions concerning the implementation:

1.) Making Aszune fly as she channels... it would seem I'll have to pull a unit switch here, but this could interfere with other ability cooldowns. I suppose one thing I could do would be to temporarily give the "real" Aszune the locust ability, make her vertices invisible, and create a dummy version of Aszune (flying) to take her place. I'd have to transfer damage taken by the dummy unit to the real one, and in the event of the dummy unit dying I'd have to have it fall to earth, kill the real Aszune, then remove the dummy unit right as I made Aszune visible again. In the event that the player stopped channeling the spell, Aszune got stunned, or the spell ended normally, I'd then lower Azsune back to earth and, once she got there, remove the dummy unit and give the real one back.

Now, to make the transitions smooth I'd need to play the same animations simultaneously on both units in the event that the caster was stunned, ordered to stop, or finished casting the spell. Would this be possible? I intend to set the flying unit's movement speed to zero so that Aszune can't effectively "jump" over obstacles when she uses it. Finally, is there any way I could make the abilities on the dummy Aszune appear to cool down as the others do? If not, I could of course just give her a set of abilities that look like the corresponding abilities on the real hero but with DISBTN-style darkened icons.

2.) Making the lightning travel in large arcs... I'm thinking what I'll do is create a series of invisible dummy units, have them fly at different heights, give them all a lightning attack ability (using the forked lightning model for the beam rather than the conventional, thicker white beam), and have them shoot at each other in sequence as lighting is fired from the Aszune dummy unit (she'll have two attacks, one that originates at her feet and the other that originates at her raised hand--I'm using the ROC Warden model for Aszune, btw). As one of the dummy units gets hit it will fire at the next one using a similar lightning attack ability.

Now, obviously I don't want the player to be able to select the dummy units. Would it be all right to give them all the locus ability, then (in three tirggered events with no waits in between) remove that ability, have the unit get attacked once, and replace the locust ability?

I think that I'll use a trigger action ("damage units in area") to actually deal the damage when the strikes finally reach their "targets." I'll gradually move the target areas (air and ground) around so that, as I said above, at higher ability levels they seek out tight clusters of heavily damaged and/or high-ranking units to focus more of the damage there.

Let me know also, if you've read this far, whether this sounds like a truly unique custom spell. I'm hoping so!

Thanks all!

Dave
05-30-2006, 09:02 AM#2
The)TideHunter(
It sounds like a very good spell, Goodjob :)

Quote:
Originally Posted by CaptainPicard
Now, to make the transitions smooth I'd need to play the same animations simultaneously on both units in the event that the caster was stunned, ordered to stop, or finished casting the spell. Would this be possible?

No, unfortunatly there is no way to detect what animation a unit is playing, although you can store infomation about this, say, a integer, when playing stand animation, set to 1, when walk animation, set to 2 etc.

Quote:
Originally Posted by CaptainPicard
Finally, is there any way I could make the abilities on the dummy Aszune appear to cool down as the others do? If not, I could of course just give her a set of abilities that look like the corresponding abilities on the real hero but with DISBTN-style darkened icons.

Dont use a dummy, it can all be done with the real 1. You can use Set unit flying height with the real 1.
(I will explain later how to make any unit classed as flying later.)

Quote:
Originally Posted by CaptainPicard
Now, obviously I don't want the player to be able to select the dummy units. Would it be all right to give them all the locus ability, then (in three tirggered events with no waits in between) remove that ability, have the unit get attacked once, and replace the locust ability?

Yea, just use the locust ability, to add it to a unit, you can use:
Trigger:
Custom script: call UnitAddAbility(Your Unit, 'Aloc')
Replace Your Unit with your dummy
'Aloc' is locus rawcode.
Or, you could add the ability through object editor which is easier.

Goodluck with this, if you need any more help just post

EDIT: O yea forgot to show you how to make a unit classed as flyable.
Just add stormcrow form then remove it, its then classed, like this:
Trigger:
Actions
Unit - Add Storm Crow Form to SomeUnit
Unit - Remove Storm Crow Form from SomeUnit
05-30-2006, 09:11 AM#3
Soultaker
First of all, this sounds like a really cool and custom spell :)

You should remember that if you add locust to a unit, you can't remove it again. So, I would create a dummy unit which only had the ability to cancel the current spell.

Then make it flying, with a trigger slowing rising it's height using the animation action.

While that, it would be cool if you made the dummy unit attackable, and made a trigger so if it were killed the real one were killed by the same unit. (Just use Get Attacking Unit() )

About the movement speed issuse, I would properly just set the dummy unit's movement speed to 0, and type to "None".

That should do the trick.. I don't remember how to get the lowest hp unit, but I think there is a JASS Snippet at WC3Jass.com

I'll check it out when I come home :)

- Soultaker

EDIT: The Tidehunter was faster than me :)

I forgot about classfication, you might just set the unit's classification to flying and remove it's ground, so you can raise it from the ground and not make it able to attacked from ground. But that's your choice...
05-30-2006, 09:12 AM#4
The)TideHunter(
Quote:
Originally Posted by Soultaker
You should remember that if you add locust to a unit, you can't remove it again. So, I would create a dummy unit which only had the ability to cancel the current spell.

Wrong, you can remove Locust ability, Pause and Unpause the until, the unit will have Aloc removed
05-30-2006, 11:54 AM#5
Chuckle_Brother
No, it screws the unit up, makes them non-single clickable.
05-30-2006, 02:14 PM#6
Soultaker
It can skrew up a lot of things, that's why I rather use dummy units, also to be safe :)

But yeah, single unit target is one of them.

- Soultaker

Btw. Do you got some more problems CaptainPicard?
05-30-2006, 03:33 PM#7
blu_da_noob
Quote:
Originally Posted by CaptainPicard
1.) Making Aszune fly as she channels... it would seem I'll have to pull a unit switch here, but this could interfere with other ability cooldowns. I suppose one thing I could do would be to temporarily give the "real" Aszune the locust ability, make her vertices invisible, and create a dummy version of Aszune (flying) to take her place. I'd have to transfer damage taken by the dummy unit to the real one, and in the event of the dummy unit dying I'd have to have it fall to earth, kill the real Aszune, then remove the dummy unit right as I made Aszune visible again. In the event that the player stopped channeling the spell, Aszune got stunned, or the spell ended normally, I'd then lower Azsune back to earth and, once she got there, remove the dummy unit and give the real one back.

Tidehunter touched on this, but didn't explain the power of the blizzard bug. If you take a unit with foot movement type then add and remove the Storm Crow ability to/from it, it causes the SetUnitFlyHeight function to affect the unit. The unit is still considered a ground unit, but its flying height can be manipulated as if it was a flying unit. This solves all of your 'dummy' problems.

Quote:
2.) Making the lightning travel in large arcs... I'm thinking what I'll do is create a series of invisible dummy units, have them fly at different heights, give them all a lightning attack ability (using the forked lightning model for the beam rather than the conventional, thicker white beam), and have them shoot at each other in sequence as lighting is fired from the Aszune dummy unit (she'll have two attacks, one that originates at her feet and the other that originates at her raised hand--I'm using the ROC Warden model for Aszune, btw). As one of the dummy units gets hit it will fire at the next one using a similar lightning attack ability.

Now, obviously I don't want the player to be able to select the dummy units. Would it be all right to give them all the locus ability, then (in three tirggered events with no waits in between) remove that ability, have the unit get attacked once, and replace the locust ability?

Lightning can be created by triggers, which may be preferable to having dummy units attacking one another. You would also have problems with locusted dummy units attacking each other, as locust would have to be removed from the target dummy for a short time to allow it to be attacked.
05-30-2006, 04:48 PM#8
The)TideHunter(
Quote:
Originally Posted by Chuckle_Brother
No, it screws the unit up, makes them non-single clickable.

Iv used the pause and unpause method on units with locust loads of times and iv never had a problem
05-30-2006, 06:01 PM#9
CaptainPicard
blu_da_noob--thanks for your reply. I thought about just creating the lightning. However, it seems that I can't create lightning in 3D so that it appears properly on the screen. I would certainly rather make the lightning using triggers, as you suggest, but from what I've seen the "Lightning Attack" ability actually looks like in should in 3D even if you move the camera, whereas trigger-created lightning has no sensitivity to flying height. Any way to get around this?

The)TideHunter(--thanks for your input, too! I like your suggestion about adding and then removing storm crow form, but if i'm exploiting a Blizzard bug would there not be some chance that it would be removed in a future patch?
05-30-2006, 06:03 PM#10
blu_da_noob
Collapse JASS:
native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning

Standard AddLightning (the one in GUI) only takes coordinates for x and y. AddLightningEx takes for x, y and z axes, so you can make it 'work in 3d'.

About the storm crow thing: there are few reasons why that shouldn't concern you.
A) Blizzard are too busy with WoW to consider any bug fixing in a WC3 patch
B) There would be an uproar if they did (just like if they fixed the return bug)
C) Your map would be far from the only one broken by such a change
D) Half of the cool things we are able to do are due to blizzard bugs