• 🏆 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] A little trigger-problem

Status
Not open for further replies.
Level 24
Joined
Jun 16, 2008
Messages
1,939
Look! I wanted to make the spell: "Divine Lightning", wich should cast a chainlightning on every unit in a 1000 AOE around the caster. Here is my trigger:
  • EffectDL
    • events
      • unit - A unit starts the effect of an ability
    • conditions
      • (Ability being cast) equal to Divine Lightning
    • actions
      • Set Caster = (Casting unit)
      • Set TempLoc00 = (Position of Caster)
      • Set UnitGroup = (Random ((Level of Divine Lightning for Caster) x 3) units from (Units in (Region centered at (Position of Caster) with size (1000.00, 1000.00))))
      • unitgroup - Pick every unit in UnitGroup and do (Actions)
        • loop - actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-conditions
              • ((Picked unit) belongs to an enemy of (Owner of Caster)) equal to True
            • 'THEN'-actions
              • Set Target = (Picked unit)
              • Set TempLoc01 = (Position of (Picked unit))
              • unit - Create 1 Dummy for (Owner of Caster) at TempLoc01 facing default building degrees
              • unit - Add DummyDivineLightning to (Last created unit)
              • unit - Set level of DummyDivineLightning for (Last created unit) to (Level of Divine Lightning for Caster)
              • unit - Order (Last created unit) to Orc-far seer - 'chainlightning' Target
              • unit - Add a 1.50 second default expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_TempLoc01)
              • Custom script: set udg_Target = null
            • 'ELSE'-actions
      • Custom script: call RemoveLocation(udg_TempLoc00)
      • Custom script: call DestroyGroup(udg_UnitGroup)
      • Custom script: set udg_Caster = null
maybe u can help me?
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
First of all, check mana cost and all that for the dummy ability. Also check range, but you should see it do something with 600 range :hohum:

So, if that's cleared, at first glance all i notice is the region with center of position of caster. I'm not using that one, so i don't know if it works or not.

I would pick all units in range instead
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Leaks a rect, a region (I think), and a point.

Why use a variable for Picked Unit? It's a global, it most likely won't store all the values in it.
The World Editor uses GetEnumUnit(), which is Picked Unit, it doesn't leak as far as I know.

I'd increase the timer for the dummy as well.
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
here is my new trigger and it doesnt work even...
  • DL
    • events
      • unit - a unit starts the effect of an ability
    • conditions
      • (Ability being cast) equal to DivineLightning
    • actions
      • Set Caster = (Casting unit)
      • Set TempLoc00 = (Position of Caster)
      • Set UnitGroup = (Units within ((Real((Level of DivineLightning for Caster))) x 400.00) of TempLoc00)
      • unitgroup - Pick every unit in UnitGroup and do (Actions)
        • loop - actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-conditions
              • ((Picked unit) belongs to an enemy of (Owner of Caster)) equal to True
            • 'THEN'-actions
              • Set TempLoc01 = (Position of (Picked unit))
              • unit - Create 1 DivineLightningDummy for (Owner of Caster) at TempLoc01 facing default building degrees
              • unit - Add DummyDivineLightning to (Last created unit)
              • unit - Set level of DummyDivineLightning for (Last created unit) to (Level of DivineLightning for Caster)
              • unit - Order (Last created unit) to Orc-far seer - 'chain lightning' (Picked unit)
              • unit - Add a 2.00 second default expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_TempLoc01)
            • 'ELSE'-actions
      • Custom script: call RemoveLocation(udg_TempLoc00)
      • Custom script: call DestroyGroup(udg_UnitGroup)
      • Custom script: set udg_Caster = null
plz i n help
 
Level 10
Joined
Sep 29, 2006
Messages
447
Code:
Set UnitGroup = (Units within ((Real((Level of DivineLightning for Caster))) x 400.00) of TempLoc00) matching ((Matching unit) is an enemy of (owner of (caster))) Equal to True

try that and then remove the IF part of your code. just do:

Code:
Pick every Unit in UnitGroup and do Actions
    Loop Actions
        <your actions here>

that may work
 
Level 6
Joined
Feb 21, 2008
Messages
205
Am kinda in the same problem here, the dummy casting units spawn, but they wont target any enemies.

  • Poison Bomb
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Windwalk
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Windwalk for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set Spell_group = (Units within 400.00 of (Position of (Triggering unit)))
          • Unit Group - Pick every unit in Spell_group and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Caster unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
              • Unit - Add Shadow Strike to (Last created unit)
              • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
              • Unit Group - Order (Units within 2000.00 of (Position of (Triggering unit)) matching ((Unit-type of (Last created unit)) Equal to Caster unit)) to Night Elf Warden - Shadow Strike (Picked unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Windwalk for (Triggering unit)) Equal to 2
            • Then - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Windwalk for (Triggering unit)) Equal to 3
                • Then - Actions
                • Else - Actions
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
Ripoff, have you made the Shadow Strike a dummy ability? In that case, name it Shadow Strike(dummy) to clear misunderstandings, otherwise i think i've found your problem:xxd:

Oh, and you've created the dummy unit at the position of the (triggering unit), not (picked unit), this means you only create 1 dummy and you tell it to shadow strike all enemies around it, which is impossible. And you should add a condition in the unit group that so that you only add enemies to the unit group, otherwise you will create dummy units at the position of allied units and the caster as well, but they can't cast shadow strike on them becuz of target requirements, so they'll just stand ther until removed. This takes up necessary data and should be avoided
 
Level 6
Joined
Feb 21, 2008
Messages
205
Ripoff, have you made the Shadow Strike a dummy ability? In that case, name it Shadow Strike(dummy) to clear misunderstandings, otherwise i think i've found your problem:xxd:

Oh, and you've created the dummy unit at the position of the (triggering unit), not (picked unit), this means you only create 1 dummy and you tell it to shadow strike all enemies around it, which is impossible. And you should add a condition in the unit group that so that you only add enemies to the unit group, otherwise you will create dummy units at the position of allied units and the caster as well, but they can't cast shadow strike on them becuz of target requirements, so they'll just stand ther until removed. This takes up necessary data and should be avoided

Thank you for taking your time to help, but it still doesnt work. I've changed the position, but I havent made the trigger so they only do it on enemy units, I cant find it in the condition list. I added models to my dummy units, and they do spawn on all the units I want to, but they dont cast anything. I think this would be the trigger who is wrong.

  • Unit Group - Order (Units within 2000.00 of (Position of (Triggering unit)) matching ((Unit-type of (Last created unit)) Equal to Caster unit)) to Night Elf Warden - Shadow Strike (Picked unit)
Edit: yup, dunno why I made it that complicated:
  • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
Call me an idiot, I deserve it ^^
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
I've found your problem ripoff.

Your checking if the unit-type of the last created unit is equal to casting unit, which is false, resulting in no spell.

Also the whole pick (last created unit is unecessary, since you do not need to pick all units in 200 area etc...

just order (last created unit) to do the skill, since all dummys are created at the same time. it will work.

EDIT: oh, you solved it already =P
 
Level 6
Joined
Feb 21, 2008
Messages
205
I've found your problem ripoff.

Your checking if the unit-type of the last created unit is equal to casting unit, which is false, resulting in no spell.

Also the whole pick (last created unit is unecessary, since you do not need to pick all units in 200 area etc...

just order (last created unit) to do the skill, since all dummys are created at the same time. it will work.

EDIT: oh, you solved it already =P

A million thanks to you though :wink:
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Placing the dummy unit at the position of the triggering unit would make projectiles visible.
He creates 1 Dummy for every picked unit, but it is possible to make 1 dummy to cast the spell all at the targets(cast backswing, casting time, cooldown).
 
Status
Not open for further replies.
Top