HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A new version of my Diablo II Summons

12-21-2003, 03:49 AM#1
Grater
This new patch is GREAT, now that the level of an ability can be determined from the hero unit itself the trigger has become a WHOLE lot cleaner.

Code:
Summon Quillbeast
    Events
        Unit - A unit Spawns a summoned unit
    Conditions
        (Unit-type of (Summoned unit)) Equal to Summon Dummy (Quillbeast)
    Actions
        Unit - Add QuillbeastChaosAbilities[(Level of Summon Quilbeast for (Summoning unit))] to (Summoned unit)
        Custom script:   call UnitAddAbilityBJ( 'Aloc', GetSummonedUnit())
        Custom script:   call UnitGuardUnitAIAdv(GetSummonedUnit(), GetSummoningUnit(), 200,600, 1.0,0.5)

Yep, just 3 action lines :). This has no summon animation so a specialFX should be added, or you can look at how I did it in the demo map (using a dummy unit with the sfx as it's model, with a short wait at the start)

The basic idea is to make a single dummy unit which works for ALL summon abilities, meaning you only need one dummy unit instead of one per summon. Thats not strictly true, for something like the beastmaster you:
Make a dummy unit for each spell. Bear, Quillbeast, Hawk. Then use a variant of the trigger above and a "chaos ability" array for each spell. Note the condition works on the type of summoned unit.

The alternate method is for heros like farseer, AM, etc that only summon one type of unit. In this case the condition is the type of the summoning unit, and any unit at all can be used for the summon dummy (the exception is chaos ability only works when transforming to a DIFFERENT unit)

Either way you need 1 custom ability per summon unit, which is mostly a copy-paste job, and I dont think it would bloat the map size much. Definitely it's much better than my original and should require considerably less effort.
12-27-2003, 04:22 AM#2
Extrarius
Are you sure the summoned creatures are still targetable? I tried doing exactly what you did (using a chaos ability, and I tried aloc on both the summoned unit, the summoning unit, and added as you did there) and ordering a unit to zap another unit with life drain didn't work. The original unit and the unit changed too were different units, but from the same base unit. Would that matter?
12-27-2003, 08:11 AM#3
Grater
It doesn't matter if the two units use the same base unit, make sure the chaos ability is actually firing (ie no research pre-req)

You should be able to target ChaosAloc'd units with any attack unit, just by right clicking on it. However this doesn't seem to work for air units, altough air units should be targettable by AI and triggers.
12-29-2003, 02:42 PM#4
Extrarius
I found an easy way to make any unit unselectable but still targetable using only 3 lines of jass:

Code:
function MakeUnitUnselectable takes unit u returns nothing
//Makes a unit unselectable but still targetable
    call UnitAddAbility(u, 'Aloc')
    call UnitRemoveAbility(u, 'Aloc')
    call SetUnitInvulnerable(u, false)
endfunction

It is much better than the chaos method because you don't have to make anything but the summonable the way you want it (and a trigger to make any summoned units unselectable and then give them the AI you want).
12-29-2003, 09:30 PM#5
Grater
Nice try but they have no collision and cannot be targetted by humans.
Adding call SetUnitPathing(u, true ) to the function didn't fix that, unfortunately.
12-29-2003, 09:56 PM#6
Extrarius
Oh well, it worked for my purpose (I just needed some units targetable by triggers but not selectable)
12-29-2003, 11:57 PM#7
Grater
It would work well for air summons too, because those suckers cant be targetted by humans even using the chaos method.