ID:680528
 
(See the best response by .screw.)
How would i do this?
I tried:

obj
-asd
--density=0
--Enter(var/obj/projectile/p)
---if(istype(p))
----world<<"working"
---return ..()

but then i realized that Enter only works in turfs and bumping only works if the target has density=1.
How would I make it so that the projectile can hit the density=0 obj?


One option is to run a check within the projectile's movement.
Please make sure to use the <dm.>and </dm.> tags without the .'s in them to post your code correctly. As for your problem, it could be handled a few ways.

Could you please provide a bit more info? I'm not quite sure why you would want to hit an object that is not dense. Running a check whenever it moves is, however, one method that would likely work.
In response to Toddab503
Toddab503 wrote:
Please make sure to use the <dm.>and </dm.> tags without the .'s in them to post your code correctly. As for your problem, it could be handled a few ways.

Could you please provide a bit more info? I'm not quite sure why you would want to hit an object that is not dense. Running a check whenever it moves is, however, one method that would likely work.

&lt = <
&gt = >

Best response
atom/movable/proc/Bumped()
turf/Entered(atom/movable/a)
for(var/atom/b in src)
if(b == a) continue
a.Bumped(b)

obj/projectile
Bumped(atom/a)
if(istype(a, /obj/non_densed_wall))
world << "I bumped into a non-densed wall!"

Every time this projectile moves, it will check the contents of the turf it's over to see if atom/b is the atom (atom/a) that you are looking for.
I'm pretty sure the Cross/Crossed procs work with non-dense objects. They are the built-in version of Bumped(), but they only work with pixel movement.