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. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. Units have been turned into heroes in our latest Icon Contest! Vote for the best icon set at the Icon Contest #18 Poll!
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. 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] Natives and Local variables ...

Discussion in 'Triggers & Scripts' started by mckill2009, Feb 26, 2011.

  1. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Make spells in vJASS. You learn a lot more on that than taking it step by step in this thread.
     
  2. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    Code (vJASS):

    /*
    for paths always use \\

    and ofc I2S(i) and not I2S("i") since anything inside "" is already a string...

    and the parameter inside I2S should be and integer...
    */

     
     
  3. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    Truth is, I'm not reading any tutorials except Jass basic tips by Daelin and here...
    I'm experimenting things in JNGP and Jasscraft and it's going on quite well...thanks to you guys!...
     
  4. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Daelins tutorials are old and outdated. But they probably cover up the most basic of the basic but you need to learn by doing.
     
  5. chobibo

    chobibo

    Joined:
    Sep 24, 2005
    Messages:
    2,692
    Resources:
    0
    Resources:
    0
    Structs aren't used for attaching data, hashtables are. Structs group data together, hashtables don't.
     
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,542
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    hashtables are also a good way to map data to objects because object IDs are conveniently 32 bit like one of the hashtable indicies.
     
  7. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    This I can agree with.


    Although don't you attach data to the struct or have I missed something?
     
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,542
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Yes, but you still use the hashtable to attach the struct to the object type ID.
     
  9. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Ah makes sense.
     
  10. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,187
    Resources:
    153
    Models:
    143
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    153
    Optionally, you can use a unit indexer to give every unit an ID with a value between 1 and 8191. Then you can use this value as an index inside other arrays to store data there.
    This is ofcourse only for attaching stuff to units, not other objects (and it can sometimes be a bit overkill to add an indexing library of 700 lines unless there is great need for it).
     
  11. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    We're just speculating :) I know about Unit Indexers and their features and negatives.
     
  12. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,187
    Resources:
    153
    Models:
    143
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    153
    Yeah, i just wanted to point out the option to the thread creator.