ID:2124186
 
(See the best response by Ter13.)
Code:

    FloorTutorial
name=""
icon='Turfs.dmi'
icon_state="tile2"
Enter(mob/M)
..()
if(ismob(M))
//Trap/Spawning Procs here
return 1
else if(isobj(M))
return 1
else ..()
Exit(mob/M)
..()
if(ismob(M))
return 1
else if(isobj(M))
return 1
else ..()


Problem description: I'm simply trying to make so certain tiles spawn monsters or deal damage but mobs and objs on it have no density? or rather I'm Walking over things that should.

I would say first remove ..() from the beginning of both enter/exit.

Then I can't 100% tell what you are doing here but I would say keep in mind that return 1 allows you to enter, and return 0 prevents you from entering.

And finally I would say try using else return ..() instead, which returns the default value of Enter/Exit.
Best response
Clusterfack is on point here. Enter() and Exit() MUST return a value. If it fails to return a true value, entry/exit will fail.

Calling ..() simply invokes the supercall (previously defined behavior), so you RARELY will ever need more than one in the same execution path.

. = ..() at the end of an execution path or return ..() to force execution to end is the main problem.

Also, I'd advise against checking isobj(), because atom/movable derives only into two types: /mob and /obj. If M is not a mob, it will be an object ALWAYS. Even if you forcibly define something as /atom/movable, the compiler forces it to be a subtype of /obj.

Lastly, you shouldn't be using Enter() in the first place. Enter() determines whether something can enter a tile, not whether something has entered the tile.

Instead, here's what I'd recommend:

turf/trapped
proc
Triggered(mob/M)
Untriggered(mob/M)

//when the tile is stepped into
Entered(atom/movable/o)
..() //only if necessary
if(ismob(o))
Triggered(o)
/*efficiency freak version:
ismob(o)&&Triggered(o)
*/


Exited(atom/movable/o)
..() //only if necessary
if(ismob(o))
Untriggered(o)
/*Efficiency freak version:
ismob(o)&&Untriggered(o)
*/


Now using this base behavior, you can perform polymorphic overrides to create new traps:

turf/trapped/spikes
Triggered(mob/M)
M.TakeDamage(25)
turf/trapped/pressureplate
var/tmp
obj/link
Triggered(mob/M)
link&&link:Signal(src,M)
Untriggered(mob/M)
link&&link:Unsignal(src,M)


TL;DR: Enter() is a question. Entered() is the response. Use Entered() in the case where you want something to happen when something steps into a tile.