System PUI - Perfect Unit Indexing

Discussion in 'Systems and Snippets' started by Cohadar, Dec 1, 2007.

  1. Rheias

    Rheias New Helper (I got over 2000 posts)

    Ratings:
    +232 / 0 / -0
    Ok, got it! :) Thanks for taking your time to explain it to me Cohadar.
     
  2. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    There is more than one way to use PUI.
    I will write a good tutorial on this when I get the time.

    Version 4.1

    EDIT: Tutorial
     
  3. gref

    gref New Member

    Ratings:
    +33 / 0 / -0
    Good system. I already use it for a couple of things. That is all.
     
  4. SerraAvenger

    SerraAvenger Cuz I can

    Ratings:
    +236 / 0 / -0
    And to decrease readability : /
    Also, you don't need vJass nor advanced coding for it. It works with basic Jass aswell ; )

    But yes, the 2 fewer context changes would make it a bit faster.

    GetUnitIndex( unit ) gives the unit a certain, unique custom value which then can be used as an array index for things you need to attach to the unit. However the custom value of the unit must not be changed again later.
     
  5. soulreaping

    soulreaping New Member

    Ratings:
    +17 / 0 / -0
    Question:
    Have you thought of extending the 2047 limit?
    Is it possible or it's a limitation given by SetUnitUserData?
     
  6. Joker(Div)

    Joker(Div) Always Here..

    Ratings:
    +86 / 0 / -0
    No map is going to create over 2048 units that need an index on the map at the same time. The numbers are recycled, so really the limit doesn't mean much.

    Any reason why this is not approved yet?
     
  7. cr4xzZz

    cr4xzZz Also known as azwraith_ftL.

    Ratings:
    +51 / 0 / -0
    > Any reason why this is not approved yet?
    Yes. Where is v4.2? :) I saw it in WC3C but it's not here?
     
  8. emjlr3

    emjlr3 Change can be a good thing Staff Member

    Ratings:
    +396 / 0 / -0
    yes.....thats the reason....

    but seriously, even I use this now (BLURG!?!?!?), I think it is time...
     
  9. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    OMG I forgot to update this?
    Why the hell noone PM-ed me?

    It is updated now.
     
  10. Insane!

    Insane! Shh I didn't edit this, go away.

    Ratings:
    +121 / 0 / -0
    Any way to make this gui freindly, cause im such a jass newb
     
  11. emjlr3

    emjlr3 Change can be a good thing Staff Member

    Ratings:
    +396 / 0 / -0
    or rather, your a GUI newb, as in, GUI users are noobs.... :)

    approved
     
    • Like Like x 1
  12. phyrex1an

    phyrex1an Staff Member and irregular helper Staff Member

    Ratings:
    +446 / 0 / -0
    This system already is extremely GUI friendly.
    Code:
    Set SomeUnit = <whatever unit>
    Custom Script: set udg_AnInteger = GetUnitIndex(udg_SomeUnit)
    However, I do think that you have greater problems in GUI than the ones this system solves.
     
  13. Burningicce9

    Burningicce9 Cool Member

    Ratings:
    +1 / 0 / -0

    Still, it makes MUI in GUI a lot easier.
     
  14. Matrix

    Matrix New Member

    Ratings:
    +5 / 0 / -0
    1 more question:
    If I use PUI I:
    1) Can't use GetUnitUserData
    2) Can use GetUnitIndex // or whatever u said
    ???
     
  15. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
  16. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    Version 5.0
     
  17. quraji

    quraji zap

    Ratings:
    +143 / 0 / -0
    Not too perfect to receive updates :p
     
  18. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    Only cohadar can make perfect things better, such is the nature of universe.
     
  19. Darthfett

    Darthfett Super Mod

    Ratings:
    +614 / 0 / -0
    Is there any file or guide that I can read to see what's new in the version 5.0?

    I like this system, but I want to know if it's worth replacing the old version with the new one.
     
  20. Cohadar

    Cohadar master of fugue

    Ratings:
    +209 / 0 / -0
    Yet it is worth replacing because of new textmacros that make some things easier. You can find examples in demo map of course.
    (besides system is 100% backwards compatible)
     

Share This Page