1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Fill your cup and take your pick among the maps best suited for this year's Hive Cup. The 6th Melee Mapping Contest Poll is up!
    Dismiss Notice
  4. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  5. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] {idea} [vJass] (System) CustomAttack

Discussion in 'Triggers & Scripts' started by Anachron, Apr 19, 2010.

  1. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    981
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Maybe it should be an option like with TimerUtils.
     
  2. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Hmm I would rather use one hashtable as having that limit.
     
  3. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    If you're concerned with it, then use hash-tables. I always try to avoid using them where they aren't absolutely necessary, because there are only 256 of them allowed at a time.

    I don't think that AutoIndex recycles units.
     
  4. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yes, but normally you won't reach 256 of them (I mean seriously, which map has systems that together need 256 hashtables?)
     
  5. Craka_J

    Craka_J

    Joined:
    Mar 25, 2004
    Messages:
    4,933
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Wc3:WoW? :D
     
  6. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    And you normally wouldn't reach 1200 units.
     
  7. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    In an AOS? Of course.
     
  8. SlayerII

    SlayerII

    Joined:
    Aug 21, 2008
    Messages:
    526
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    i did not read the whole tread, but i have a quesion to the previos page:
    wy you need a damage detection when you using a custom damage engine? i wrote a simple one for myself, and i simply build in a damage detection.
     
  9. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    I only provided a tool in which it would allow very easy reference to every unit's most recent damage events. In his case it was only necessary to gather the damage which is why I had an array of real variables.

    Either way, it isn't necessary to use hash-tables either way unless you're planning on having more than 8191 units because you can always use some other vJass features to help you out:

    Code (vJASS):
    type eventDamageArray extends real array [5, 40955]


    Now instead of having an array of real variables we can simply use:

    Code (vJASS):
    struct UnitDamage
        eventDamageArray eventDamage

        ...
    endstruct


    We have increased the maximum capacity of the real array such that even with an array of size 5, we can still have 8191 instances of it. Though, now hash-tables may be a little faster. It's up to you what you want to use.
     
  10. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    So what's the deal with it when its slower and has limits?
    I think I will "waste" one hashtable.
     
  11. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Erm. What?

    The reason an array of size 5 (real array) "cannot" be added to the data-struct is because then there are 5 dedicated instances required for each struct, which reduces the amount of maximum structs of that type that you can have. By simply compressing that into a single variable (non-array) that extends an array of size 5 and given extended array parameters we can eliminate this limit, though then (because the way JassHelper processes things) the array references would probably (not sure here) be the same as hash-tables.

    If you have been reading, it's not "slower and has limits". It's either slower and has no limits, or has limits and is much faster.
     
  12. SlayerII

    SlayerII

    Joined:
    Aug 21, 2008
    Messages:
    526
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    well , hashtables are pretty fast=)
    they are one of the best things blizz made.
     
  13. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    I know this but thanks.

    Yeah, that is what I meant. I don't like the limits.
     
  14. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    It's entirely up to you. If you do what I showed you by defining an "extra large" array then you most likely won't have any problems with unit amounts. It's up to you.
     
  15. Cweener

    Cweener

    Joined:
    Oct 10, 2009
    Messages:
    1,440
    Resources:
    1
    Maps:
    1
    Resources:
    1
    It's up to you. (insert persuasive reason why my way is better here). It's up to you. :p
     
  16. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Oh I guess I did say it twice. That's pretty funny. I'm not trying to persuade him to use either of them.
     
  17. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yes, he's only trying to bring things closer to me which I don't know because he knows that I don't see the good points about the systems that I don't know about.
     
  18. Cweener

    Cweener

    Joined:
    Oct 10, 2009
    Messages:
    1,440
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I didn't say he was wrong. It just made me laugh a little:)
     
  19. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    When I saw that I had posted it twice in the same line I giggled a little too.
     
  20. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Lol, now I see it as well. Haha. Btw, stop offtopic =)