Ive been working on a map and recently got stuck trying to apply buffs to units that are created by another unit.
If I create units at first it applies but after awhile it wont apply the buffs to them. I tried adding a periodic event to see it solves it but it doesnt.
Also I want units created by a trigger to have a different buff but I was able to get them to work but now Im not and its spewing some errors that dont really make sense.
I have a unit if its in a region, easy, medium, hard it should apply 2 buffs (not to the unit in one of those three regions but to all units on the map)
- 1 buff to all human player units already created or to be created
- 1 buff to all NPC player units that will be created by a trigger
If I create units at first it applies but after awhile it wont apply the buffs to them.
It doesn't work this way. Either trigger works or not. Maybe you change something after "a while" and it makes trigger not work.
Also you didn't mention how you create your units.
If it's via Behavior then you use 'Unit is Created' event.
If it's via 'Create Unit' then you may use 'Unit enters region (map)' or simply preform action right after creating unit in same trigger/action.
I have a unit if its in a region, easy, medium, hard it should apply 2 buffs (not to the unit in one of those three regions but to all units on the map) - 1 buff to all human player units already created or to be created - 1 buff to all NPC player units that will be created by a trigger
When unit enters region use 'Unit enters region' event, 'Pick units in (units in region (map) owned by specific player)' and apply buff to picked unit.
When unit leaves region use 'Unit leaves region' event, 'Pick units in (units in region (map) owned by specific player)' and remove the buff from picked unit.
When it comes to created units. Whenever you should apply the buff (after creation) you can pick all units in your buff region, 'If owner of (picked unit) == owner of (created unit) then apply the buff'
Ive been working on a map and recently got stuck trying to apply buffs to units that are created by another unit.
If I create units at first it applies but after awhile it wont apply the buffs to them. I tried adding a periodic event to see it solves it but it doesnt.
Also I want units created by a trigger to have a different buff but I was able to get them to work but now Im not and its spewing some errors that dont really make sense.
I have a unit if its in a region, easy, medium, hard it should apply 2 buffs (not to the unit in one of those three regions but to all units on the map) - 1 buff to all human player units already created or to be created - 1 buff to all NPC player units that will be created by a trigger
Any help would be greatly appreciated, thanks.
It doesn't work this way. Either trigger works or not. Maybe you change something after "a while" and it makes trigger not work.
Also you didn't mention how you create your units.
If it's via Behavior then you use 'Unit is Created' event.
If it's via 'Create Unit' then you may use 'Unit enters region (map)' or simply preform action right after creating unit in same trigger/action.
Indeed, that makes no sense.
When unit enters region use 'Unit enters region' event, 'Pick units in (units in region (map) owned by specific player)' and apply buff to picked unit.
When unit leaves region use 'Unit leaves region' event, 'Pick units in (units in region (map) owned by specific player)' and remove the buff from picked unit.
When it comes to created units. Whenever you should apply the buff (after creation) you can pick all units in your buff region, 'If owner of (picked unit) == owner of (created unit) then apply the buff'
Got it to work with some of that. Also I had figured out if a chooser (unit) went in to one of 5 regions to set the difficulty of the map.
Use variables to have it be checked on which buff to apply based on the variable.
Still throws one error but I think I have it almost figured out.
Just having problems with my AI getting stuck at a certain point of the map... No idea why cause they get unstuck after a period of time @_@...