1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you are going to register on XLNation, please make sure you do not use a proxy server.
    If you use a proxy server your registration will most likely get blocked due to spammers and hackers using proxy servers to hide their real IP address.

    If your using your home or work IP address and have not received your registration email, check your spam folder.
    PLEASE DO NOT ASK TO HAVE YOUR ACCOUNT DELETED IF YOU HAVE POSTED IN THE FORUM! If so we do not delete accounts due to the mess it can make on the forum.
    Dismiss Notice

Snap buildings to each other?

Discussion in 'Modding Help Quarter' started by aitortilla01, Apr 1, 2016.

  1. aitortilla01

    aitortilla01 Governor

    Joined:
    Sep 2, 2014
    Messages:
    35
    Likes Received:
    957
    I need help from my fellow modders :)

    Does anyone know if it's possible to connect models to each other? To have them snap to each other the way roads snap to the four points of the roundabout pieces?

    I had an idea recently about a modular project which would definitely need this functionality, it could only work if this is snap thing is possible.

    So far I've been testing around but I don't get it to work. The whole plug, track and junction thing has always been too complex for me. I'm trying to add two connecting plugs to this basic model, at coordinates (0 -20 0) and (0 20 0):

    [​IMG]

    This is the layout file:

    <?xml version="1.0" encoding="Windows-1252"?>
    <!--Layout file generated with 3ds Max scripted plugin by Altiris 2013-->
    <Layout>
    <Type>BASE</Type>
    <BaseFileName>""</BaseFileName>
    <Tag>""</Tag>
    <FilterType>MAXIMUM</FilterType>

    <LayoutEntry>
    <ID>Plug001</ID>
    <Type>PLUG</Type>
    <PrototypeFile>data/design/editor/plug.class</PrototypeFile>
    <Position>0.0,-20,0.0</Position>
    <Rotation>0.0,0.0,0.0,1.0</Rotation>
    <Scale>1,1,1</Scale>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingJunction01</ID>
    <Type>JUNCTION</Type>
    <PrototypeFile>data/design/editor/track/trackjunctionparking.class</PrototypeFile>
    <Position>0.0,-20,0.0</Position>
    <Rotation>0.0,0.0,0.0,1.0</Rotation>
    <Junction>
    <PlugID>Plug</PlugID>
    <IsAddress>1</IsAddress>
    </Junction>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingTrack01</ID>
    <Type>TRACK</Type>
    <PrototypeFile>data/design/editor/trackparking.class</PrototypeFile>
    <Position>0,0,0</Position>
    <JunctionStart>ParkingJunction01</JunctionStart>
    <JunctionEnd>ParkingJunction02</JunctionEnd>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingJunction02</ID>
    <Type>JUNCTION</Type>
    <PrototypeFile>data/design/editor/track/trackjunctionparking.class</PrototypeFile>
    <Position>0,0,0</Position>
    <Rotation>0,0,1,0</Rotation>
    </LayoutEntry>


    <LayoutEntry>
    <ID>Plug002</ID>
    <Type>PLUG</Type>
    <PrototypeFile>data/design/editor/plug.class</PrototypeFile>
    <Position>0.0,20,0.0</Position>
    <Rotation>0.0,0.0,0.0,1.0</Rotation>
    <Scale>1,1,1</Scale>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingJunction03</ID>
    <Type>JUNCTION</Type>
    <PrototypeFile>data/design/editor/track/trackjunctionparking.class</PrototypeFile>
    <Position>0.0,20,0.0</Position>
    <Rotation>0.0,0.0,0.0,1.0</Rotation>
    <Junction>
    <PlugID>Plug</PlugID>
    <IsAddress>1</IsAddress>
    </Junction>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingTrack02</ID>
    <Type>TRACK</Type>
    <PrototypeFile>data/design/editor/trackparking.class</PrototypeFile>
    <Position>0,0,0</Position>
    <JunctionStart>ParkingJunction03</JunctionStart>
    <JunctionEnd>ParkingJunction04</JunctionEnd>
    </LayoutEntry>
    <LayoutEntry>
    <ID>ParkingJunction04</ID>
    <Type>JUNCTION</Type>
    <PrototypeFile>data/design/editor/track/trackjunctionparking.class</PrototypeFile>
    <Position>0,0,0</Position>
    <Rotation>0,0,1,0</Rotation>
    </LayoutEntry>



    </Layout>



    Any help will be immensely appreciated! even if it's a confirmation that it can't be done
     
    Mr.X² likes this.
  2. Monty

    Monty Governor

    Joined:
    Aug 20, 2014
    Messages:
    778
    Likes Received:
    3,097
    I don't know about plugs and stuff, but road plugs have a fuction called
    Code:
    <Docking>
    , Maybe that's what makes them "dock" to roundabouts and other roads.
    Code:
    <LayoutEntry>
            <ID>Plug</ID>
            <Type>PLUG</Type>
            <PrototypeFile>data\design\editor\plug.class</PrototypeFile>
            <Position>0,0,0.3000000119</Position>
            <Rotation>0,-0.7070952058,0,0.7071182728</Rotation>
            <Scale>0.9999988675,1,0.9999988675</Scale>
            <Docking>BOTTOM</Docking>
        </LayoutEntry>
        <LayoutEntry>
            <ID>Plug01</ID>
            <Type>PLUG</Type>
            <PrototypeFile>data\design\editor\plug.class</PrototypeFile>
            <Position>40,0,0.3000000119</Position>
            <Rotation>0,0.7070952058,0,0.7071182728</Rotation>
            <Scale>0.9999988675,1,0.9999988675</Scale>
            <Docking>TOP</Docking>
        </LayoutEntry>
    Not sure if that will work with buildings.
     
  3. aitortilla01

    aitortilla01 Governor

    Joined:
    Sep 2, 2014
    Messages:
    35
    Likes Received:
    957
    Thank you for your reply Monty! unfortunately it doesn't seem to work or be enough to snap buildings. I have also explored the .class and .layout files of the in-game roundabouts, but it's very complex stuff and I don't get it.
    I guess I'll have to move on to simpler projects!
     
  4. skullz613

    skullz613 Administrator
    Staff Member

    Joined:
    Aug 21, 2014
    Messages:
    2,195
    Likes Received:
    2,242
    Just seen this. I was just looking in the placementrules.cfg and there is a <SnapBuildingDistance> tag.
     
  5. aitortilla01

    aitortilla01 Governor

    Joined:
    Sep 2, 2014
    Messages:
    35
    Likes Received:
    957
    hey sorry for the belated reply; thanks, but I still don't get it to work. I don't know, I guess I'll have to let it go and think of something else :(
     
    skullz613 likes this.
  6. kipate

    kipate Governor

    Joined:
    Aug 23, 2014
    Messages:
    2,370
    Likes Received:
    2,960
    What? :eek: One could come to the conclusion that you were a mere huma... fuck, was that lightning next to my place?... no no no, you are a God :boww:
     
    skullz613 likes this.

Share This Page