ID:179671
 
How could i make it if a mob walks behind a tree he disapears(so it looks like he goes behind it )
Thanks
Greg wrote:
How could i make it if a mob walks behind a tree he disapears(so it looks like he goes behind it )
Thanks

I suggest creating a blank icon, and setting the icon_state to that when the mob moves out of view.
If you want the icon to still be drawn, but behind the tree, then change the mob's layer to below the tree's layer.

Lummox JR
In response to Lummox JR
Yes, the simple way of doing this is setting the tree's layer to MOB_LAYER+1 like:

turf
tree
icon='tree.dmi'
layer=MOB_LAYER+1
In response to Nadrew
Nadrew wrote:
Yes, the simple way of doing this is setting the tree's layer to MOB_LAYER+1 like:

That would work, but it's not the right solution: If an object was in front of the tree, changing the tree's layer would change the display order incorrectly. And making the tree's layer start out there is probably not the desired behavior (although it's much simpler to code, as you demonstrated).

Lummox JR
In response to Lummox JR
Well he's pretty new and I didn't want him to get into anything he didn't understand which would lead to more questions in the future, your idea would help him more when he learns to code a bit better.