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

[Solved] Need some help with this trigger

Status
Not open for further replies.
  • ´Upgrade Item
    • Events
      • Unit - A unit Begins research
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching ((Owner of (Triggering unit)) Not equal to Neutral Hostile)) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player) of type Troll) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Potion of Healing
                • Then - Actions
                  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 1378889776)
                  • Wait 0.01 seconds
                  • Skip remaining actions
                • Else - Actions
              • Wait 10.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Ancient Figurine
                • Then - Actions
                  • Item - Remove (Item carried by (Picked unit) in slot 1)
                  • Wait 0.01 seconds
                  • Hero - Create Ancient Figurine +6 and give it to (Picked unit)
                • Else - Actions
Can someone tell me whats wrong cause it don't work.

PS: this is not the full code the last rows is copys of the 8 last rows here.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
Memory leaks

(All players matching ((Owner of (Triggering unit)) Not equal to Neutral Hostile))

- That leaks a force. You need to do:

Set TempForce = (All players matching ((Owner of (Triggering unit)) Not equal to Neutral Hostile))
Pick all players in TempForce and do (Actions)
Custom script: call DestroyForce(udg_TempForce)

...

Unit Group - Pick every unit in (Units owned by (Picked player) of type Troll) and do (Actions)

Right before doing this, you need:

Custom script: set bj_wantDestroyGroup = true
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
could you also tell us what exactly is not working?
what is the deal with those wait 0.01? Can't you just remove those?
 
Status
Not open for further replies.
Top