1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[vJass] (system) Missile

Submitted by Anachron
This bundle is marked as approved. It works and satisfies the submission rules.
I have worked on this missle engine for 2 months now and start the first official beta today.

Please post feedback, critism, pros, cons, bugs, etc.
Thanks all for your patience!

And thanks for downloading.
Preview image by Furby. Thanks a lot!

Edit:
I've updated the testmap and added a second spell.
There is a lot of improvements in version 0.1.7 and I plan to make it even faster and even more modular. I also plan to create an easy to understand API.

Used librarys:

Changelog for 0.1.7

Changed all constants (TRUE, FALSE) to true/false
Changed interval to 0.03125
Fixed object leaks
Performance improvements on MissileMovement: Less object generation
Merged MissileLocHelpers to Missile<type>Target
Removed HomingMissile wrapper
Added second spell (Rain of Fire)
Removed Libraries from Modules


ChangeLog for 0.1.4

Changed name to Missile.
Completely remade in modules, supports now a lot of optional stuff.
Added SpellHelper, fixed a lot of problems, made the Miranas Arrow example WAY more powerful to show what this system is able to be capable of.


Keywords:
Missile, Projectile, xe, xemissile, xecollider, projectile, collider, awesome, anachron, collide, colliding, vJass
Contents

CustomMissile 0.1.7 (Map)

Reviews
Moderator
BPower: 11:02, 25th Feb 2016 Reason for re-review: Nowadays the spell section is packed full of missile systems from different authors, therefore a more qualified moderator comment than "this is neat stuff" is required. There is keen...
  1. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Yea, that's what I do in mine (that is, the only collision I worry about with destructables is 2-dimensional) but it works fine. The function you stated would not work for widgets because there is no way of determining whether a widget is a unit/destructable/item, the functions must be separated to include all possibilities.
     
  2. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    the function i stated is the one anachron uses. just saying that could be improved, that's all. o_O

    there's no need to make them separate, you only need the real value of the distance between the widgets. no need to specify the kind of widget

    Edit:found a good use for it. in the module-specific i designed (the collision detector) i could use the function for multipurposes instead of making one for each kind of widget.
     
    Last edited: Apr 29, 2010
  3. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    But there is no function to get a destructable height. Only to get the height of the terrain. The destructable can be played somewhere above the ground and the collision check will fail.
     
  4. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    all destructable's, no matter how high they are, act like they were in the ground o_O

    you can "simulate" height by inserting occluderheight exacly the height the destructable is (or 10 times smaller or 100 points smaller, whatever) (I don't do this)

    anyway, besides some flying rocks, waht destructable "flies?"
     
  5. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    And how exactly are you planning on determining whether to use
    GetUnitX()
    ,
    GetItemX
    , or
    GetDestructableX
    ? You would have to be able to differentiate between
    unit
    widgets and the others, which you cannot.

    The way I handle destructable collision is to ignore Z, since it really has no purpose and it can safely be assumed as 0.00. If it is not 0.00, then there's nothing you can really do (and in which case ignoring Z would be the right way to handle it).

    The only function that allows the enumeration of destructables is
    EnumDestructablesInRect
    , which enumerates them within a rect. No matter how you plan on enumerating the destructables (for collision) their Z will never be a factor. Even within the enumeration callback there is only the location Z of the destructable, but since the WarCraft III team didn't put any work into destructables it would be pointless to simulate destructable Z where there isn't any.

    What I did was just pass any destructable that is enumerated (and within the appropriate circular area) to the user-end function, so that if the user doesn't care about the destructable Z it is ignored, and if they do they can use their own method of determining whether or not the projectile struck a tree.

    Well destructables only lay on the surface of the terrain (with height offsets, but no real "z") which means that even if they are in the sky they will have a pathing that is applied to the terrain below (or no pathing), no matter how high they are.
     
  6. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Typecasting ftw.

    Well yes, that is correct.
     
  7. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    the point is, the greates part of the destructables used in map making (99,9%) are fixed on "height" 0.00. so not need to worry about Z paramater. just treat like it is a 0.00.
     
  8. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    But still its awful to typecast. Just make your own method for that.
     
  9. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Typecasting in JASS isn't available anymore at all. The return bug was the only real means of typecasting (unless I am out of tune with it, but I have found no need to typecast).
     
  10. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Well you can store any handle into the hashtable and load handle of id X as type, that is the only way right now. But still, I don't want this.
     
  11. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    i've seen out there somewhere a way to convert the widget to it's actual type, it was only a realativelly simple function call, will try to find it.

    edit: a forget it xD
     
  12. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Please try and find that. I would be interested in knowing how to convert a widget to a child-type.
     
  13. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    It's something like that:

    Code (vJASS):

    call SaveWidgetHandle(hash, 0, GetHandleId(theWidget), theWidget)
    call LoadUnitHandle(hash, 0, GetHandleId(theWidget))
     
     
  14. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    so, if it loads, there you've found the child type?

    Code (vJASS):


    function testwidget takes widget theWidget returns string
        local unit u
        local item i
        local destructable d    

    call SaveWidgetHandle(hash, 0, GetHandleId(theWidget), theWidget)
    set u = LoadUnitHandle(hash, 0, GetHandleId(theWidget))
    set i = LoadUnitHandle(hash, 0, GetHandleId(theWidget))
    set d = LoadUnitHandle(hash, 0, GetHandleId(theWidget))

    if u != null then
    return "it's an unit!"

    if i != null then
    return "it's an item!"

    if d != null then
    return "it's a destructable!"

    endfunction
     
  15. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Exactly.
    That is the only way I got it to work.
     
  16. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Oh. I thought it would be neat and clever to be honest. This is kind of slow and bulky.

    At first I laughed, actually, because had a gut-feeling that converting the type would be dealt through hashtable loading.
     
  17. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    As you said, typecasting is getting harder and harder. But still, that's the only possible way.
     
  18. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    Though the alternative is still faster (that being having separate functions for the different types).
     
  19. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    yeah as soon as i noticed that hashtable, i made different functions for diferent combination of widgets. o_O
     
  20. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yes, that's what I said, it's best to keep it seperated.