PDA

View Full Version : Bridge under/over player question


Alpho
02-04-2015, 06:38 PM
Hello

On Ol'West I'm trying to make a bridge which can be walked under and over depending on which direction you walk onto it from. I don't want to use attachtoobj. I was thinking more of a layer approach. I had hoped I could use player.layer but it doesn't seem to exist.

http://i.imgur.com/ydyja0B.png

I made the bridge a separate graphic, and the rails are all separated as well. I was thinking I could put 4 radius detection npcs, one at each part of the bridge, and they'd detect if the player is there on the client side and change the layering and setshapes depending on where they enter from.

I can't get anything to work, and I really do not want to use attachtoobj because there's too many problems with other things like if the player enters their house or hops on a horse or something it could cause a mess. Also from my experience with attachtoobj on Delteria, I remember it causing everybody else to disappear when you're attached, which is complete trash.

Any ideas?

Jakov_the_Jakovasaur
02-04-2015, 07:30 PM
hello!

i personally accomplish this by using setshape2, with both a vertical and horizontal set of width/height/offsets

Alpho
02-04-2015, 09:52 PM
hello!

i personally accomplish this by using setshape2, with both a vertical and horizontal set of width/height/offsets

I'm completely aware of how to use setshape2, that's not my problem.

How do you make it so the image will show over the player for everyone if you walk under it and under the player if you walk over it? That's my problem.

I don't want players being shown above the bridge for some people and underneath for themselves or others, it needs to all display correctly.

Alpho
02-04-2015, 10:04 PM
The way I can think of working the best is changing the player's layer, if only that was possible..

scriptless
02-05-2015, 02:20 AM
Others have done this by hiding the player altogether and showing gani's in place of the player I believe. I know I've made a bridge like this before and just as you said, I had the exact problem. It's because if you walk under the bridge you won't be seen and neither will the players on top of the bridge they appear under when your under, and vise-versa. Attaching player to the object is the easiest way to do it but I hear there is a lag issue when doing that.

Jakov_the_Jakovasaur
02-05-2015, 05:29 AM
Others have done this by hiding the player altogether and showing gani's in place of the player I believe. I know I've made a bridge like this before and just as you said, I had the exact problem. It's because if you walk under the bridge you won't be seen and neither will the players on top of the bridge they appear under when your under, and vise-versa. Attaching player to the object is the easiest way to do it but I hear there is a lag issue when doing that.

correct, though it is not really necessary to show a gani, you can simply leave the player as normal when they are above the bridge, and hide the player (ideally using alpha so you can retain gani sounds etc) when they are below the bridge

Alpho
02-05-2015, 05:48 AM
correct, though it is not really necessary to show a gani, you can simply leave the player as normal when they are above the bridge, and hide the player (ideally using alpha so you can retain gani sounds etc) when they are below the bridge

Setting a player's alpha in a script is only clientside and they won't be invisible to other players. The best way to do that would be to make a gani with the alpha value set in it, and set that gani as one of the player's attrs. Still, there would be a problem with them walking under the bridge. They would just go and disappear and it would look wrong.

MysticalDragon
02-05-2015, 09:22 AM
Honestly the best approach with out a terrible work around would be attach the player to the bridge. And for things such as warping while on the bridge you could always detect if there attached and detatch them. Few ways you could do this, my favorite method is onplayerleaves.

Alpho
02-06-2015, 05:29 AM
Honestly the best approach with out a terrible work around would be attach the player to the bridge. And for things such as warping while on the bridge you could always detect if there attached and detatch them. Few ways you could do this, my favorite method is onplayerleaves.

I know that would probably be the simplest way, though I don't want people disappearing like that when they get attached. If that wasn't a problem, we could easily detect if they left the bridge and disconnect them from it.

Edit: Actually, I think I may have figured it out. attachplayertoobj works differently on GMAPs, I don't think it hides players when using it there - I'll see.

MysticalDragon
02-06-2015, 06:16 AM
I know that would probably be the simplest way, though I don't want people disappearing like that when they get attached. If that wasn't a problem, we could easily detect if they left the bridge and disconnect them from it.

Edit: Actually, I think I may have figured it out. attachplayertoobj works differently on GMAPs, I don't think it hides players when using it there - I'll see.

Well I was addressing one of your concerns, If it wasn't a concern maybe you shouldn't of mentioned it. And with the other concern, you could always make it so they couldn't get on their horse when attached.


like if the player enters their house or hops on a horse or something it could cause a mess.

xAndrewx
02-06-2015, 02:52 PM
Me personally? I wouldn't bother. All the current methods look & act crap.

Add a level under the bridge, add some homeless guy there or something interactive.

Alpho
02-20-2015, 07:14 PM
Me personally? I wouldn't bother. All the current methods look & act crap.

Add a level under the bridge, add some homeless guy there or something interactive.

That's exactly what I did. :D

Cubical
02-23-2015, 02:12 PM
That's exactly what I did. :D

you should make him /all orange and chase you if you don't give him some money.