HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GUI Triggering Issue

07-15-2007, 06:43 PM#1
Deathlust
Pardon the poor triggering, but there's something that's screwing up in this...
That is... when I change it ever so slightly.

ATM, this trigger works fine at the very end with a "Do Nothing" in the else actions. If I change that with a skip all remaining actions (Which I want there in case another player casts the spell so the damage won't accidentally stack in the case that one is disrupted and another is set on top of it right after the sleep is disrupted for double damage), the damage will not occur and the rest of the trigger is SKIPPED.

I thought at first it might be due to the fact that sleep uses 3 buffs (So I included all 3 with an or condition up there), but that did not solve my problems either... Any ideas?

Trigger:
Demonic Lullaby
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Demonic Lullaby
Collapse Actions
Set DemonicLullaby[(Team number of (Owner of (Casting unit)))] = (Target unit of ability being cast)
Collapse For each (Integer A) from 1 to 9, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(DemonicLullaby[(Team number of (Owner of (Casting unit)))] has buff Demonic Lullaby ) Equal to True
(DemonicLullaby[(Team number of (Owner of (Casting unit)))] has buff Demonic Lullaby (Pause)) Equal to True
(DemonicLullaby[(Team number of (Owner of (Casting unit)))] has buff Demonic Lullaby (Stun)) Equal to True
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Life of DemonicLullaby[(Team number of (Owner of (Casting unit)))]) Less than or equal to (10.00 + (5.00 x (Real((Level of Demonic Lullaby for (Casting unit))))))
Collapse Then - Actions
Unit - Cause (Casting unit) to damage DemonicLullaby[(Team number of (Owner of (Casting unit)))], dealing 35.00 damage of attack type Chaos and damage type Universal
Collapse Else - Actions
Unit - Set life of DemonicLullaby[(Team number of (Owner of (Casting unit)))] to ((Life of DemonicLullaby[(Team number of (Owner of (Casting unit)))]) - ((5.00 x (Real((Level of Demonic Lullaby for (Casting unit))))) + 10.00))
Collapse Else - Actions
Do nothing
Wait 1.00 seconds
07-15-2007, 06:54 PM#2
CommanderZ
And what is your problem? That action called "Skip remaining actions" really skips the rest of the trigger?
07-15-2007, 06:55 PM#3
Deathlust
My problem is that if I replace the Do Nothing w/ Skip Remaining Actions, the damage and stuff never occurs, even if the unit has the buff...
07-15-2007, 07:04 PM#4
Fluff
I think you may want to start over and could do it without a loop. What does this spell do exactly? Stuns and damages the target every second until the target reaches a certain low amount of HP? And I assume the spell itself is only a stun so you are adding the damage over time component with a trigger?

EDIT dunno what i was thinking... you would need a loop
07-15-2007, 07:06 PM#5
CommanderZ
Try changing the "Starts the effect..." with "finishes casting" or add small wait on first line. I guess the ability being cast is some sort of sleep...the sleep effect probably starts AFTER the first pass through the loop => the condition fails on the first pass => the else statement is executed => it is not a problem when there is Do Nothing, but with "Skip..." it terminates the trigger. I hope you understand.
07-15-2007, 07:53 PM#6
Deathlust
I tried changing it to when a unit finishes casting and that still didn't help. The same effect (No damage) occurred.
07-15-2007, 08:14 PM#7
CommanderZ
Add cca 0.5 sec wait on the first line of the trigger.
07-15-2007, 08:25 PM#8
Fluff
Trigger:
Demonic Lullaby
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Demonic Lullaby
Collapse Actions
Collapse For each (Integer A) from 1 to 9, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Target unit of ability being cast) has buff Demonic Lullaby ) Equal to True
(Target unit of ability being cast) has buff Demonic Lullaby (Pause)) Equal to True
(Target unit of ability being cast) has buff Demonic Lullaby (Stun)) Equal to True
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Life of (Target unit of ability being cast) Less than or equal to (10.00 + (5.00 x (Real((Level of Demonic Lullaby for (Casting unit))))))
Collapse Then - Actions
Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 35.00 damage of attack type Chaos and damage type Universal
Collapse Else - Actions
Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - ((5.00 x (Real((Level of Demonic Lullaby for (Casting unit))))) + 10.00))
Collapse Else - Actions
Do nothing
Wait 1.00 seconds

Try this. I replaced your variable with the event response (Target unit of ability being cast), so now your spell should be multi-instancable.

EDIT: This means you should be able to have have multiple units casting this spell, which I think was your original reason for trying to add a "skip remaining actions"
07-15-2007, 09:32 PM#9
Deathlust
That doesn't help... at all. My spell is already the level of MUI I want it to be, capable of having 1 per player.

I don't think you understand my problem entirely Fluff...

This is a sleep spell. Let's say Player 1 casts this spell on Player 2, which lasts 9 seconds.

2 seconds in after casting the spell, Player 3 wakes up Player 2 & casts the same spell. As a result, Player 1's damage (What would still be going on) & Player 3's damage are now affecting Player 2.

The whole point of "Skip Remaining Actions" was for that case. (So the damages wouldn't bug and accidentally stack).
07-15-2007, 09:41 PM#10
CommanderZ
Try the wait or I will have to try it myself :P
07-15-2007, 10:00 PM#11
PipeDream
Renamed thread to something slightly more descriptive.

The complexity of your triggering is reaching the level where you would have an easier time writing and getting help with scripting JASS directly.
07-15-2007, 10:13 PM#12
Strilanc
What you want is actually simpler than this. You will need two triggers.

Trigger 1:
When the ability is cast, add the target to a unit group

Trigger 2:
Every second, loop through the unit group. If the a unit in the group doesn't have the buff, remove it from the group, otherwise deal damage to it.

This will work well because it completely avoids using waits and checking for double-casting, etc.
07-15-2007, 10:27 PM#13
Deathlust
Strilanc...

1. Your method doesn't support leveling damage (X/X/X damage per second with level).

2. Your method also will not credit the caster for a kill if the target dies under this.
07-15-2007, 10:42 PM#14
Pyrogasm
You could fix the first problem by simply making 3 groups, or using a group array.
07-16-2007, 12:32 AM#15
Strilanc
Quote:
Originally Posted by Deathlust
Strilanc...

1. Your method doesn't support leveling damage (X/X/X damage per second with level).

2. Your method also will not credit the caster for a kill if the target dies under this.

Then use a couple arrays instead of a group. You'd need a target array and a caster array. Arrays will probably even be faster than groups because you'll know the index when you want to remove an element, letting you do it in O(1) time instead of O(n).