1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. 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.

Collision Detection

Discussion in 'Requests' started by deth_lord, May 6, 2011.

  1. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Is there such a thing in warcraft 3 and how would i accomplish said detection, preferably without a huge overpowered script.

    Ex: a unit walking in a straight line runs into another unit. that unit dies from it and the other unit keeps moving in a straight line.
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    You could store the collision size of each unit type into a hastable using the unit type as the parent key. Then periodically pick units within range and check whether any units are within combined range of the collision size of the unit and the collision size of surrounding units.
     
  3. InfernalTater

    InfernalTater

    Joined:
    Jul 12, 2008
    Messages:
    2,970
    Resources:
    36
    Models:
    32
    Icons:
    2
    Packs:
    1
    Tutorials:
    1
    Resources:
    36
    Or just give the units a very low ranged immolation with instant death and a fast burn rate. (And remove the fire effects, of course).
    You could then set the ability to target specific types of units (such as non-ancient) and then give units which you don't want to die from collision the classification of ancient. Of course there are plenty other classifications to use.
     
  4. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    EVENT
    • Events
      • Time - Every 0.03 seconds of game time

    Why do we use Time - Periodic Event ?
    This is because we want to form a "check" if there any Unit B around Unit A
    One check every 0.03 second is a standard checking time

    ACTIONS
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 150.00 of (Position of (Triggering unit))) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)

    This is an example of "detecting collision" system
    It picks up units in area (circular shape) once per *YourEventTime* per check

    I have attached a test map for you to see
    Standard collision size area of circle is 160.00 (same as Immolation AOE)
    Use 160.00 for detecting collision to as near as possible from the unit

    TEST MAP
    This test map includes 1 Hero-controlled unit
    Move your Blood Mage to any Footman and when the Footman tries to get near you (160.00 range or less), it will instantly kills that unit (by obeying the Loop - Actions)
     

    Attached Files:

  5. InfernalTater

    InfernalTater

    Joined:
    Jul 12, 2008
    Messages:
    2,970
    Resources:
    36
    Models:
    32
    Icons:
    2
    Packs:
    1
    Tutorials:
    1
    Resources:
    36
    That is not a good system when you need to do this for every unit in the game. You're forgetting that this is not simply for one unit. And 150 is way too large of a range... Just use a shortranged immolation, as I said before. That way it works no matter the collision size of the unit, as different units have different collision sizes.
     
  6. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    loloLOLOLOLXXXXX111!111111!!!11!111

    That test map only focuses on that action, the Unit Group - Pick Every Unit..."
    Of course I just did the baseline of the system, you want to work with every unit ?
    Check out my spell http://www.hiveworkshop.com/forums/...-0-a-193975/?prev=search=defskull&d=list&r=20, it is MUI and use this kind of system as "detecting collision"
    It works for every moving thunder in that map (used for spell, same principle applies to use for normal units)
    The key is Unit Group
    When you add the collision unit to a Unit Group, you can pick it up in another trigger looping for once per 0.03 seconds and set a variable of location of the (Picked unit) and this will automatically supports multiple of units
    Geez, I hate to get to this detailed part anyway, but you backfired my statement, so...

    And if you say that 150 is way too large, please try to check in Object Editor for Immolation's default setting of its "Level X - Stats - Area of Effect"
    It is 160.00 and you said that 150.00 is way too large ?
     
  7. deth_lord

    deth_lord

    Joined:
    Jun 25, 2009
    Messages:
    47
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    i was going to use immolation but i was wondering how to get rid of the visual effects, or if there was a simpler way
     
  8. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,978
    Resources:
    17
    Spells:
    17
    Resources:
    17
    1. Go to Object Editor
    2. Go to Buffs/Effects
    3. Find "Immolation"
    4. Delete the data in the "Art - Special" field
    5. Delete the data in the "Art - Target" field
    6. Done