HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Not Running Properly

04-15-2007, 03:39 AM#1
Phish-Paste
Trigger:
ahhh
Events
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 400.00 of RelinquishPoints[1]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is dead) Equal to True
Collapse Then - Actions
Unit Group - Add (Picked unit) to RelinquishDeathGroup
Set RelinquishInteger = ((25 x (Level of Reliquish for RelinquishCaster)) x (Number of units in RelinquishDeathGroup))
Set RelinquishPoints[2] = (Position of (Picked unit))
Special Effect - Create a special effect at RelinquishPoints[2] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove (Picked unit) from the game
Custom script: set bj_wantDestroyGroup=true
Collapse Unit Group - Pick every unit in (Units within 150.00 of RelinquishPoints[2]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an ally of (Owner of RelinquishCaster)) Not equal to True
Collapse Then - Actions
Unit - Cause RelinquishCaster to damage (Picked unit), dealing ((Real(RelinquishInteger)) / 2.00) damage of attack type Spells and damage type Normal
Custom script: call RemoveLocation(udg_RelinquishPoints[2])
Else - Actions
Else - Actions


Well parts of the trigger works, BUT the parts where units are supposed to be healed and/or damage does not work. Anyone know why? I've checked through it several times, but everything seems to work, cept the pointed out ones.
04-15-2007, 08:25 AM#2
blu_da_noob
A nested Unit Group loops don't always behave nicely. I think there's some trick for GUI wherein you have your first Unit Group loop which runs a separate trigger and that trigger has the actions (picked unit should still work... I think) and has a Unit Group loop inside it. I'm not sure if it actually works, just something I recall. In reality, JASS is just much better for this.
04-15-2007, 04:55 PM#3
Dil999
If you have a unit group inside a unit group, you cant do picked unit. Instead, make 2 variables (PickedUnit and PickedUnit2) and set those variables to the units, etc.