• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What's wrong with this trigger?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
Since 2002 i am developing many maps and still i am active. But it is the first time i see something like this.

What is the difference between these 2 triggers? I have turned off all triggers for the testing purpose but what is wrong with this trigger...

Region 27 just a part of the map including tree i am harvesting.
 

Attachments

  • zzz.png
    zzz.png
    9.6 KB · Views: 34
Level 25
Joined
Sep 26, 2009
Messages
2,378
There is a limit on how many destructibles are picked by the "A destructible within region dies" event on trigger creation. Don't know the exact number, though.

Edit: Just checked, the limit is 64 destructibles
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
There is a limit on how many destructibles are picked by the "A destructible within region dies" event on trigger creation. Don't know the exact number, though.

Edit: Just checked, the limit is 64 destructibles
Wow wait. That makes a difference. My trigger was working well and today was added many trees on the map. That means i have to split the world into many regions and try not to add more than 64 destructibles within the region right?

Thank you by the way. It seems you found the problem.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Wow wait. That makes a difference. My trigger was working well and today was added many trees on the map. That means i have to split the world into many regions and try not to add more than 64 destructibles within the region right?
Or write your own custom script implementation of the event which does not have such a limit.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Thank you for your help. I have already added 45 different regions at the event. It seems absurd but it works.
Or instead of...
JASS:
function TriggerRegisterDestDeathInRegionEvent takes trigger trig,rect r returns nothing
    set bj_destInRegionDiesTrig = trig
    set bj_destInRegionDiesCount = 0
    call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum)
endfunction

function RegisterDestDeathInRegionEnum takes nothing returns nothing
    set bj_destInRegionDiesCount = bj_destInRegionDiesCount + 1
    if (bj_destInRegionDiesCount <= bj_MAX_DEST_IN_REGION_EVENTS) then
        call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
    endif
endfunction

Use...
JASS:
function TriggerRegisterDestDeathInRegionEventNoLimit takes trigger trig,rect r returns nothing
    set bj_destInRegionDiesTrig = trig
    call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionNoLimitEnum)
endfunction

function RegisterDestDeathInRegionNoLimitEnum takes nothing returns nothing
    call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
endfunction
Which has the limit logic removed from it.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Or instead of...
JASS:
function TriggerRegisterDestDeathInRegionEvent takes trigger trig,rect r returns nothing
    set bj_destInRegionDiesTrig = trig
    set bj_destInRegionDiesCount = 0
    call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum)
endfunction

function RegisterDestDeathInRegionEnum takes nothing returns nothing
    set bj_destInRegionDiesCount = bj_destInRegionDiesCount + 1
    if (bj_destInRegionDiesCount <= bj_MAX_DEST_IN_REGION_EVENTS) then
        call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
    endif
endfunction

Use...
JASS:
function TriggerRegisterDestDeathInRegionEventNoLimit takes trigger trig,rect r returns nothing
    set bj_destInRegionDiesTrig = trig
    call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionNoLimitEnum)
endfunction

function RegisterDestDeathInRegionNoLimitEnum takes nothing returns nothing
    call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
endfunction
Which has the limit logic removed from it.
Thank you so much for this but sadly i don't know jass system :( i don't know how to implement this into my map. Error appears when i try to put it into my map.
 

Attachments

  • zzz.png
    zzz.png
    59.1 KB · Views: 16
Level 17
Joined
Jun 2, 2009
Messages
1,137
That is because you are copying the function that already exists as part of the game to implement the GUI event. I only placed that there for reference so you could see how it was implemented (no black box).
Another words i don't know what to do with this trigger. In the other hand i don't want to force you for anything. I just copied it into my map.
Edit: Somehow still my trigger not working properly. Region includes 33 destructibles but my trigger cannot read some of the trees. I have to go sleep now. Demoralized & tired.
 
Another words i don't know what to do with this trigger. In the other hand i don't want to force you for anything. I just copied it into my map.
Edit: Somehow still my trigger not working properly. Region includes 33 destructibles but my trigger cannot read some of the trees. I have to go sleep now. Demoralized & tired.
It's easy to call a GUI trigger from jass, meaning that it's possible to use @Dr Super Good "trick" and have the "main trigger" in GUI. You only have to put a tiny amount of jass in the map.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
It's easy to call a GUI trigger from jass, meaning that it's possible to use @Dr Super Good "trick" and have the "main trigger" in GUI. You only have to put a tiny amount of jass in the map.
I have created 2 triggers, converted these triggers to custom text, and copied 2 jass triggers within these triggers. Here is the screenshots.
I already did and it gave me error like this. I believe he assumed i know how to work with jass triggers because of my 18 years old map developer carrier but i am not smart to understand this language. And as i said, nobody have to help me. You already helped me a lot. If i will gonna ask more about this Jass trigger, probably you will gonna waste your time with me.
 

Attachments

  • zzz.png
    zzz.png
    59.1 KB · Views: 13
  • zzz2.png
    zzz2.png
    59.8 KB · Views: 15
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I already did and it gave me error like this.
That is the same error which I explained before.
That is because you are copying the function that already exists as part of the game to implement the GUI event. I only placed that there for reference so you could see how it was implemented (no black box).
You want to copy the other set of functions. You can then call it in an initialization trigger to add the event to another trigger. Turn triggers to custom script to see the trigger variable name they are using, that is the trigger reference you need to pass the function. You can also use this approach to lookup the name of the rect you want to use and pass the function.
 
Last edited:
Status
Not open for further replies.
Top