ID:166547
 
If I had a magic system were it scans for players in the mobs area, such as inview of 5 tiles, how can I make it so that it doesnt show people that are behind dense objects, or shoot the thing and if it hits a dense obj, it'll hit that instead??

drak.
I believe this will work

turf/Wall
density = 1
Enter(obj/O)
if(istype(O,/obj/Magic))
del(O)
In response to Tazor07
mob
var
hept = 0
kel = 0
mob
spells
verb
Hept()
view(usr) << "<font color=aqua>[usr.title] [usr] chants..hept.."
usr.hept = 1

Kel()
if(usr.hept == 1)
view(usr) << "<font color=aqua>[usr.title] [usr] chants KEL!"
for(var/mob/M in view(5,usr.loc)) // i want this to pop up whoever is in 5 tiles from the player
// spell effects to whatever target, other than yourself
usr.hept = 0
usr.kel = 0
else
view(usr) << "<font color=aqua>[usr.title] [usr] chants..kel.."
view(usr) << "<font color=aqua>[usr.title] [usr]'s spell fizzles..."
usr.kel = 0
usr.hept = 0


This is a dumbed down of what I am planning to do...
I want it to pop-up a window showing who is in 5 steps of the usr, thenw hoever the usr clicks the magic happens to, then the combinations reset. Can you tell what I can put instead of for(var/mob/.....etc)? Also, how I can make it so that it doesnt show a mob behind a dense wall.
In response to Drakiel
Hm, never had to do that before. The only thing I can think of is to make an invisible obj move towards each mob in range, if it doesnt make it dont add it to the list. Make sure you delete the obj after the it tries to make it to the other mob.
I bet there is an easier way and I'm just not thinking about it right now, but try it out. It might cause some lag though
In response to Drakiel
If I understand you correctly, then you want the oview proc. The oview proc is just like the view proc, but oview excludes the center. Is that what you'd want?