• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Map needs eterneties to load

Status
Not open for further replies.
Level 10
Joined
May 21, 2006
Messages
323
My map has almost nothing in it until now, and needs already 3:30 min to load, I have until now almost 300 triggers but thats only the system, I tried to delete everything on the map + triggers + ..., but the lagg is still there even then there is nothing on the map. Can anybody tell me what probably causes these laggs?
 
Level 10
Joined
May 21, 2006
Messages
323
I use a custom Item inventory and of course the Hero doesnt own the items directly for example he has a sword +20 attackpower, he lays it on the item is placed in a reserved area and a passive ability of the hero is set to level 20+1 so he gets the bonus.

Maybe someone could explain another way.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
If you're saying that the spells are required for high stats (say you need an ability with 300 levels because you can have +300 Strength or something), then I have a way better solution for you :D
Binary.

Say you have 10 spells:
  • +1 Dmg
  • +2 Dmg
  • +4 Dmg
  • +8 Dmg
  • +16 Dmg
  • +32 Dmg
  • +64 Dmg
  • +128 Dmg
  • +256 Dmg
  • +512 Dmg
(These are all invisible for the players and can stack, if you use the item abilities)
With these 10 spells, you can boots a unit's damage with any number between 1 and 1023 (add all of them together).
(If you add -1024 Dmg, it can go from -1024 to +1023).
This adds up really quickly (with only 16 spells, you can add any number between 1 and 131k damage).


From here on: credits to Earth-Fury for the idea
It may look difficult to implement, but it is actually surprisingly easy.

The first thing you need to do is create a few variables.
I use "powersOf2" (an integer variable, with array) and "damageBonus" (also an integer variable with array).

Now here's a little bit of JASS, but don't be afraid... this will make everything a lot easier and it is really easy to understand (I'll guide you through it).

JASS:
function setupBonusData takes nothing returns nothing
    local integer i = 1

    set udg_powersOf2[0] = 1
    loop
        set udg_powersOf2[i] = udg_powersOf2[i - 1] * 2
        set i = i + 1
        exitwhen i == 16
    endloop

    set udg_damageBonus[0] = 'A000'
    set udg_damageBonus[1] = 'A001'
    set udg_damageBonus[2] = 'A002'
    set udg_damageBonus[3] = 'A003'
    set udg_damageBonus[4] = 'A004'
    set udg_damageBonus[5] = 'A005'
    set udg_damageBonus[6] = 'A006'
    set udg_damageBonus[7] = 'A007'
    set udg_damageBonus[8] = 'A008'
    set udg_damageBonus[9] = 'A009'
endfunction

Let us start off with something you just need to know: "udg_" means that it's a variable from the variable editor (User Defined Global).

The powers of 2 are just to make the system a lot easier and the loop sets up those numbers. The array indicates the exponent of the 2 (powersOf2[4] would be 2^4, which is 16).

Then we set up the damageBonus-variable. These are raw ID's of the spells you just created.
To view raw ID's in the object editor, simply press CTRL + D (your values will most likely be different from mine).
This has to sync up with the powersOf2 variable, so the damage bonus of the ability stored in damageBonus[6] should be powersOf2[6] (aka 2^6 or 64).

To add this to your map, simply copy and paste it in the map header (above all categories, you can click the name of your map. This is the header, paste it on the right side of the screen).
Then, in some map init-trigger, use
  • Custom script: call setupBonusData( )
Now you have the choice between 2 options: GUI and JASS.

The system will look like this:
  • Set Damage
    • Events
    • Conditions
      • bonusDamage Less than (powersOf2[9] x 2)
    • Actions
      • Set bonusCurDamage = 0
      • Set tempInt = 9
      • Custom script: loop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • powersOf2[tempInt] Less than or equal to (bonusDamage - bonusCurDamage)
          • bonusCurDamage Not equal to bonusDamage
        • Then - Actions
          • Custom script: call UnitAddAbility( udg_tempUnit, udg_damageBonus[udg_tempInt] )
          • Set bonusCurDamage = (bonusCurDamage + powersOf2[tempInt])
        • Else - Actions
          • Custom script: call UnitRemoveAbility( udg_tempUnit, udg_damageBonus[udg_tempInt] )
      • Set tempInt = (tempInt - 1)
      • Custom script: exitwhen udg_tempInt < 0
      • Custom script: endloop
To add damage to a unit, simply do:
  • Actions
    • Set tempUnit = Unit
    • Set bonusDamage = 50
    • Trigger - Run Set Damage <gen> (checking conditions)
It should work.


This can also be pasted in the map header (right below the setup).
JASS:
function setBonusDamage takes nothing returns nothing
    local integer i = 9
    local integer curDmg = 0
    
    if udg_bonusDamage >= udg_powersOf2[9]*2 then
        return
    endif
    
    loop
        if udg_powersOf2[i] <= udg_bonusDamage - curDmg then
            call UnitAddAbility( udg_tempUnit, udg_damageBonus[udg_tempInt] )
        else
            call UnitRemoveAbility( udg_tempUnit, udg_damageBonus[udg_tempInt] )
        endif
        set i = i-1
        exitwhen i < 0
    endloop
endfunction

To add damage to a unit:
  • Actions
    • Set tempUnit = Unit
    • Set bonusDamage = 50
    • Custom script: call setBonusDamage( )
Right now it may look like a lot of work (because you know, this is quite a long post), but it will probably increase your loading speed with 200% (if not more).
It also allows you to add larger bonuses to units (this can be used for everything: damage, armor, hero stats, ...).

Hope it helps.
 
Level 10
Joined
May 21, 2006
Messages
323
Yeah I was successful in fighting the lagg ^^ Thanks for your long post but it´s not neccessary I use a real complicated Modified Version of Bribes DDS and no unit in my Map uses it´s own attackdamage everything is made with Variables, I simply wanted to use the Attackbonus ability to show the damage but now I deleted it and my maps loads much faster.
 
Status
Not open for further replies.
Top