HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Limiting Unit summons

03-04-2006, 03:12 AM#1
SomeStranger
Ok, I am creating a move called "Hunting Trap" and I am trying to place limits on the amount of traps you can create. The skills hunting trap itself is based off of the serpent ward summoning skill. The goal of these two triggers is to limit the amount of traps that can be cast, and if there are too many, remove the one created first (the one created longest ago). I am not sure why this is not working at this point....

(Another note: I have also added limitations so that if nets are summoned within 800 units of each other the first one created is removed)


Trigger:
Summon Trap Checks
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Hunting Trap
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 800.00 of (Target point of ability being cast)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to Deactivated Trap
Collapse Then - Actions
Unit - Kill (Picked unit)
Collapse Else - Actions
Do nothing
Unit - Kill TrapToDestroy[1]
Collapse For each (Integer A) from 1 to (Level of Hunting Trap for (Triggering unit)), do (Actions)
Collapse Loop - Actions
Set TrapToDestroy[(Integer A)] = TrapToDestroy[((Integer A) + 1)]

Trigger:
Summon Trap Checks 2
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Hunting Trap
Collapse Actions
Wait 2.00 game-time seconds
Collapse Unit Group - Pick every unit in (Units within 600.00 of (Target point of ability being cast)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to Deactivated Trap
Collapse Then - Actions
Set TrapToDestroy[(Level of Hunting Trap for (Casting unit))] = (Picked unit)
Collapse Else - Actions
Do nothing
03-04-2006, 05:18 AM#2
TaintedReality
After you have called a Wait in a trigger (your second one), the Target Point of Ability Being Cast variable is on longer stored. So, before the wait define a variable called TempPoint or something and set it to Target Point of Ability Being Cast, then use TempPoint after the wait.
03-04-2006, 11:28 AM#3
SomeStranger
Thanks! I never realized that was the case. For anyone who cares or wants to do something like this in the future, I ended up combining the triggers into one. Turns out the the "Finishes casting an ability" does not always fire correctly if used right after the "Begins casting an ability" if the casting time of said ability is too short.