• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Defensive Sphere

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2014
Messages
57
So I wanted to make a spell what adds and activates the ability named defense for units in a area:
(first part)
  • Wizard absorbing spells
    • Events
      • Unit - A unit Begins casting an ability
      • Unit - A unit Starts the effect of an ability
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Defensive Sphere
    • Actions
      • Set castingpoint = (Position of (Triggering unit))
      • Set point1 = (castingpoint offset by (-200.00, 200.00))
      • Set point2 = (castingpoint offset by (200.00, 200.00))
      • Set point5 = (castingpoint offset by (200.00, -200.00))
      • Set point3 = (castingpoint offset by (300.00, 400.00))
      • Set point4 = (castingpoint offset by (-300.00, -250.00))
      • Unit - Create 1 The biggest Dummy for Player 1 (Red) at point1 facing Default building facing degrees
      • Unit - Create 1 The biggest Dummy for Player 1 (Red) at point2 facing Default building facing degrees
      • Unit - Create 1 The biggest Dummy for Player 1 (Red) at point3 facing Default building facing degrees
      • Unit - Create 1 The biggest Dummy for Player 1 (Red) at point4 facing Default building facing degrees
      • Unit - Create 1 The biggest Dummy for Player 1 (Red) at point5 facing Default building facing degrees
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type The biggest Dummy) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to dummyparty
          • Unit - Set (Picked unit) movement speed to 0.00
          • Unit - Set (Picked unit) movement speed to 0.00
          • Unit - Make (Picked unit) Sleep when unprovoked
          • Unit - Add classification of Ethereal to (Picked unit)
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Add Something like defend to (Picked unit)
          • Unit - Order (Picked unit) to Human Footman - Defend
      • Unit Group - Pick every unit in (Units within 350.00 of castingpoint matching ((Owner of (Picked unit)) Equal to Player 1 (Red))) and do (Actions)
        • Loop - Actions
          • Unit - Add Something like defend to (Picked unit)
          • Unit - Order (Picked unit) to Human Footman - Defend
Second part:
  • Untitled Trigger 034
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 500.00 of castingpoint matching ((Owner of (Triggering unit)) Equal to Player 1 (Red))) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Human Footman - Defend
          • Set spellgroup2 = (Last created unit group)
      • Wait 0.20 seconds
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set spellgroup = (Last created unit group)
          • Unit Group - Remove all units of spellgroup2 from spellgroup
          • Unit - Order (Picked unit) to Human Footman - Stop Defend
It doesn´t adds the ability to thoose units. What is the problem with it?
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
  • Unit Group - Pick every unit in (Units within 500.00 of castingpoint matching ((Owner of (Triggering unit)) Equal to Player 1 (Red))) and do (Actions)
Who is the Triggering Unit here? "No unit" so the condition will always be false and the trigger will never run. You have to add the units within 500 range of castingpoint to an individual unit group (let's say UnitsAroundCastingPoint) in "Wizard absorbing spells" so that you can use triggering unit and picked unit. Once you did that, you replace that ugly (Units within 500.00 of castingpoint matching ((Owner of (Triggering unit)) Equal to Player 1 (Red))) with UnitsAroundCastingPoint.
 
Level 4
Joined
Jul 25, 2014
Messages
57
Nevermind, I fixed it. The problem was with
  • Unit Group - Pick every unit in (Units within 350.00 of castingpoint matching ((Owner of (Picked unit)) Equal to Player 1 (Red))) and do (Actions)
I just had to replace picked unit with matching unit.
 
Status
Not open for further replies.
Top