Detecting collison and projectile flying height

envenger

Active Member
Reaction score
3
hi...

How to check the collision of a dummy projectile with a unit?
Is there a good system for it? I know how to use jass and very little of vjass.

Is there way to avoid abnormal bending of dummy projectiles when passing through uneven terrain?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You can check the distance between 2 points with a math function preset in the editor. You can even do this in GUI. If the distance between the position of unit A and unit B is less then or equal to a set collision size, or the sum of the collision sizes for both units then they are colliding.
Checking for the z value of a position is a little bit harder though because this is not possible with GUI anymore and requires a line of Jass:
Code:
call GetLocationZ(whichLocation)
check the z value of the position of a unit and then add its flying height to get its actual current height for any collision detections in 3-Dimensional engines.
 

envenger

Active Member
Reaction score
3
But i don't have two points.

I just have the first point which is the point of the projectile. There can be any unit which comes in range of that projectile. So, i exactly don't know how to check that.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
You have the position of the projectile and you have the position of a possible target. Thats the 2 points you need.
For each unit which might get hit by the projectile add that unit to a unitgroup and then you just need to periodically iterate through the group and checking individually for each unit inside.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I'm not sure if this is what you need, but try the trigger action Unit - Turn Collision On/Off.
 

StEaLtHmAn

New Member
Reaction score
2
Look at this

MaD Object System

This is an easy to use system for making units move "realistic". You can now make your units knockback,jump,fly or move them anyway you want with only few simple line of code.
I've included examples which you can just copy and paste.

Requirements:
-JassNewgenPack (for vJass)
-Basic knowledge with Jass

Features:
-Several ways to throw,shoot,move your units!
-Include fancy methods which change size,color,opacity and play animation over a given time for your units.
-Fast and optimized system
-Great customizability that allows you to define your own Behaviours for your units in few code lines.
-Have been tested heavily, alot better than the system used in my map Mad Balls Arena that some may know.
-SAFE and EASY for newbies with Jass (Nothing is safe for pros, they hack everything, but it is always EASY)
-Focused on "Write as few code as possible"
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top