HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problems with trigger

12-31-2008, 07:52 AM#1
dabest2503
Trigger:
Holy Bolts
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Holy Bolts
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 250.00 of (Target point of ability being cast) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))) and do (Actions)
Collapse Loop - Actions
Set TempGroup = (Last created unit group)
Else - Actions
Collapse Unit Group - Pick every unit in (Units within 250.00 of (Target point of ability being cast) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to True)))) and do (Actions)
Collapse Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((20.00 x (Real((Level of Holy Bolts for (Triggering unit))))) x (Real((Number of units in (Units within 250.00 of (Target point of ability being cast) matching ((Matching unit) Equal to TempUnit)))))))
Floating Text - Create floating text that reads (+ + (String(((20 x (Level of Holy Bolts for (Triggering unit))) x (Number of units in (Units within 250.00 of (Target point of ability being cast) matching ((Matching unit) Equal to TempUnit))))))) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100%, 100%, 100.00%), and 0.00% transparency

This trigger was meant to damage enemy units within a range of 250 of the target spot, and heal all allied units within 250 range of the target spot for ((20 x Lvl of spell) x Number of enemy units in 250 range). I removed the other Actions which doesn't have to do with this problem.

I added the floating text to see how much it would heal allies. The problem is, it only heals (20 x Lvl of spell)HP, ignoring the amount of enemy units in the area.

Is there a way to fix this?
12-31-2008, 09:00 AM#2
Bobo_The_Kodo
Quote:
(Real((Number of units in (Units within 250.00 of (Target point of ability being cast) matching ((Matching unit) Equal to TempUnit)

Where do you set tempunit?
12-31-2008, 09:14 AM#3
tamisrah
Trigger:
Set TempGroup = (Units within 250. blablabla)
Set TempInt = (Number of units in TempGroup)
call DestroyGroup(TempGroup)
Then use 'TempInt' as an argument in your healfunction.
In your current trigger you mixed up 'TempGroup' and 'TempUnit' and used a quite strange way to set your unitgroup although it might actually work this way ^^
12-31-2008, 11:08 AM#4
Themerion
Yeah, use TempInt, but go all the way and store the damage/heal in it.

Trigger:
Holy Bolt
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Holy Bolt
Collapse Actions
Set TempGroup = (Units within 250.00 ... matching (IsEnemy ...)
Set TempInt = 20*(Count Units In Group TempGroup)*(Level of (Ability being cast) for (Triggering unit))
Collapse Unit Group - Pick every unit in (Units within 250.00 ... matching (Is Ally ...) and do (Actions)
Collapse Loop - Actions
Unit - Set life of (Picked unit) to ((Real(TempInt)) + (Life of (Picked unit)))

Since you don't seem to be comfortable with variables, I've left out the leak-cleaning parts (there are plenty of tutorials on that, should you feel it is important).
12-31-2008, 03:59 PM#5
Bobo_The_Kodo
Couldn't you do this:

Trigger:
Holy Bolt
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Holy Bolt
Collapse Actions
Set TempGroup = (Units within 250.00 ... matching (IsEnemy ...)
Set TempInt = 20*(Count Units In Group TempGroup)*(Level of (Ability being cast) for (Triggering unit))
Collapse Unit Group - Pick every unit in (TempGroup) and do (Actions)
Collapse Loop - Actions
Unit - Set life of (Picked unit) to ((Real(TempInt)) + (Life of (Picked unit)))