HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Thunder is scary!

11-19-2003, 10:52 PM#1
YellowSubmarine
I'm making a thunder spell that causes nearby units to be added to a unit group so I can use the effect on them.
Code:
Events
    Unit - A unit Finishes casting an ability
Conditions
    (Ability being cast) Equal to Peals of Thunder (Storm Lord)
Actions
    Unit Group - Pick every unit in (Units within 700.00 of (Position of (Casting unit)) matching (((Matching unit) is in FrightenedUnits) Equal to False)) and do (Player Group - Pick every player in (All players matching ((Owner of (Picked unit)) Equal to (Matching player))) and do (Cinematic - Fade out and back in over 1.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
    Sound - Play ThunderClapCaster <gen> at 100.00% volume, located at (Position of (Casting unit)) with Z offset 0.00
    Unit Group - Pick every unit in (Units within 700.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
        Loop - Actions
            Game - Display to (Owner of (Casting unit)), at offset (0.00, 0.00) for 2.00 seconds the text: Started
            Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
            Unit Group - Add (Picked unit) to FrightenedUnits
            Wait (((PealsLevel x 3.00) + 7.00) + (StormAuraLevel x 1.50)) seconds
            Unit Group - Remove (Picked unit) from FrightenedUnits
            Special Effect - Destroy (Last created special effect)
            Game - Display to (Owner of (Casting unit)), at offset (0.00, 0.00) for 2.00 seconds the text: Finished

The first part creates the thunder filter/sound. The part about picking nearby enemy units is the problem that I'm having-- the units are added, the "Started" text displayed, and the special effect attached, but everything below the wait is not happening. (The wait is determined by the thunder's level times 3 plus level 1's additional 7 seconds, plus 1.5 per level of Storm Aura, another of the hero's skills.) Is something wrong with the wait?

I also noticed that "Started", text for debugging, was displayed twice the first time I casted the spell, but not the second. Help on that is also appreciated.
11-19-2003, 10:55 PM#2
Eriond
Haven't read your entire code, I'll edit this post when I do, but did you know that the fade filter automatically works for all players? I know, It sucks, but you can't make it happen for one person, at least, not in anyway that I know of.

EDIT: Hmmm, looks like it might have something to do with your wait function. Check the variables, replace that wait with a constant and see what happens.
11-20-2003, 01:37 AM#3
YellowSubmarine
Cvrse the filters! Cvrse them to hades!

The funny thing is, I too thought it was a problem with the wait, so I changed it to 2 seconds-- and nothing happened, still.

EDIT: Hey, get this: I took out the wait, and everything functioned as it should, save that the duration was off due to the lack of the wait. I'll try putting everything below the wait in a different trigger, run it, and see what happens.

EDIT II: Curses, I realized something-- if I put those in a seperate trigger, the spell would glitch out if the hero cast it before those frightened units were removed from the group. Any help on this?