HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Exploding From Artillary Problem

08-12-2006, 12:11 AM#1
illidan92
Okay I got triggers using the event "A unit dies" then on the action it uses "Dying unit". The problem is it gets "No unit" instead of "Dying unit" because all my units have an artillary type attack. Is there a way to make the units not explode but still have the AoE like artillary?
08-12-2006, 02:21 AM#2
DioD
Make units no decay and it will not explode (i hope)
08-12-2006, 03:36 AM#3
Vexorian
Unless you have a wait before using (Dying unit) that shouldn't happen, if you don't have a wait there, try using (Triggering unit) instead
08-12-2006, 05:52 AM#4
illidan92
triggering unit eh? I'll try it out thx for replies!
08-12-2006, 06:34 AM#5
DioD
Quote:
Originally Posted by Vexorian
Unless you have a wait before using (Dying unit) that shouldn't happen, if you don't have a wait there, try using (Triggering unit) instead

false

exploded units return zero handle.
08-12-2006, 12:27 PM#6
SentryIII
I just thought of something. If you notice in a melee game, you'll notice that organic units (footmen, archers, etc.) explode when dying from an artillery attack, while mechanical units (seige engines, demolishers, etc.) don't explode. I haven't tried this, but it might have something to do with the "Art - Special" property, or the mechanical unit classification.
08-12-2006, 12:51 PM#7
MeanMachine
Actually, the solution is quite simple. Artillery units use a special Weapon Type - Artillery (wow, noone could guess that name). It's why units killed by Artillery explode. Just change 'Combat - Weapon Type' to something else, for example Missile (splash).
08-12-2006, 01:13 PM#8
Vexorian
Quote:
Originally Posted by DioD
false

exploded units return zero handle.
Trigger:
dies
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Game - Display to (All players) the text: (Name of (Triggering unit))
Trigger:
explode
Collapse Events
Player - Player 1 (Red) Selects a unit
Conditions
Collapse Actions
Unit - Explode (Triggering unit)

When I click a footman he explodes and the message says "footman"
08-12-2006, 06:27 PM#9
DioD
Exploded units takes same handle ID.

Collapse JASS:
function inittest takes nothing returns nothing
    local unit T = CreateUnit(Player(0),'hpea',0,0,0)
    call SetUnitExploded(T,true)
    call KillUnit(T)
    set T = null
endfunction

After a creation of other unit first will no more return any name.

Run this function for different units types.
Or use 0.00 timer it will return null too.
08-12-2006, 11:47 PM#10
illidan92
He is right though if you have a wait it returns nothing because in my trigger for when a player unit dies, it plays a special (and cool) death sound at that player and the camera rumbles. But it waits 1 second to stop the rumbling, and I found it keeps rumbling forever, and triggering unit does nothing.

That also explains the bug causing players to not revive.
08-12-2006, 11:49 PM#11
Vexorian
Quote:
Originally Posted by DioD
Exploded units takes same handle ID.

Collapse JASS:
function inittest takes nothing returns nothing
    local unit T = CreateUnit(Player(0),'hpea',0,0,0)
    call SetUnitExploded(T,true)
    call KillUnit(T)
    set T = null
endfunction

After a creation of other unit first will no more return any name.

Run this function for different units types.
Or use 0.00 timer it will return null too.
That wasn't the point, the point is that during the death event exploded units still exist. They are removed instantly after the event time, so if you have a wait then they start returning null, that was the point of the post you claimed to be false.
08-12-2006, 11:58 PM#12
illidan92
Does missle (splash) give the same effect as artillary except no exploding? It seems to be but I want to know for sure before releasing the new version.
08-13-2006, 12:04 AM#13
Vexorian
what's the actual problem of the code though?

If you capture the unit with a local variable at the start of the actions, then you would kidnap the unit's handle.

So no other unit would take its place.

You can after that check if the unit still exists or not by comparing its max hp, if the max hp is 0 you can be sure that the unit was removed.

I know this because I needed to handle this in many spells like corpse explosion for example.
08-13-2006, 12:09 AM#14
DioD
I lost my demo trigger, but i returned null from H2I on dead units.
Cause unit empty handle instantly after death, and trigger runed on death event return GetDyingUnit() as null.
08-13-2006, 12:23 AM#15
illidan92
The problem was in reviving and in that trigger I mentioned above it would return no unit because I would have a wait. But now i'm using missle (splash) and it works fine but im wondering if it has the same effect as artillary except without the explosion.

Oh removing decay is better and it seems to work i'll do that instead.