ID:139736
 
Hey,

    turf/Block
name = "Block"
icon = 'Block.dmi'
Enter(mob/enemy/M)
if(M.density == 0)
return 0
else
return 0

I am currently in the process of trying to make enemies so that their density is 0 but are unable to move through otherwise what would be sense objects to the rest of the world. (This is so that players can pass through without having to use the bump proc) though, correct me if I'm doing this the completely wrong way.

My problem here, is although it stops movement, it does it too well and stops the AI completely in its run.

Although the AI is simply a basic random proc on a sleep delay currently the return of 0 as you know stops all movement whats so ever.

If anyone can help by pointing out any stupid mistakes I'm doing or something that can fix my day that would be a great help (Searched the resource and it seems a bit of a hard topic to phrase into a search)

Thanks for your time for anyone who wishes to help

Keiron.
Writing mob/enemy/M does not specifically filter out everything that isn't a /mob/enemy, it just says to treat the argument as a /mob/enemy, which is wrong as any /atom/movable can be supplied as an argument.

If you are returning 0 regardless of the condition, why have an if() statement at all?

You wouldn't need to use the Bump() proc to allow players to pass through dense objects. Using Enter() would be suitable... considering you're already using it here, I'm not sure why it didn't occur to you.

To know why your AI proc is breaking, you're going to need to actually show us the AI proc.

This belongs in Code Problems, not Developer How-To.