HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

UnitAddAbility

01-22-2008, 04:34 PM#1
chobibo
When I used it on a spell, the first time that spell is cast, it lags. Does this happen to you or am I just making bad scripts. here is my script:
Expand JASS:

This was the attachment system I used with this spell:
Expand JASS:
I'm not sure if my attachment system is to blame here because when I commented out the unitaddability function it worked without the lag. Can someone help me please thanks! btw the ability I'm adding is Item Armor Bonus + 10.
01-22-2008, 05:07 PM#2
Troll-Brain
The easiest way is to create a dummy unit and add all custom abilities.
at the init of the map, remove the unit

Collapse JASS:
private function TimerInitialize takes nothing returns nothing
    local integer index = 0
    
    loop
        exitwhen index > MAX
        set Timer[index] = CreateTimer()
        set TimerCheck[index] = false
        set index = index + 1
    endloop
    
    set Indexer = H2I(Timer[0])
endfunction

constant integer JASS_MAX_ARRAY_SIZE = 8192

So actually you try to create 8193 timers.
But the index max is 8191, and if you use the 8191 index of a variable, warcraft3 will crash on a load saved game
01-22-2008, 06:12 PM#3
chobibo
ok thanks! I can't rep you yet but i'll do ! thanks again troll
01-22-2008, 06:49 PM#4
Troll-Brain
Quote:
Originally Posted by chobibo
ok thanks! I can't rep you yet but i'll do ! thanks again troll
@off topic :
I don't care about rep.
I don't have post any ressource and i'm not a child who need some sweets or make him cry.
Btw i don't say that i don't like sweets :p
01-23-2008, 03:35 AM#5
chobibo
But I do care, it's good manners to give rep to someone who has helped you a lot, and you did help me. : )