1. The mythological era has spawned some interesting characters around. Check them out and be sure to vote for them in the 30th Poll of the Texturing Contest.
    Dismiss Notice
  2. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  3. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice

[System] MissileRecycler

Discussion in 'JASS Resources' started by Bribe, Oct 27, 2011.

  1. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,333
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
    It would be great if this had some benchmarks.
    GetRecycleUnit vs CreateUnit
     
  2. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
  3. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,333
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    FC == Function Call. I think the "count" was how many he used per .025 seconds so that their FPS was the same. Keep in mind that his recycling method is largely unoptimized, so MissileRecycler is probably 8-10 times faster than creating and removing.
     
  5. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,333
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
    ^ Ahh ok. Thanks Bribe

    EDIT: It turns out, it was in the first post.
     
    Last edited: Sep 2, 2015
  6. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,855
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I think you should fix the part when users try to change the dummy ownership. When recycled, the dummy does not return to Neutral Passive :/
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Updated with that change, and set the dummy owner to Player 13 instead of 15. If I am not mistaken, Player 13 is Neutral Extra. That player can cast both positive and negative buffs on the same target.
     
  8. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,855
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Thank you :D

    I can now update DummyCaster :D
     
  9. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,855
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Sorry for double-posting

    I found out that dummies still cost 1 food :)

    also somehow it shows the idle worker icon :)
     
  10. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,855
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Bribe :V

    Please fix this :V
     
  11. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Thank you for the reminder, I missed your first post somehow. Fixed.
     
  12. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,855
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    May I ask a question?

    I thought you will use Neutral Extra(which is 14), but why did you use Neutral Victim instead?
     
  13. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I couldn't figure out if it was player 13 or player 14 and there was no information about which one was which online. Well, thanks for the correction, I've updated it again.
     
  14. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    It's documented in the blizzard.j

    // Game constants
    ...
    constant integer bj_MAX_PLAYERS = 12
    constant integer bj_PLAYER_NEUTRAL_VICTIM = 13
    constant integer bj_PLAYER_NEUTRAL_EXTRA = 14
    ...
     
  15. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Aha, I was searching for it without the bj_ prefix. Thanks!
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
  17. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    That looks different from the last diagram you made. Did you change something or did you illustrate it with more detail?
     
  18. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    More detail probably : )

    Didn't answer my question though : o
     
  19. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    "when" is tough to say. I don't have much motivation to do that right now.
     
  20. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,199
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Code (vJASS):
    function GetRecycledMissile takes real x, real y, @real z@, real facing returns unit

    I think dummy's fly height won't work if we don't have AutoFly. So is it a must to use AutoFly?

    Also, are we supposed to chose from one of those unit indexers or we are allowed not to have any unit indexer?