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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Maybe it should be an option like with TimerUtils.
     
  2. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,167
    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,167
    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,934
    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,167
    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,167
    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,167
    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,449
    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,167
    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,449
    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,167
    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 =)