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

[Solved] Copied triggers for spells not working properly on my custom map

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
hi, i jst copied the berserker spells from dota map and it never work even after i copied exact trigger, spell, buff and dummy. unit can someone find out the problem source? i will attach the dota map and the test map where i did copied the spells from dota map.
 

Attachments

  • DotA Spellpack 2 In 1.w3x
    48.7 KB · Views: 24
  • test map berserkercall.w3x
    35.9 KB · Views: 26
Level 37
Joined
Jul 22, 2015
Messages
3,485
When I first saw the triggers in your test map, my initial guess was that the unit group array wasn't being initialized because WC3 is weird. Lo and behold, I was right :D

In DotA Spellpack 2 In 1, the size of the unit group array BerserkerCall_AttackGroup is 1000 where yours is 1.

An extremely easy fix is to just enter the variable editor and change the array size to 1000 as well (or some other huge arbitary number), or you can add this to the trigger:
  • on index
    • Custom script: if (udg_BerserkerCall_AttackGroup[udg_BerserkerCall_Counts] == null) then
    • Custom script: set udg_BerserkerCall_AttackGroup[udg_BerserkerCall_Counts] = CreateGroup()
    • Custom script: endif
  • on deindex
    • Custom script: call DestroyGroup(udg_BerserkerCall_AttackGroup[udg_BerserkerCall_CustomValue])
    • Custom script: set udg_BerserkerCall_AttackGroup[udg_BerserkerCall_CustomValue] = null
I recommend the latter solution.
 
Status
Not open for further replies.
Top