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 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  4. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  10. 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.

[System] Dummy

Discussion in 'Graveyard' started by Nestharus, Mar 31, 2012.

  1. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    This resource has moved here.

    --

    gone
     
    Last edited by a moderator: Jan 17, 2018
  2. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Code (vJASS):
    set node.stamp = TimerGetElapsed(stampTimer) + .73


    This should be:

    Code (vJASS):

    set stamp = TimerGetElapsed(stampTimer) + .73
    if stamp > node.stamp then
        set node.stamp = stamp
    endif
     


    Other than that, I will repeat the tests I did on MissileRecycler with this and if it goes as expected I'll deprecate MissileRecycler for this.
     
  3. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I like this. That way, instead of having lots of people handle their dummies differently if they wanted to make some DummyX system, they would just use this.

    I think Particle should extend off of this.
     
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I don't see how this is possible:

    Code (vJASS):

    //min == max - 1
    //max == min + 1
     


    What if you take 2 dummies from angle 45, you only need to drag one dummy from a max queue to balance that out. But your max is still unchanged until you deplete all queues that are set to that max slot. So in that case the difference between min and max can be > 1.
     
  5. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Instead of using that timer for timestamps, couldn't you use the getElapsedTime function from ElapsedGameTime? :eek:
    It returns a simple math operation (1 division) and it inlines
     
  6. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    The map maker can consolidate things like that imo, but in the end it's up to Nestharus to add a library requirement which gives 0 utility otherwise.

    It's comparible to a universal GetLocationZ native. There is a reason why these things never take off.
     
  7. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    That wouldn't be logical from Nestharus if he don't use it, since he is a fan of this kind of stuff, like WorldBounds.
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    but mag said that it has extra division in it D:

    Also Bribe, I see what you mean by the stamps ; )
     
  9. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Fixed.
     
  10. Nestharus

    Nestharus

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


    If mag didn't have the extra division in there, I'd gladly use it.

    I'll look at it to verify what mag said.

    edit
    looked at it and I don't like it in the slightest, lol


    it's a lot more than a simple elapsed game time snippet, furthermore it has a division thing in it. If it were just a thing with a timer in it that returned the elapsed time of the timer, I'd use it, but it isn't that at all.
     
  11. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    A division zomg, it will for sure make wc3 to crash.
     
  12. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Ok, updated the part Bribe wanted me to ; )

    Code (vJASS):

                    /*
                    *   .73 seconds is how long it takes for a dummy to rotate 180 degrees
                    *
                    *   Credits to Bribe for these 4 lines of code and the .73 value
                    */

                    set stamp = TimerGetElapsed(stampTimer) + .73
                    if (stamp > node.stamp) then
                        set node.stamp = stamp
                    endif
     
     
  13. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    That's not an extra division O-o

    That division gets rid of a TimerGetElapsed call D:

    edit
    If you want, I can split to one system with extensions.
     
  14. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Ok, so people may be wondering what the difference is between this and Bribe's recycler is. The main difference is that this is O(1) and Bribe's is O(n) ^_-. I spent a long time developing an algorithm that would be O(1) ;o. If you look for loops in this, the only loop is in the init method when dummies are initially created ^_-.

    Bribe later released one that was O(1), but it didn't have the great behavior that this one has because it didn't stay sorted for recycling (to ensure that all facings have around the same # of dummies).

    Anyways, that's the big difference >: o.

    This resource also influenced Bribe's a bit (the move to O(1) in order to stay competitive and the addition of PauseUnit in order to keep the resource running smoothly with lots of dummy units in the background). Ofc, Bribe's resource also influenced mine (recycling based on facing).

    Anyways, no known bugs atm.
     
  15. Kingz

    Kingz

    Joined:
    Jun 5, 2008
    Messages:
    2,470
    Resources:
    6
    Spells:
    5
    Tutorials:
    1
    Resources:
    6
    Code (vJASS):
    set last = 360/ANGLE_SPACING*ANGLE_SPACING


    Won't this always set the last to 360? Might be wrong but felt like asking.
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    No, that is integer arithmetic =).

    360/17 = 21
    21*17 = 357

    357 != 360


    So 360/17*17 = 357
     
  17. Kingz

    Kingz

    Joined:
    Jun 5, 2008
    Messages:
    2,470
    Resources:
    6
    Spells:
    5
    Tutorials:
    1
    Resources:
    6
    Damn didn't notice the integer, used to work with real when dealing with angles/radians.
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Modulo arithmetic is one of the greatest things available in programming. Before I learned about it I was too naive to come up with MissileRecycler but I knew it was possible in concept. After applying it and extensive debugging MissleRecycler was born and then later refined until becoming pretty much obsolete next to this one.
     
  19. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    The dummy unit should have the Crow Form ability added to him in the Object Editor.
    Else, the Missile Recycler doesn't work in it's current state.
     
  20. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Nop, use AutoFly if u want it to work right