HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Region wont move.

08-14-2008, 01:44 AM#1
Argo
I'm trying to move a region to the point of a summoned unit, but the region doesn't seem to move. I have a special effect trigger that makes an effect over the region when moved, the effect is created at the point of the summoned unit but the region fails to move with it. When i enter the region the entering unit dies, but the region is not under the special effect instead, still at the same place it started. What am i doing wrong?

Trigger:
Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Melee Game - Use melee time of day (for all players)
Set rects[0] = spike1 <gen>
Set rects[1] = spike2 <gen>
Set rects[2] = spike3 <gen>
Set rects[3] = spike4 <gen>
Trigger:
makeSpike
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Death Spike 3
Collapse Actions
Unit - Create 1 Death Spike Ward for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
Region - Center rects[0] on (Position of (Last created unit))
Unit - Remove (Last created unit) from the game
Special Effect - Destroy testFX[0]
Special Effect - Create a special effect at (Center of spike1 <gen>) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
Set testFX[0] = (Last created special effect)
Set spikeOnline[0] = True
Trigger:
enterSpike
Collapse Events
Unit - A unit enters spike1 <gen>
Collapse Conditions
spikeOnline[0] Equal to True
Collapse Actions
Wait 0.20 seconds
Set spikeOnline[0] = False
Unit - Create 1 Death Spike for Neutral Passive at (Center of spike1 <gen>) facing Default building facing degrees
Set spikeCreated[0] = (Last created unit)
Unit - Explode (Entering unit)
Wait 2.00 seconds
Unit - Remove spikeCreated[0] from the game
08-14-2008, 05:52 AM#2
ToukoAozaki
The code below will explain everything.

Collapse Blizzard.j:
//===========================================================================
function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event
    local region rectRegion = CreateRegion()
    call RegionAddRect(rectRegion, r)
    return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction

When you register "enters region" event, basically a region based on the rect you provided is created and then registered to the region event. This means the region actually responsible for the event won't change even if you change the source rect.

In order to achieve what you want, the most practical way is to create and assign a global region variable, then register this region to the event. Whenever you need changes, clear and add the desired rect to the region.
08-14-2008, 11:42 AM#3
rulerofiron99
For GUI, give the Ward unit an attack and trigger it from that.