• 🏆 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!

couple of questions (map not running triggers, weep's damage detection crashes map)

Status
Not open for further replies.
Level 8
Joined
Jan 8, 2010
Messages
493
1. what could cause a map not running the triggers?
by that, i mean that the triggers are not disabled, nor do i find any bugs or any part of it where a trigger is turned off. but all of the triggers are not running. i have a Map Initialization trigger where some units are hidden and the map is made visible, but when i test the map they're not hidden and the black mask is there.

2. can't Weep's GUI-Friendly Damage Detect (can't find the link, but i have a copy of the page at home) and the unit action "Unit - Damage Target" cannot coincide in the same trigger?
i basically use the weep's system to detect if a damaged unit has a buff. but when i add the action, Warcraft crashes to desktop.

i use JNGP at home, if using it has anything to do with these.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
1. Maybe you crash the main thread that initializes your triggers and runs map init events. This is usually done by having large-sized array variables in GUI as this defaults each element of the array up to the size with the preset value and therefore requires a lot of instructions. An execution thread halts when having performed a certain cap of operations.

2. I do not know about this system but Unit - Damage Target triggers Unit - <unit> takes damage events.
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
@WaterKnight GUI sceptist ;< How could you miss Weep's GDD? It's here for years.

@ronojales It is not recommended to use damage detection system combined with other Events - Unit takes damage (detection systems were inveted for such things - to skip that part >.<).
If actions refering to event GDD_Event becomes Equal to 0.00 are followed by Unit - Damage Target then they create infinite damage loop immidiately crashing war3. The solution is to use action:

  • Trigger - Turn off (This trigger)
  • Unit - Damage Target
  • Trigger - Turn on (This trigger)
The same solution works in every real-value oriented damage detection system.

About 1st question - posting map would be awesome.
 
Even better than disabling the self trigger would be disabling the entire damage detection
trigger to deal that extra amount. Looking at Weep's Damage Detection engine I guess his
doesn't do that, which is strange because I thought it could. You could also use Damage
Modifier to just add to the damage amount as well, which may or may not be the easiest
way.
 
Level 8
Joined
Jan 8, 2010
Messages
493
hello guys. sorry for the late reply. just got enough time to get online. anyway

about WaterKnight's response on the first question, yeah i have some array variables at maximum ([8192]? was it the maximum?) i'll try to leave it at [1] and check if it still doesn't run the triggers. and when i get home i'll post the map if it still doesn't.

--------
oh, and i see. so that's what making it crash. it's not causing fatal errors so i thought that Unit - Damage Target can still be used with Weep's GDD's event, just making a limit or changing something in it. and ok, i'll disable first the system's triggers before doing the damage, since it's quite reasonable to prevent that infinite damage loop.

only that one spell is making the map crash to desktop, so i think i'll still use the system (i never was able to understand Jass :p)
 
@Bribe:
I think your damage detection system can be modified to protect users from creating an infinite loop.
You just have to check if the DamageEvent integer is equal to 1.00 during a damage event.
If that's the case, you'd know a GUIer is going to create an infinite loop.
All you would do then is NOT fire the damage event :p

Since wc3 is single-threaded, the DamageEvent integer in the following actions:

  • Set DamageEvent = 1.00
  • Set DamageEvent = 0.00
won't be 0.00 until all the triggers containing the event "DamageEvent becomes Equal to 1.00" evaluate and execute."
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Or you can add the boolean variable like in DamageModifier - DamageOverride.
Although, in this case user has to do the thing manually.. BUT it has far greater purposes!!! Maggy's solution makes GUI users no brainers - so they can easily forgot what infinity damage loop actually is (like any other infinite loop too) thus they can repeat that mistake (or do similar one) in other triggers!

Better force user to think! :pPPPP
 
Well the issue might be that sometimes you want it to re-trigger some damage.
Say the source damages the target, and upon receiving the damage the target
wants to damage the caster. I've used a similar spell in the past using a "unit is
attacked" event (similar to thorns aura I guess).

I do like the idea of a "don't re-fire damage event" boolean, but is it really that
much easier than just enabling/disabling the DamageEventTrigger?
 
Level 8
Joined
Jan 8, 2010
Messages
493
i guess changing variable arrays from its maximum [8192] to [1] fixed the triggers not running, though i don't really understand why that happened (used to think arrays should match the number of values it would possibly hold) XD

and wow Bribe, that's some fully GUI damage detect. i'll copy the page and check it with my map at home. and of course that GUI Indexer too :O
and i realized that it was really an infinite damage loop (detect damage, damage target, detect again, damage again, blah blah..) that crashes the map.
 
Status
Not open for further replies.
Top