I have a trigger firing off "any unit becomes idle" and "any unit unloads cargo".
In the action part of my triggers, I have an if/then/else statement and in the condition I need to check to see if the triggering unit was the idle unit or the unloaded cargo unit. Is this possible?
If its not I can make two seperate triggers, but I am trying to avoid that
@nevjmac: Go
First of all you don't need "any unit unloads cargo" event. Cos any unit that don't have orders and hasn't bean created with actions will have idle orders. That includes unloaded units.
So no. You can`t make that check.
Only way you can make that check in single trigger is this:
Add unit(Last unloaded or something like this) to unit group
Then in condition pick each unit in that group and check if that's the one you looking for.
I am having to use two triggers unless that condition can be created.
The any unit becomes idle event does not trigger when a unit is unloaded from cargo, so that's why I wanted them in one trigger.
As they are issuing the same order, but one has to use "triggering cargo unit" the other has to use "triggering unit". and if they are both there without an if-then-else, you get trigger errors.
Far as i know there can only be one triggering event so you would need to find one that encompasses both. Conditions can have an "or" and then an action dependent upon if one or either is true. You can use a larger scale trigger somthing like map initialization or "unit is given command" and have the conditions check which command is given and respond accordingly.
You could try adding a dummy behavior to units in cargo and using that as the conditional check. I'm not sure but you may be able to create an effect as a unit is unloaded (via the data editor.) With this you could get creative and find a way to run an event based on that behavior.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a trigger firing off "any unit becomes idle" and "any unit unloads cargo".
In the action part of my triggers, I have an if/then/else statement and in the condition I need to check to see if the triggering unit was the idle unit or the unloaded cargo unit. Is this possible?
If its not I can make two seperate triggers, but I am trying to avoid that
@nevjmac: Go First of all you don't need "any unit unloads cargo" event. Cos any unit that don't have orders and hasn't bean created with actions will have idle orders. That includes unloaded units.
So no. You can`t make that check.
Only way you can make that check in single trigger is this:
Add unit(Last unloaded or something like this) to unit group
Then in condition pick each unit in that group and check if that's the one you looking for.
@Fireball14: Go
I am having to use two triggers unless that condition can be created.
The any unit becomes idle event does not trigger when a unit is unloaded from cargo, so that's why I wanted them in one trigger.
As they are issuing the same order, but one has to use "triggering cargo unit" the other has to use "triggering unit". and if they are both there without an if-then-else, you get trigger errors.
(Triggering Cargo Unit) = No Unit?
Far as i know there can only be one triggering event so you would need to find one that encompasses both. Conditions can have an "or" and then an action dependent upon if one or either is true. You can use a larger scale trigger somthing like map initialization or "unit is given command" and have the conditions check which command is given and respond accordingly.
This is wrong, a trigger can have as many events as it wants.
Sounds like your best bet for me.
no dice :(
have ended up just using two triggers that call the same action
You could try adding a dummy behavior to units in cargo and using that as the conditional check. I'm not sure but you may be able to create an effect as a unit is unloaded (via the data editor.) With this you could get creative and find a way to run an event based on that behavior.