Bridges coding

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Bridges coding

Post 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 ;)
Check out my "TrueBuildings" - Mod

User avatar
Wutklumpen
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Sep 10, 2014 11:10 am
Contact:

Re: Bridges coding

Post 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. ;)
Fight back - if necessary strike first

User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Re: Bridges coding

Post 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 ;)
Check out my "TrueBuildings" - Mod

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Bridges coding

Post 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...

User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Re: Bridges coding

Post by Phakx »

Thank you. I go check it out ;)
Check out my "TrueBuildings" - Mod

User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 530
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Bridges coding

Post 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 :!:

User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Re: Bridges coding

Post by Phakx »

hitzu wrote: Try to remove the bridge while standing on top of it. :D
Save first :!:
Game crash?
Check out my "TrueBuildings" - Mod

User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 530
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Bridges coding

Post 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:

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Bridges coding

Post 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. ;)

User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Re: Bridges coding

Post 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?
Check out my "TrueBuildings" - Mod

Post Reply

Return to “Modding help”