Page 1 of 1

Bridges coding

Posted: Wed Sep 10, 2014 12:29 pm
by Phakx
I'm sure that there is a post in this forum about it but i didn't found it. I want to add bridges in my mod. But the coding for it is difficult (in my opinion)
What i found (and i'm not sure) is this coding line in the tiles.lua

Code: Select all

    allowed_neighbors = { "water" },
line 138
This is a line for deep water. Same for water.
So if i'm not wring, i could make an entity and add this to the neighbours so i can put it close to water or am i wring?
Please help me ;)

Re: Bridges coding

Posted: Wed Sep 10, 2014 1:04 pm
by Wutklumpen
just give it a try ;) But i have no idea if this will also supress the collisiondetection for the player to walk over the bridge. Grüße aus D. ;)

Re: Bridges coding

Posted: Wed Sep 10, 2014 8:19 pm
by Phakx
Thanks for the advise.

This is not one of my major things for the mod because there are some people who worked on this. so i think i will let them solve the problem :P

Dennoch danke ;)

Re: Bridges coding

Posted: Thu Sep 11, 2014 7:53 pm
by Rahjital
RoadWorks has working bridges, so you might want to look into that. They are very hacky, but work fine if you ignore nearby terrain sometimes changing when you place them. The graphics are nowhere near finished and I got stuck on them because I'm no 3D artist, so it's unlikely to get finished anytime soon...

Re: Bridges coding

Posted: Thu Sep 11, 2014 8:11 pm
by Phakx
Thank you. I go check it out ;)

Re: Bridges coding

Posted: Thu Sep 11, 2014 9:05 pm
by hitzu
Rahjital wrote:RoadWorks has working bridges, so you might want to look into that. They are very hacky, but work fine if you ignore nearby terrain sometimes changing when you place them. The graphics are nowhere near finished and I got stuck on them because I'm no 3D artist, so it's unlikely to get finished anytime soon...
Try to remove the bridge while standing on top of it. :D
Save first :!:

Re: Bridges coding

Posted: Fri Sep 12, 2014 11:21 am
by Phakx
hitzu wrote: Try to remove the bridge while standing on top of it. :D
Save first :!:
Game crash?

Re: Bridges coding

Posted: Fri Sep 12, 2014 12:29 pm
by hitzu
Phakx wrote:
hitzu wrote: Try to remove the bridge while standing on top of it. :D
Save first :!:
Game crash?
Nope. Your character and his inventory will be deleted and your camera will be in free mode. Of course you can't undo this. :roll:

Re: Bridges coding

Posted: Fri Sep 12, 2014 6:24 pm
by Rahjital
hitzu wrote:Nope. Your character and his inventory will be deleted and your camera will be in free mode. Of course you can't undo this. :roll:
That's because the game thinks "Oops, the character is standing in water, I can't allow that! ...hey, the player has no character. That means he must have ascended to a higher plane of existence!" and then it makes a god out of you :) It wouldn't be too hard to fix.

You can do the same to biters, too. It's not easy, but if you shoot the bridge below their feet, they'll all drown. ;)

Re: Bridges coding

Posted: Sat Sep 13, 2014 9:25 am
by Phakx
So you can avoidg this by don't delete bridge parts while you stinding on it.
or could you just add some protection by prenting deleting some bridge parts who you are standing on or add some neighbours in the tiles.lua?