[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.
 
Level 37
Joined
Sep 26, 2009
Messages
8,446
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