in my new map i made some functions which adds events to other trigger dynamically - i did this often in wc3 because of performance issues ...
for example: i added a unit enters region event to a trigger with a specified unit which was created by triggers before.
now when i test the map the event triggers with all units while i expected it to just trigger when the specified unit enters the region. :-(
is it bugged? or did i make a mistake?
it is just a part of it - but as you can see the parameter is not null but a unit reference - i really don't know why i need a reference instead of a unit.
that's why i had to code it with a custom script - hope blizzard will change that with a patch ...
only works for pre-placed units. Their references are stored in the map's object file, which is meant by variable. The function probably returned null because of faulty input. That would explain it.
hiho,
in my new map i made some functions which adds events to other trigger dynamically - i did this often in wc3 because of performance issues ... for example: i added a unit enters region event to a trigger with a specified unit which was created by triggers before. now when i test the map the event triggers with all units while i expected it to just trigger when the specified unit enters the region. :-( is it bugged? or did i make a mistake?
Robbepop
You probably made a mistake. Can you post how you did it?
Just from hearing it sounds that the unit variable you're using in the event is null and thus any unit is allowed to trigger.
hiho,
thats how the custom script looks like:
it is just a part of it - but as you can see the parameter is not null but a unit reference - i really don't know why i need a reference instead of a unit. that's why i had to code it with a custom script - hope blizzard will change that with a patch ...
Robbepop
only works for pre-placed units. Their references are stored in the map's object file, which is meant by variable. The function probably returned null because of faulty input. That would explain it.
Use
ok thanks that worked fine ! :D