• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit refuses to change ownership

Status
Not open for further replies.
Level 13
Joined
Oct 10, 2009
Messages
439
Righty, is it impossible change the ownership of locusted units?

I can supply the triggers I'm using if needed


Edit: I've tried removing locust and same problem still persists. Triggers and map are posted in comments below
 
Last edited:
Level 13
Joined
Oct 10, 2009
Messages
439
Hrmm, then what on earth am I doing wrong here?

It should be changing ownership, heck. It's even outputting the string so it is being called, but it isn't changing.

  • FbLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (FB_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in FB_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set TempInteger = (Key (Picked unit))
              • Set TempUnit = (Picked unit)
              • Set Point[0] = (Position of (Picked unit))
              • Set Point[2] = (Position of (Load 4 of (Key (Picked unit)) in FlameBreathHash))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to (Owner of (Load 3 of TempInteger in FlameBreathHash))
                • Then - Actions
                  • Set Point[1] = (Point[0] offset by (Load 1 of (Key (Picked unit)) from FlameBreathHash) towards (Angle from Point[0] to Point[2]) degrees)
                • Else - Actions
                  • Set Point[1] = (Point[0] offset by (Load 1 of (Key (Picked unit)) from FlameBreathHash) towards (Facing of (Picked unit)) degrees)
              • Set TempReal = (Load 2 of (Key (Picked unit)) from FlameBreathHash)
              • Unit - Move (Picked unit) instantly to Point[1]
              • Animation - Change (Picked unit)'s size to ((100.00 x TempReal)%, (100.00 x TempReal)%, (100.00 x TempReal)%) of its original size
              • Hashtable - Save (TempReal + 0.02) as 2 of (Key (Picked unit)) in FlameBreathHash
              • Set TempBool = False
              • Set Group = (Units within (30.00 + (20.00 x TempReal)) of Point[1] matching (((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Set unit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempBool Equal to False
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Kiri rune
                        • Then - Actions
                          • Set TempBool = True
                          • Unit - Change ownership of TempUnit to (Owner of Unit) and Change color
                          • Game - Display to (All players) the text: (String((Player number of (Owner of TempUnit))))
                          • Unit - Move TempUnit instantly to Point[1], facing ((Random angle) + 0.00) degrees
                          • Animation - Change TempUnit's vertex coloring to (50.00%, 50.00%, 100.00%) with 0.00% transparency
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Immune to fire for (Picked unit)) Equal to 0
                            • Then - Actions
                              • Set TempBool = True
                              • Set DamageEventType = 1
                              • Unit - Cause (Load 3 of TempInteger in FlameBreathHash) to damage (Picked unit), dealing (Load 0 of TempInteger from FlameBreathHash) damage of attack type Chaos and damage type Fire
                              • Set DamageEventType = 0
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Level of Weak to fire for Unit) Equal to 1
                                • Then - Actions
                                  • Unit - Create 1 Dummy caster for (Owner of TempUnit) at Point[0] facing Point[1]
                                  • Unit - Add On fire! to (Last created unit)
                                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                  • Unit Group - Add (Picked unit) to Burning
                                  • Hashtable - Save Handle Of(Load 3 of TempInteger in FlameBreathHash) as 0 of (Key (Picked unit)) in OnFireHash
                                  • Trigger - Turn on Burning <gen>
                                • Else - Actions
                              • Unit - Kill TempUnit
                            • Else - Actions
                    • Else - Actions
              • Custom script: call DestroyGroup(udg_Group)
              • Custom script: call RemoveLocation(udg_Point[0])
              • Custom script: call RemoveLocation(udg_Point[1])
              • Custom script: call RemoveLocation(udg_Point[2])
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in FlameBreathHash
              • Unit Group - Remove (Picked unit) from FB_Group
 
Level 7
Joined
Jan 29, 2010
Messages
213
You'll get there. The only reason this is so complex is because I need it to be MUI.


Also, any ideas on what is stopping it from changing ownership?

U can easily test everything with game display, just adding them almost after every condition, and if u want to check what is already set on variables.

p.s. If u do this just remove time every 0.03sec. Better change it to when player pushes ESC, because it will spam a lot or may even crash wc3. (once I managed to do that with game display :D)
 
Level 13
Joined
Oct 10, 2009
Messages
439
U can easily test everything with game display, just adding them almost after every condition, and if u want to check what is already set on variables.

p.s. If u do this just remove time every 0.03sec. Better change it to when player pushes ESC, because it will spam a lot or may even crash wc3. (once I managed to do that with game display :D)

Yeah, I'm testing to see if it works by using a string test. It's always outputting the wrong things though. So it isn't working
 
Status
Not open for further replies.
Top