HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger spell gone nutz! help!

02-20-2004, 02:44 AM#1
Hunter0000
well, the spell is saposed to make the hero dissapear, and a storm-bolt-like spell is bounced of one target per level and then the hero re-appears at that spot. But it wont do anything. Here is the trigger

Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to Water Form 
Actions
    Unit - Hide (Casting unit)
    Unit - Create 1 DUMMY CASTER for (Owner of (Casting unit)) at (Center of (Playable map area)) facing Default building facing degrees
    Set TempInt1[(Player number of (Owner of (Casting unit)))] = (Level of Water Form  for (Casting unit))
    Set DummyCaster[(Player number of (Owner of (Casting unit)))] = (Last created unit)
    Hero - Learn skill for DummyCaster[(Player number of (Owner of (Casting unit)))]: Water Form (Real Damage) 
    For each (Integer A) from 1 to (TempInt1[(Player number of (Owner of (Casting unit)))] + 1), do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    TempInt1[(Player number of (Owner of (Casting unit)))] Greater than or equal to 1
                Then - Actions
                    Set TempTarget[(Player number of (Owner of (Casting unit)))] = (Random unit from (Units within 600.00 of (Center of (Playable map area)) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is dead) Equal to False
                    Unit - Order DummyCaster[(Player number of (Owner of (Casting unit)))] to Human Mountain King - Storm Bolt TempTarget[(Player number of (Owner of (Casting unit)))]
                    Set TempInt1[(Player number of (Owner of (Casting unit)))] = (TempInt1[(Player number of (Owner of (Casting unit)))] - 1)
                    Unit - Move DummyCaster[(Player number of (Owner of (Casting unit)))] instantly to (Position of TempTarget[(Player number of (Owner of (Casting unit)))])
                    Wait 1.00 seconds
                Else - Actions
                    Unit - Move (Casting unit) instantly to (Position of TempTarget[(Player number of (Owner of (Casting unit)))])
                    Unit - Unhide (Casting unit)
                    Unit - Remove DummyCaster[(Player number of (Owner of (Casting unit)))] from the game

Please help guys, I dont understand whats wrong with it...
02-20-2004, 03:31 AM#2
Narwanza
Other than the fact that you use center of playable map area where i think you shouldn't, correct me if i'm wrong. it is line 16 or so.
Code:
                    Set TempTarget[(Player number of (Owner of (Casting unit)))] = (Random unit from (Units within 600.00 of [b](Center of (Playable map area))[/b] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is dead) Equal to False

if that is not the problem then I am not quite sure. You might want to set a unit variable equal to the casting unit before you do anything else in the trigger and then call it instead of the casting unit (it might ingore the fact that it is the casting unit once it has been hid )

[edit] oh, and how did you get all that gui code into WC3C so easily? I highly doubt you wrote it all that clean without doing some CnP.
02-20-2004, 04:29 AM#3
Hunter0000
Yes, I noticed that, and I cleaned up the trigger, but it still doesnt work...

Oh yes, you right click Action(Or events/conditions) and select "copy as text"

Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to Water Form 
Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            (Number of units in (Units within 600.00 of (Position of (Casting unit)) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is dead) Equal t Greater than or equal to 1
        Then - Actions
            Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
            Set SFX[SFXCounter] = (Last created special effect)
            Set SFXCounter = (SFXCounter + 1)
            Unit - Hide (Casting unit)
            Unit - Create 1 DUMMY CASTER for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
            Set TempInt1[(Player number of (Owner of (Casting unit)))] = (Level of Water Form  for (Casting unit))
            Set DummyCaster[(Player number of (Owner of (Casting unit)))] = (Last created unit)
            Hero - Learn skill for DummyCaster[(Player number of (Owner of (Casting unit)))]: Water Form (Real Damage) 
            For each (Integer A) from 1 to (TempInt1[(Player number of (Owner of (Casting unit)))] + 1), do (Actions)
                Loop - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            TempInt1[(Player number of (Owner of (Casting unit)))] Greater than or equal to 1
                        Then - Actions
                            Set TempTarget[(Player number of (Owner of (Casting unit)))] = (Random unit from (Units within 600.00 of (Center of (Playable map area)) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is dead) Equal to False
                            Game - Display to (All players) the text: (String((Unit-type of TempTarget[(Player number of (Owner of (Triggering unit)))])))
                            Unit - Order DummyCaster[(Player number of (Owner of (Casting unit)))] to Human Mountain King - Storm Bolt TempTarget[(Player number of (Owner of (Casting unit)))]
                            Set TempInt1[(Player number of (Owner of (Casting unit)))] = (TempInt1[(Player number of (Owner of (Casting unit)))] - 1)
                            Unit - Move DummyCaster[(Player number of (Owner of (Casting unit)))] instantly to (Position of TempTarget[(Player number of (Owner of (Casting unit)))])
                            Wait 1.00 seconds
                        Else - Actions
                            Game - Display to (All players) the text: (String((Unit-type of TempTarget[(Player number of (Owner of (Triggering unit)))])))
                            Unit - Move (Casting unit) instantly to (Position of TempTarget[(Player number of (Owner of (Casting unit)))])
                            Unit - Unhide (Casting unit)
                            Unit - Remove DummyCaster[(Player number of (Owner of (Casting unit)))] from the game
        Else - Actions
            Game - Display to (All players matching ((Owner of (Casting unit)) Equal to (Matching player))) the text: No Targets Availabl...
            Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 125.00)

Code:
Set TempTarget[(Player number of (Owner of (Casting unit)))] = (Random unit from [color=red](Units within 600.00 of (Center of (Playable map area))[/color] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is dead) Equal to False

EDIT

AHh see that? that was half my problem, but it still acts really funny. Like most of the time it refuses to find a target, and when it does it almost never has missle art, witch is very strange(I know it fired because I see the stun). It also never moves the caster to the last target for some reason, and most importantly, it refuses to chain(you know, repeat).
02-20-2004, 04:42 AM#4
Narwanza
Just a suggestion, use an integer variable for all of those array calls. It is quite annonying to try and read [(Player number of (Owner of (Casting unit)))] over and over and over again. Does it ever fire a projectile? Almost never is extremely vague and might mislead me. Double check your spell, make sure your unit has the right spell. I dunno.
02-20-2004, 05:00 AM#5
Hunter0000
HMmm, I got it to work, mostly. The problem was, I was giving an order and moveing instantly at the same time, so I moved the move instatly AFTER the wait. I also made the hid caster move to the temp caster, instead of the temp target, witch works 100%. Howwever I am having a very troublsome side-effect. Sometimes, the trigger simply stops, and the hydromancer remains hidden, and the dummy caster never gets destroyed. Any ideas on how to prevent this? prehaps a timer of 12 seconds, and if the cast is still hidden un-hide it?
02-20-2004, 10:01 AM#6
TyRulz
you should try to change the event condition to unit starts the effect of an ability

PS:How come with such great spell ideas on forums you don'tsee any good maps that can be downloaded
02-20-2004, 02:13 PM#7
Hunter0000
Quote:
Originally posted by TyRulz
you should try to change the event condition to unit starts the effect of an ability

PS:How come with such great spell ideas on forums you don'tsee any good maps that can be downloaded


There are some good downloadable ones, besides, Thus map is not nearly finished. Oh, I added the timer I spoke of it it runs great now. Thanks guys.
02-21-2004, 01:51 PM#8
TyRulz
Really,downloadable???Where,where???