• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Collision Detection

Status
Not open for further replies.
Level 5
Joined
Jun 25, 2009
Messages
50
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.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
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.
 
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.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
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)
 

Attachments

  • Simple Collision System.w3x
    13.4 KB · Views: 52
Level 33
Joined
Mar 27, 2008
Messages
8,035
That is not a good system when you need to do this for every unit in the game.
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 ?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
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
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
 
Status
Not open for further replies.
Top