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

[Crash] Using "Unit enters in (Playable map area)" event breaks my map

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,852
Hello, in the map I'm working for some reason, I have this 2 triggers that doesn't cause me problems:
  • Calm Mind
    • Events
      • Unit - A unit Gains a level
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Level of CalmMindSpell for (Triggering unit)) Greater than 0
    • Actions
      • Unit - Set Max Mana of (Triggering unit) to ((Max Mana of (Triggering unit)) + CalmMindManaPerLevel)
  • Strong OnLevel
    • Events
      • Unit - A unit Gains a level
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Level of StrongSpell for (Triggering unit)) Greater than 0
    • Actions
      • Unit - Set Max HP of (Triggering unit) to ((Max HP of (Triggering unit)) + StrongHealthPerLevel)
But if I add at least 1 more trigger with the event "A unit enters (Playable map area)" the map gets broken: the unit moving is weird, the other triggers with a "A unit enters in a region (any region, not just the Playable map area)" aren't working and the game crashes when I leave the match, before you asking, I'm not using the 1.33 version, so what's wrong with it?
Since the map is too heavy and my internet is too slow, I can't share you, but I wanna know if there could be for this happening.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
so what's wrong with it?
Cells are being attached to too many regions, breaking some sort of internal data structure or making path finding too complex that a limit is hit.

Every copy of that event is creating a brand new region and associating every cell in the playable map area rect in it, which is a lot of associations and a lot of cells attached to regions. For this reason it is recommended to have the event only once and make that trigger run all other triggers you want to fire on that event.

I am using the JASS context when talking about region and rect. GUI context "regions" are of type rect with the JASS type of region not being directly available to GUI users but used internally as part of that event.
 
Status
Not open for further replies.
Top