ID:1635746
 
Keywords: bridges
(See the best response by Zecronious.)
Hey Me and My friend were discussing how to make an actual bridge were you can walk under and over. We thought of something with Cross(), but we are not totally sure. Do you guys thing there is a way to pull that off?
There's plenty of ways you can pull this off, one of them would probably be to check if the mob trying to cross has the same direction as it's entrance and exit and adjusting it's layer higher than the bridge.

If it doesn't, put it's layer lower than the bridge.
So you are saying if they are facing the same way as the entrance when they touch it, they will go under the layer and if on the bridge they would be facing either east or west so make it so if they do that they will go over it?
not real but if(usr.dir == bridge.dir) bridge layer is under mob if not brid layer is over mob
thats what Craz is trying to say
Best response
Modify turf.Enter() The code was written just off the top of my head.

turf/Bridge
Enter(var/atom/A)
if(istype(A,/mob))
var/mob/M = A
if(M.dir == EAST)
// etc (change layer of person)
else if (M.dir == WEST)
// etc
return ..()

Also, similar thing with turf.Exited. To get their layer back to normal.
I see I think
You're better off making a altitude handler for atoms. The code zero posted doesn't really work.
In response to Jittai
If he's just using this for a bridge he hardly needs an altitude handler.
Dayvon64 wrote:
Hey Me and My friend were discussing how to make an actual bridge were you can walk under and over.

Dayvon64 wrote:
under and over.

He's better off actually making something that handles what he wants instead of tacking on code into enter just for a visual effect. I assume if he wants people able to walk around and on his environment he wants them to also interact properly too.

Like not having a conversation with an npc bellow the bridge while on it. Or having to handle projectiles with out a altitude system. Or if the bridge is a few tiles wide - which would break your code instantly.
In response to Jittai
I don't understand why you keep saying my code would break. Seems okay to me. Also, Dayvon asked how to do this with a bridge. He didn't ask how to make an altitude system.

I don't think it's a good idea to make things over complicated if they don't need to be.

How many types of bridges are in your game? Etc etc. Those are questions you need to ask before you just go straight out and say "You need a whole system to control this feature".
In response to Zecronious
Zecronious wrote:
I don't understand why you keep saying my code would break. Seems okay to me. Also, Dayvon asked how to do this with a bridge. He didn't ask how to make an altitude system.

I don't think it's a good idea to make things over complicated if they don't need to be.

How many types of bridges are in your game? Etc etc. Those are questions you need to ask before you just go straight out and say "You need a whole system to control this feature".

Jittai is stating its better to make an altitude handler because if he's asking for a bridge to have a different altitude odds are hes going to want other things to have altitudes as well. Him C&Ping the same code you provided for the bridge a billion times for every changing altitude would just bloat the game's files.

He was just stating for the direction he seems to be going in with this post an altitude handler would be a more efficient option.
In response to D-Cire
Assuming makes an ass out of you and me. It would be wrong to simply assume he's going to want it for a lot of things. This may be the only attitudinal aspect to his game. We don't know.

That's why I'm saying, it would have been better for Jittai to ask rather than just make an assumption about what he needs.

Only Dayvon knows, lets not make assumptions.
In response to Zecronious
Zecronious wrote:
I don't understand why you keep saying my code would break. Seems okay to me. Also, Dayvon asked how to do this with a bridge. He didn't ask how to make an altitude system.

Jittai wrote:
Like not having a conversation with an npc bellow the bridge while on it. Or having to handle projectiles with out a altitude system. Or if the bridge is a few tiles wide - which would break your code instantly.
In response to Jittai
He can change that if he'd like. You're assuming he's got more needs than what he stated.
Yes
I just want a bridge that you can walk under and onto is all.
^
An altitude system would cover that. It depends how integrated you want the bridge to be and what you want/need out of it.