So i looked around found only 2 threads regarding it but the way they show trigger work is weird and i cannot make such trigger as they shown. Take a look a this one i need help and i'm stuck halfway in actions:
"EASY WAY
Event
Unit - A unit Finishes construction
Condition (if you only want to apply to some buildings, do that here)
Action
Set constructor = (Random unit from (Units within 120.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Peasant)))
Unit - Remove constructor from the game
Unit - Kill constructor
Replace "Peasant" with whatever builds the building. You may need to change the "120" to a larger number depending on pathing. This trigger works by picking a random peasant near any finished building and killing it. It's imprecise and you may end up killing the wrong peasant unfortunately. That won't be a big deal unless the other peasant is constructing something. It will also only remove one peasant if you have multiple peasants building"
As i understand "Set" is for variable so i made it so, and i made Variable for unit group. However after i have no way of removing it. Unit - remove doesnt have option to remove that variable. ANd when i swap Variable to Unit instead of unit group, i cannot make this variable at all. Also this will work on unit constructing unit if we will get this to work?
"EASY WAY
Event
Unit - A unit Finishes construction
Condition (if you only want to apply to some buildings, do that here)
Action
Set constructor = (Random unit from (Units within 120.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Peasant)))
Unit - Remove constructor from the game
Unit - Kill constructor
Replace "Peasant" with whatever builds the building. You may need to change the "120" to a larger number depending on pathing. This trigger works by picking a random peasant near any finished building and killing it. It's imprecise and you may end up killing the wrong peasant unfortunately. That won't be a big deal unless the other peasant is constructing something. It will also only remove one peasant if you have multiple peasants building"
As i understand "Set" is for variable so i made it so, and i made Variable for unit group. However after i have no way of removing it. Unit - remove doesnt have option to remove that variable. ANd when i swap Variable to Unit instead of unit group, i cannot make this variable at all. Also this will work on unit constructing unit if we will get this to work?