Jump to content
  • 0

Mdatr editing


skurto

Question

Hi guys.
I decided to make some new maps for my server, so I did.
I added some objects like bridges etc.. and I'd like to walk under the bridges. It's posible to edit the collision data with 3ds, so I can do this?

Thx in advance!
B.G. skurto

Link to comment
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

2 answers to this question

Recommended Posts

  • 0

Scrypt 3DS Max by Ricky92

MacroScript Load_Mdatr
category: "Mdatr Tool"
buttonText: "Load Mdatr file"
tooltip: "Load Mdatr file"
(
    fName = getOpenFileName types:"Mdatr Files (*.mdatr)|*.mdatr"
    if fName != undefined do
    (
        f = fopen fName "rb"
        if f != undefined do
        (
            headerText = ReadString f
            if (headerText == "AttributeData") do
            (
                --messageBox("Header Check OK!")
                numOfMeshes = ReadLong f
                numOfHeightPlanes = ReadLong f
              
                if (numOfHeightPlanes > 0) do
                (
                    messageBox("Warning: Numer of HeighPlanes is greater than 0. This feature is currently unsupported.")
                )
              
                -- Mesh reading and creation
                for i = 1 to numOfMeshes do
                (
                    meshType = ReadLong f
                    meshName = ReadString f
                    toSeek = 31 - meshName.count
                    fseek f toSeek #seek_cur
                    meshX = ReadFloat f
                    meshY = ReadFloat f
                    meshZ = ReadFloat f
                    --messageBox("Mesh type " + (meshType as string) + ", position: " + (meshX as string) + ", " + (meshY as string) + ", " + (meshZ as string))
                    obj = undefined
                    case (meshType) of
                    (
                        0:
                        (
                            -- Plane mesh
                            scaleX = ReadFloat f
                            scaleY = ReadFloat f
                            obj = plane width:scaleX length:scaleY
                            obj.position = [-meshX, meshY, meshZ]
                          
                            quatX = readFloat f
                            quatY = readFloat f
                            quatZ = readFloat f
                            quatW= readFloat f
                            --messageBox("Quaternion: X " + (quatX as string) + " Y " + (quatY as string) + " Z " + (quatZ as string) + " W " + (quatW as string))
                            rot = quat quatX quatY quatZ quatW
                            eulerRot = quatToEuler rot order:2
                            rotate obj eulerRot
                        )
                        2:
                        (
                            -- Sphere mesh
                            sRadius = ReadFloat f
                            obj = sphere radius:sRadius position:[meshX, meshY, meshZ]
                          
                            quatX = readFloat f
                            quatY = readFloat f
                            quatZ = readFloat f
                            quatW= readFloat f
                            --messageBox("Quaternion: X " + (quatX as string) + " Y " + (quatY as string) + " Z " + (quatZ as string) + " W " + (quatW as string))
                            rot = quat quatX quatY quatZ quatW
                            eulerRot = quatToEuler rot order:2
                            rotate obj eulerRot
                        )
                        3:
                        (
                            -- Cylinder mesh
                            cRadius = ReadFloat f
                            cLength = ReadFloat f
                            obj = cylinder radius:cRadius height:cLength position:[meshX, meshY, meshZ]
                          
                            quatX = readFloat f
                            quatY = readFloat f
                            quatZ = readFloat f
                            quatW= readFloat f
                            --messageBox("Quaternion: X " + (quatX as string) + " Y " + (quatY as string) + " Z " + (quatZ as string) + " W " + (quatW as string))
                            rot = quat quatX quatY quatZ quatW
                            eulerRot = quatToEuler rot order:1
                            rotate obj eulerRot
                        )
                    )
                    obj.name = meshName
                )
            )
        )
    )
)
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.