HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problem with Chain GUI spell

05-05-2007, 12:41 PM#1
Castlemaster
I've decided to make a chain sleep spell based off the dreadlord ability. The problem is that even though I triggered it affect up to 6 units at max level, it will only affect 2 targets. Here is the triggering I use (just replace the word sleep with nightmare, which is the spell name)

These are the array variables used in the spell
Trigger:
Actions
-------- Necron --------
Set NightmareExtraTargetCount[1] = 1
Set NightmareExtraTargetCount[2] = 2
Set NightmareExtraTargetCount[3] = 3
Set NightmareExtraTargetCount[4] = 4
Set NightmareExtraTargetCount[5] = 5

and here is the spell itself
Trigger:
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Nightmare
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NightmareTempCount Equal to 0
Collapse Then - Actions
Set NightmarePreviousTarget = No unit
Set NightmareTarget = (Target unit of ability being cast)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NightmareTempCount Less than NightmareExtraTargetCount[(Level of Nightmare for (Casting unit))]
Collapse Then - Actions
Wait until ((NightmareTarget has buff Nightmare ) Equal to True), checking every 0.10 seconds
Set TempPoint = (Position of NightmareTarget)
Unit - Create 1 Dummy Caster for (Owner of (Casting unit)) at TempPoint facing Default building facing degrees
Custom script: call RemoveLocation (udg_TempPoint)
Unit - Add Nightmare (No Cooldown) to (Last created unit)
Unit - Set level of Nightmare (No Cooldown) for (Last created unit) to (Level of Nightmare for (Casting unit))
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Set TempPoint = (Position of NightmareTarget)
Set TempUnitGroup = (Units within 600.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
Custom script: call RemoveLocation (udg_TempPoint)
Set NightmarePreviousTarget = NightmareTarget
Set NightmareTarget = (Random unit from TempUnitGroup)
Unit - Order (Last created unit) to Undead Dreadlord - Sleep NightmareTarget
Custom script: call DestroyGroup (udg_TempUnitGroup)
Set NightmareTempCount = (NightmareTempCount + 1)
Trigger - Run (This trigger) (ignoring conditions)
Collapse Else - Actions
Set NightmareTempCount = 0

To see what the problem was, I had a trigger following it to create a special effect overhead of "NightmareTarget" which only only ended up appearing over the initial spell target and not the triggered spell target. Therefore I think the problem lies with defining "NightmareTarget" and "NightmarePreviousTarget", but can't find it.

Thanks ahead of time.
edit: I hit the wrong key before I posted my trigger ><.
05-05-2007, 12:43 PM#2
DarthRevansith
sorry, the community can´t help you because you´ve posted no triggers in the trigger fields
05-05-2007, 10:28 PM#3
Pyrogasm
Well, it appears as though there is no way to know when the dummy unit casts the spell (unless there's a trigger I'm not seeing). After casting the first time, NightmareTempCount is incremented, but then nothing.

Additionally, the error may lie in these lines:
Trigger:
Wait until ((NightmareTarget has buff Nightmare ) Equal to True), checking every 0.10 seconds
Unit - Create 1 Dummy Caster for (Owner of (Casting unit)) at TempPoint facing Default building facing degrees
The reason this might bug out is that you're referencing "Casting Unit" after using a wait. Try changing any/all references of "Casting Unit" to "Triggering Unit".