I'm using a bunker to train units using the ability direct from the barracks and I'm trying to find a way so that when they've trained they spawn in the bunker instead of outside it. Hoping to do this with the data editor but whatever gets the job done ^^
Try using an Issue Order effect to order the unit to enter the bunker. You can trigger the effect on spawn by making a behavior that lasts 0.01 seconds and has the Issue Order effect as its Final Effect, and then add that behavior to the unit type. (That's if you want to do data editor only and not use triggers.)
It's a little tricky because you have to use a Search Area effect + validator to find the bunker, and then order the bunker to load the unit, but it should be doable. There might be a simpler way but that's how I'd go about doing it.
I've found a way (I think) to create the marines in the bunker when it is complete via a trigger but I can't seem to get it to work. Here's the trigger:
Event
Unit - Any Unit training is Completed
Condition
(Unit type of (Triggering unit)) == Bunker
Actions
Unit - Create 4 Marine as cargo in (Triggering Unit)
Any ideas why it doesn't work? I've tried a lot of variations including "Triggering Cargo Unit" but to no avail. I've also added a message to display when the trigger executes, but it's not even executing but I can't see why it shouldn't.
Try "Triggering progress unit". It works for construction so I guess it's the same for training. Triggering unit probably refers to the unit that is being trained, not the unit that is training.
Are you sure you are actually training the units from the Bunker? Because when I tested it with Barracks, the trigger works just fine.
This trigger displays "Training complete." when a unit is trained from Barracks. "Triggering unit" refers to the Barracks and "Triggering progress unit" refers to the unit that was trained (I tested this too).
Ty for testing that but I'm not actually training the marines per se, just trying to creating them as cargo when the map detects a bunker has been built.
Ah, why didn't you say so! The bunker is not being trained, it's being constructed.
Events
Unit - Any Unit construction is Completed
Local Variables
Conditions
(Unit type of (Triggering progress unit)) == Bunker
Actions
Unit - Create 4 Marine as cargo in (Triggering progress unit)
I'm using a bunker to train units using the ability direct from the barracks and I'm trying to find a way so that when they've trained they spawn in the bunker instead of outside it. Hoping to do this with the data editor but whatever gets the job done ^^
Bamp
Could you set up a trigger so that when it is trained you order it to move into the bunker immediately?
@Maul2: Go
Try using an Issue Order effect to order the unit to enter the bunker. You can trigger the effect on spawn by making a behavior that lasts 0.01 seconds and has the Issue Order effect as its Final Effect, and then add that behavior to the unit type. (That's if you want to do data editor only and not use triggers.)
It's a little tricky because you have to use a Search Area effect + validator to find the bunker, and then order the bunker to load the unit, but it should be doable. There might be a simpler way but that's how I'd go about doing it.
@RileyStarcraft: Go
I've found a way (I think) to create the marines in the bunker when it is complete via a trigger but I can't seem to get it to work. Here's the trigger:
Event
Unit - Any Unit training is Completed
Condition
(Unit type of (Triggering unit)) == Bunker
Actions
Unit - Create 4 Marine as cargo in (Triggering Unit)
Any ideas why it doesn't work? I've tried a lot of variations including "Triggering Cargo Unit" but to no avail. I've also added a message to display when the trigger executes, but it's not even executing but I can't see why it shouldn't.
Try "Triggering progress unit". It works for construction so I guess it's the same for training. Triggering unit probably refers to the unit that is being trained, not the unit that is training.
@A1win: Go
No luck
Edit: I was able to get the trigger to execute by disabling the conditions but the marines were never created.
Are you sure you are actually training the units from the Bunker? Because when I tested it with Barracks, the trigger works just fine.
This trigger displays "Training complete." when a unit is trained from Barracks. "Triggering unit" refers to the Barracks and "Triggering progress unit" refers to the unit that was trained (I tested this too).
Ty for testing that but I'm not actually training the marines per se, just trying to creating them as cargo when the map detects a bunker has been built.
Ah, why didn't you say so! The bunker is not being trained, it's being constructed.
OH MY GOD YES! <3<3<3<3 ty :)