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.

[Idea] [system] (vJass) CustomMissle

Discussion in 'Triggers & Scripts' started by Anachron, Feb 3, 2010.

  1. 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
    To Element_Of_Water
    No, it's always absolute now.

    Yes.

    Not really. (It's about efficiency)

    But that's nothing? I tested it with 20 missiles and nothing changed. Will test with more soon.

    You tell me about efficiency and then want to make a new variable for that stuff just to move the stuff out site? No.


    #Update
    • Testmap now has cliffs
    • More creeps
    • Z works like a charm now
    • Bugfixes
     

    Attached Files:

    Last edited: Apr 2, 2010
  2. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    This is the part where I bash your code because:
    - it doesn't use xe
    - it is not modular for not using xe
    - it doesn't allow you to change the model of the missile after creation
    - I couldn't understand it but ... can you "stop" the missile in the air? That would be something nice.

    xD
     
  3. 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
    It's made for replacing xe.

    See above.

    It easily does,
    Code (vJASS):

    set .sfx        = "Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl"
     


    Of course. You should check the system first please.
    But nice try for the bashing.
     
  4. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Then please post the entire code in the first thread xD
     
  5. 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
    No I won't, since I update it every few hours. Sorry. Just check the example map.
     
  6. Element of Water

    Element of Water

    Joined:
    Aug 3, 2008
    Messages:
    2,298
    Resources:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    1
    Resources:
    5
    Fair enough.

    In a function that is run once in fairly rare events, you don't need to care about efficiency.

    It's not nothing. There are loads of unnecessary function calls! And 20 is barely any. HindyHAT's PHYSICS system (which does a lot more calculations etc than this) can handle 200 entities at once.

    You already have a local variable, so making it part of the struct and removing the local isn't going to have much impact on efficiency.
     
  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
    Hmm I will think about it.
     
  8. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    I think (though I haven't tested on a computer other than my desktop) that my system can handle a little over 250, maybe 300. If your computer is better than a single-core AMD processor running at 2.2GHz you will probably be able to function with a hell of a lot more on the field.

    Anachron, if you want any help improving the efficiency or if you are having any troubles give me a PM.
     
  9. 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 haven't tested how many mine can, I will check that.
    Should I benchmark with all or no-optional functionality?
     
  10. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Well, you could do both. I believe without any of the optional features enabled mine ran almost 350 projectiles at once.
     
  11. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Why not use ARGB to change the color of the missile ?
    Is it ugly too?
     
  12. Element of Water

    Element of Water

    Joined:
    Aug 3, 2008
    Messages:
    2,298
    Resources:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    1
    Resources:
    5
    Hmm, methinks setTargetPos/Z is broken -- try this code:
    Code (vJASS):
    //! zinc

    library Test
    {
        boolean done = false;
       
        struct TestMissile extends CustomMissile
        {
            method onCreate ()
            {
                sfx        = "Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl";
                scale      = .55;   //: 55% of the normal size
                colorA     = 128;   //: Half transparent
                movespeed  = 128.;  //: Moves with a rate of 512
                turnspeed  = 0.15;  //: Turns with a rate of 0.15
                hitrange   = 48.;   //: Hits units and missles in range of 48.
                //set .xyarc      = -0.15 //: Has an xyArc of -0.15
                height     = 50.;   //: Has a height of 50.
                hitwalls   = false; //: Hits walls
                hitdests   = false; //: Hits destructalbes (kills them)
                hitunits   = true;  //: Hits units
                hitmissiles = false;//: Hits missles
            }
           
            method onTargetReach ()
            {
                TestMissile m;
                done = !done;
                if (done)
                {
                    m = TestMissile.create(1000., 0., GetLocZ(1000., 0.) + 50., 0.);
                    m.setTargetPosZ(0., 0., GetLocZ(0., 0.) + 50.);
                }
                else
                {
                    m = TestMissile.create(0., 0., GetLocZ(0., 0.) + 50., 0.);
                    m.setTargetPosZ(1000., 0., GetLocZ(1000., 0.) + 50.);
                }
            }
           
            method onLoop ()
            {
            }
           
            method onDestroy ()
            {
            }
           
            static method onInit ()
            {
                integer i;
                TestMissile m;
                //for (i = 4; 4 >= i >= 0; i -= 1)
                //{
                    m = TestMissile.create(0., 0., GetLocZ(0., 0.) + 50., 0.);
                    m.setTargetPos(1000., 0.);
                //}
               
                FogEnable(false);
                FogMaskEnable(false);
            }
        }
    }

    //! endzinc


    The missile seems to think it has landed at its target the instant the target it set...
     
  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
    1st.) Why do you overwrite the onDestroy method?
    2nd.) I have not checked whether SetTargetPos works, so I'll check if it does.

    Thanks for your feedback through.

    Flame_Phoenix the idea was to make it fast & flexibel without tons of librarys needed. That's one of the reasons I removed my CustomFIlter system from it.
     
  14. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    You mean, the idea is to make not modular an inflexible ? Because if you are not aiming for modularity, than I assure you the last thing that is going to be is flexible.
    Just saying ...

    In THW community project, if coders use this (they will) they will most likely have to repeat chunks of code for simple tasks. You can see why this is bad right?
    Besides, afaik, ARGB allows you more flexibility on changing colors, fades and gradients - it can't get any easier.

    Just a suggestion.
     
  15. 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 can implement it as optional thing if you really need it.
    I think that is a good idea.

    I am basically trying to make things easy for the user to implement and to give him much functionality in one package.

    Any other suggestions? (I highly approve [your] feedback, whether its positive or negative)
     
  16. Element of Water

    Element of Water

    Joined:
    Aug 3, 2008
    Messages:
    2,298
    Resources:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    1
    Resources:
    5
    I had something running onDestroy, but I removed it. I kept the method there so if I needed it again I didn't have to type it out again.
     
  17. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    You really are going to make me install wc3 so I can check the totality of your code and not just some simply shreds of it aren't you?
    Can't you just post the code WIP ? xD
     
  18. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    The color of the missile can be changed by referencing the unit that represents the "missile", in which you can change the color yourself using ARGB. There is no point in him including that system (even optionally) just to save you one variable reference (which would be referenced anyways in the system).

    To be quite frank, this is a dumb suggestion, even though Anachron is being nice about it. If code was posted, I could show you exactly how this would be done.

    Its funny though how you're saying that because its not modular its not flexible, and then you go ahead and tell him to add an optional library for specific functionality. Flexibility comes from the open-ended orientation of your code, to which (nearly) countless features can be added after without changing the way the system works.

    I don't understand where all of this poor criticism comes from, either, you're just wasting Anachron's time with these pointless suggestions.
     
  19. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Sorry for my late respone, Anachron I like your project because of it's flexability. Your systems can be used for very simple stuff, but also advanced stuff. Also you seem to be very motivated and you seem to be working on it often. Nice job.
     
  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
    Thanks, well I get more motivated when I get positive and/or negative feedback :)
    Anyway, have you tested it?!