• 🏆 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!

Help with a trigger to change ownership

Status
Not open for further replies.
Level 6
Joined
Jul 13, 2006
Messages
140
So, for some reason, this trigger refuses to work.

  • get construction sites
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Colonize
          • (Ability being cast) Equal to Colonize (Light Conquest Ship)
          • (Ability being cast) Equal to Capture (cruiser)
    • Actions
      • Set OtherPoint = (Position of (Target unit of ability being cast))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Region centered at OtherPoint with size (200.00, 200.00))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Construction Site
                  • (Unit-type of (Picked unit)) Equal to Armaments Factory
                  • (Unit-type of (Picked unit)) Equal to Electronics Workshop
                  • (Unit-type of (Picked unit)) Equal to Steel Mill
                  • (Unit-type of (Picked unit)) Equal to Workshop
            • Then - Actions
              • Unit - Change ownership of (Picked unit) to (Owner of (Casting unit)) and Change color
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Advanced Shipyard
                      • (Unit-type of (Picked unit)) Equal to Research Facility
                      • (Unit-type of (Picked unit)) Equal to Robotics Facility
                      • (Unit-type of (Picked unit)) Equal to Shipyard
                      • (Unit-type of (Picked unit)) Equal to Development Centre
                      • (Unit-type of (Picked unit)) Equal to Stargate
                • Then - Actions
                  • Unit - Change ownership of (Picked unit) to (Owner of (Casting unit)) and Change color
                  • Unit - Replace (Picked unit) with a Construction Site using The old unit's relative life and mana
                • Else - Actions
      • Custom script: call RemoveLocation(udg_OtherPoint)
The units that are supposed to change ownership are created at initalization at these positions.

  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • Set TempLoc = (Position of (Picked unit))
      • Set TempLocus = (TempLoc offset by (-30.00, -150.00))
      • Set TempPoint = (TempLoc offset by (30.00, -150.00))
      • Unit - Create 1 Construction Site for Neutral Hostile at TempLocus facing Default building facing degrees
      • Unit - Create 1 Construction Site for Neutral Hostile at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLocus)
      • Custom script: call RemoveLocation(udg_TempPoint)
Though these are supposed to be upgraded into other things.

Any help would be greatly appreciated, as well as any notification of leaks.

Oh, and if anybody could help me with the request I've made in the request froum then that would also be greatly appreciated (it's trigger-related).
 
First off, replace the event with
"Unit - A unit starts the effect of an ability". Charm is not a channeling spell.

Secondly, instead of the comparison you have in the Unit Group pick, use this:
  • Unit Group - Pick every unit in (Units within 200.00 of OtherPoint) and do (Actions)
Thirdly, replace the base abilities. Use Channel instead. Possession and Charm change ownership by default, so the triggers you use are redundant.
 
Status
Not open for further replies.
Top