SIMPLE trigger, only works SOMTIMES?

Failenx

TH.net Regular
Reaction score
7
Code:
TP 6 AUTO
    Events
        Unit - A unit Finishes training a unit
    Conditions
        (Unit-type of (Trained unit)) Equal to Base Harvester
    Actions
        Unit - Order (Trained unit) to Harvest (Random destructible in Base 6 <gen>)

this only works sometimes, and it's really irritating me.. :banghead:
 

johnnymra

New Member
Reaction score
14
It really depends... your trigger is fine but it refers always to the last trained unit. In case there are multiple Training units/buildings that train those harvester at the same time there is a chance it appears a bug or leak and it doesn't work... My advice is to create a variable to store the trained unit until it's given the order and then make the variable again "empty".
I'm not very good with variables so i can't create an example trigger but this seems your solution.
 

Dave312

Censored for your safe viewing
Reaction score
269
It really depends... your trigger is fine but it refers always to the last trained unit. In case there are multiple Training units/buildings that train those harvester at the same time there is a chance it appears a bug or leak and it doesn't work... My advice is to create a variable to store the trained unit until it's given the order and then make the variable again "empty".
I'm not very good with variables so i can't create an example trigger but this seems your solution.

He is not using any waits so this should not be an issue.

Does the trigger only fail when a destructible has been killed or do you have destructibles other than trees in your region? If so, your trigger is telling the unit to either harvest a tree that is dead, or to harvest a destructible which is not a tree; thus causing it to not work properly.
 

Failenx

TH.net Regular
Reaction score
7
He is not using any waits so this should not be an issue.

Does the trigger only fail when a destructible has been killed or do you have destructibles other than trees in your region? If so, your trigger is telling the unit to either harvest a tree that is dead, or to harvest a destructible which is not a tree; thus causing it to not work properly.

It only has trees.. and none of them are dead when I create the units. I really have no idea why this trigger isn't working for me..
 

Shadow

TH.net Regular
Reaction score
23
maybe try this action instead

Code:
 Destructible - Pick every destructible in (Base 6) and do (Unit - Order (Trained unit) to Harvest (Picked destructible))
 

Aiden

Member
Reaction score
0
wneh you say every destructible thats counts trees and rocks.
you cant harvest rocks...
for example.
 

Shadow

TH.net Regular
Reaction score
23
thought you said it was only trees

well then use this

Code:
Destructible - Pick every destructible in (Base 6) and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                ((Picked destructible) is alive) Equal to True
            Then - Actions
                Unit - Order (Triggering unit) to Harvest (Picked destructible)
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top