HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Difficulty using Sleep in a trigger-enhanced spell

02-14-2006, 06:41 AM#1
CastleOrange
Edit: Fixed!

I have an ability where a unit casts a spell, turns invisible and all of the enemy (Player 12) units around him go to sleep (basically, he distracts the enemies so he can get out of danger). I got the code from Elil a year or so ago and this code works perfectly for another spell, so I suspect it's a problem with sleep (or maybe invisibility?). Also, this trigger used to work but has stopped working in the last year of WC3 patches.

I've tested several things to work correctly... the trigger activates correctly and it even goes through the loop the correct number of times.

The spell is based off of the Dreadlord's Sleep spell and has the same Order String.

If you want to check out the problem, I've uploaded the map (edit: removed, problem fixed!). The hero is the pirate hero and the spell is Cunning Distraction. The trigger is in the Trigger Spells and Items folder in the triggers. A similar spell that works correctly is Form of Wind on the spellbreaker hero. The map has a bunch of Tomes of Power in the dropoff area to let you get enough levels to test spells without fear of dying.

Thanks for the help! This is (hopefully!) the last tough bug before I can make a peaceful retirement from WC3 mapping.


Trigger:
Cunning Distraction Cast
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Cunning Distraction (trigger enhanced)
Collapse Actions
Custom script: local group udg_AOE_LocalCasterGroup
Set AOE_CasterGroup = (Units in No region)
Set AOE_LocalCasterGroup = (Units in No region)
Collapse Unit Group - Pick every unit in (Units within SuperAoERadius[(Level of Cunning Distraction (trigger enhanced) for CharacterSwash)] of (Position of CharacterSwash) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
Collapse Loop - Actions
Set TempPoint = (Position of (Summoning unit))
Unit - Create 1 Dummy Unit 1 for (Owner of (Summoning unit)) at TempPoint facing Default building facing degrees
Custom script: call RemoveLocation( udg_TempPoint )
Unit - Hide (Last created unit)
Unit - Add Cunning Distraction (dummy) to (Last created unit)
Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
Unit Group - Add (Last created unit) to AOE_CasterGroup
Wait 1.00 seconds
Set AOE_LocalCasterGroup = AOE_CasterGroup
Collapse Unit Group - Pick every unit in AOE_LocalCasterGroup and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game
02-14-2006, 06:45 AM#2
qwertyui
Erm

If its based off sleep, then how does this work?
Trigger:
set TempPoint = (Position of (Summoning Unit)) work

Sleep does not create Summoning Unit, you know...

And please, for the love of all that's Holy, use [trigger] tags instead of [code] tags :(
02-14-2006, 07:07 AM#3
CastleOrange
Thanks, I think you spotted my error!

The spell used to be based off of something that summoned a unit, I guess it was my own fault for it being broken. :)

I didn't know there was a trigger tag :(

Edit: Yep, that was the problem! Hurray!