• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Trigger Efficiency Problem?

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Hello again forum.
This is another spell for my Space Orc Map... and unfortunately, it has some strange problems.
Sometimes the dummies spawn far from the caster, they don't appear simultaneously and stuff. Also the second triggger (the channel stopping does not seem to work)

Can anyone find the error(s) or at least help me improve the spell ?

What the spell should do is:
On cast creates a few dummies that 'aerial shackles' units within certain range of the target of the ability. When stopped, all of them should disappear.


  • Plasmic Prison Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Plasmic Prison (C)
    • Actions
      • Set PP_Caster = (Casting unit)
      • Set PP_Loc[0] = (Position of (Target unit of ability being cast))
      • Set PP_Loc[1] = (Position of PP_Caster)
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Unit - Create 1 dummy_spell for (Owner of PP_Caster) at PP_Loc[1] facing Default building facing degrees
          • Set PP_Shooter = (Last created unit)
          • Unit - Add plasmic_Prison_dummy to PP_Shooter
          • Unit Group - Pick every unit in (Units within 300.00 of PP_Loc[0]) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • ((Picked unit) has buff Plasmic Bound ) Equal to False
                      • ((Picked unit) is dead) Equal to False
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) belongs to an enemy of (Owner of PP_Caster)) Equal to True
                • Then - Actions
                  • Unit Group - Add (Picked unit) to PP_Targets
                • Else - Actions
          • Set PP_Target = (Random unit from PP_Targets)
          • Unit - Order PP_Shooter to Human Dragonhawk Rider - Aerial Shackles PP_Target
          • Unit - Add a 8.00 second Generic expiration timer to PP_Shooter
          • Hashtable - Save Handle OfPP_Shooter as (Integer A) of (Key (Casting unit)) in Plasmic_Hash
          • Unit Group - Remove all units from PP_Targets
      • Custom script: call RemoveLocation(udg_PP_Loc[0])
      • Custom script: call RemoveLocation(udg_PP_Loc[1])



  • Plasmic Prison Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Plasmic Prison (C)
    • Actions
      • Set PP_Caster = (Casting unit)
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set PP_Removable = (Load (Integer A) of (Key (Casting unit)) in Plasmic_Hash)
          • Unit - Order PP_Removable to Stop
          • Unit - Remove PP_Removable from the game
      • Hashtable - Clear all child hashtables of child (Key (Casting unit)) in Plasmic_Hash
 
Stops casting an ability refers to a channeling spell, so use the "Begins channeling an ability" for the first trigger. Also, stop placing everything in variables. The dummies that are created via the loop Integer A from 1 to 7, don't have to be placed in a variable. It still remains MUI you know. Also, prefer Triggering unit than Casting unit. Finally, in the second trigger, use Integer B for the loop, not A, like the first one.
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Ook, changed the event in Trig 1, changed Casting to Triggering, chanched Integer A to B in trig 2.

Testing....

EDIT:
Ok, Begins channeling sometimes results in the trigger starting but the spell - no.... I still think that the effect is necessary here :?
But do the locations still appear far from the caster ?
 
It removes the leak of the Unit Group action you perfrom right after.
Well, I found a problem.
A) Aerial Shackles can apply at one unit at a time, meaing that only one unit can shackle one unit, not multiple sources, cause you'll get the error "That unit is already being shackled" otherwise.

So, here is the trigger, but you need to change the base spell you use for the damage overtime.

P.S. I used integer from 1 to 8, because 7 is not proper for the point offset I used (returns real value).

View attachment Loop Cast.w3x
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Ok, thanks. One thing though, If u set the variable T_Unit = Random unit from Unit Group how will the different dummies target different units ?

And what do u need Points[3] for ? I didn't see it being used anywhere ? :?
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
I figured out of my problems - why the dummies appeared away from the caster - because their dummy ability had too short of a range :D
That was tricky..

But still there is one thing left. No matter what - when I cancel the channeling, the dummies wont disappear until their channeling is over. :(
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Sorry for not giving a reply - I had to leae the house.
I will check it out any moment now and Edit..


Edit: Still does not work a bit :( No matter what, the dummies wont disappear when you stop channelling.
 
Last edited:
Level 15
Joined
Nov 26, 2005
Messages
1,151
Well, I'll try erasing my triggers and copy/pasting yours. I just can't seem to get it working in my triggers. Hope it works. :)
We'll Edit to tell you.
10x so far, Pharaoh_ (+rep)

Ok, I did that, seems to work like that.
I only wonder... why didn't my spell work ? :?
What different did you make? And is that issue with the event so important ?
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
So ... worked perfectly with the event "starts the effect". Even fixed the issue, which sometimes occurred with the event "start channeling". The issue was that unit started channeling for a part of a second and stopped, and continued to attack. With the effect Event - no such things occur.

I just can't figure it out how exactly did you make those dummie dissapear and I didn't ..

Anyway, great job and many thanks :)
 
Status
Not open for further replies.
Top