This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED] [QUESTION] Custom WMO for Transport is buggy, File  (Read 2655 times)

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
[SOLVED] [QUESTION] Custom WMO for Transport is buggy, File
« on: August 13, 2013, 01:59:47 am »
The Video gives a better explaination of the issue, however for those that for any reason can't view a 2 minute video, have fun reading.

[youtube:1mumdcsp]http://www.youtube.com/watch?v=0xUlnvFFP2I[/youtube:1mumdcsp]

Basically I used Gamh's MirrorMachineQT program to convert a 3ds file into a wmo, and I had the names set to replace the original Alliance Transport Ship Wmo file as I used the same name.

Now the issue is that when I'm ingame and I get on the ship, when I get off.  My movement is still bound to the ship,  so when it moves away, it drags me with it and the only way that I've found to unhook me from it is to use a teleport command of some kind or logout.

For those of you that would like to try it and see for yourself, here's the download link:

Download Link removed.

Just put it into a patch and go ingame and try to use the Far left ship at the dock that goes to the night elf area, it should be replaced by the ship used in my video, no dbc data needed.
« Last Edit: August 14, 2013, 05:33:15 am by Admin »

Garthog

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 56
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #1 on: August 13, 2013, 02:27:30 pm »
What server are you using ? Trinitycore ?

Well, if it is, I did some research :

Code: [Select]
if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
    {
        // transports size limited
        // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
        if (movementInfo.t_pos.GetPositionX() > 50 || movementInfo.t_pos.GetPositionY() > 50 || movementInfo.t_pos.GetPositionZ() > 50)
        {
            recvData.rfinish();                 // prevent warnings spam
            return;
        }

        if (!Trinity::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.t_pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.t_pos.GetPositionY(),
            movementInfo.pos.GetPositionZ() + movementInfo.t_pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.t_pos.GetOrientation()))
        {
            recvData.rfinish();                 // prevent warnings spam
            return;
        }

        // if we boarded a transport, add us to it
        if (plrMover)
        {
            if (!plrMover->GetTransport())
            {
                // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list
                for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
                {
                    if ((*iter)->GetGUID() == movementInfo.t_guid)
                    {
                        plrMover->m_transport = *iter;
                        (*iter)->AddPassenger(plrMover);
                        break;
                    }
                }
            }
            else if (plrMover->GetTransport()->GetGUID() != movementInfo.t_guid)
            {
                bool foundNewTransport = false;
                plrMover->m_transport->RemovePassenger(plrMover);
                for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
                {
                    if ((*iter)->GetGUID() == movementInfo.t_guid)
                    {
                        foundNewTransport = true;
                        plrMover->m_transport = *iter;
                        (*iter)->AddPassenger(plrMover);
                        break;
                    }
                }

                if (!foundNewTransport)
                {
                    plrMover->m_transport = NULL;
                    movementInfo.ClearTransport();
                }
            }
        }

        if (!mover->GetTransport() && !mover->GetVehicle())
        {
            GameObject* go = mover->GetMap()->GetGameObject(movementInfo.t_guid);
            if (!go || go->GetGoType() != GAMEOBJECT_TYPE_TRANSPORT)
                movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT;
        }
    }
    else if (plrMover && plrMover->GetTransport())                // if we were on a transport, leave
    {
        plrMover->m_transport->RemovePassenger(plrMover);
        plrMover->m_transport = NULL;
        movementInfo.ClearTransport();
    }

Basically it means even when you're out of the transport, your client is still having the flag : MOVEMENTFLAG_ONTRANSPORT , so it's client-side, maybe you should check your WMOs bounding boxes etc.. !
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #2 on: August 13, 2013, 03:19:41 pm »
Quote from: "Garthog"
Basically it means even when you're out of the transport, your client is still having the flag : MOVEMENTFLAG_ONTRANSPORT , so it's client-side, maybe you should check your WMOs bounding boxes etc.. !

Yeah I kind of figured it was clientside as I stated in the video(I talk in my videos, I don't just record), I had merely swapped/overwritten the original transport ship's 3D Data with mines, the same goes with the file I had up for download, which was just a wmo file, no dbc data needed.

I don't think it has to do with a bounding box, I tried it with just a 12 polygon cube, a small cube that you are barely able to step on and the same thing happens.

Also as noted, the wmo was created whilst using Gamh's 3ds/Obj to WMO Tool.

Cube in action:

[youtube:888f8txm]http://www.youtube.com/watch?v=tkG5Og-MBQM[/youtube:888f8txm]

I've gone as far as making it a 2 polygon plane as well, same thing.

Anyway thanks for dropping by. :D
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Garthog

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 56
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #3 on: August 13, 2013, 03:36:55 pm »
Maybe there's a flag somewhere you have to put in the WMO. You should investigate that with PyWMO lib from gamh
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Gamh

  • Contributors
  • Loreweaver
  • *****
  • Posts: 81
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #4 on: August 13, 2013, 03:52:53 pm »
No clue. This seems to be proportional to something in the model though (maybe bounding box). Tried with karazhan as a boat (yeah i had a lot of spare time) and you're bounded until a very long distance, even on a flying mount. Maybe check for a specific flag in blizzard's transport models as Garthog said :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #5 on: August 13, 2013, 04:11:20 pm »
I tried this and the same happens to me. By the way, in map.dbc most transports use as internal name Transport and the id of the gameobject. Maybe the client checks this map or something?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

PhilipTNG

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 709
    • View Profile
Re: [QUESTION] Custom WMO for Transport is buggy, File inclu
« Reply #6 on: August 13, 2013, 10:31:15 pm »
@Garthog: Never thought of looking inside the lib, thanks for that! Anyway tried a normal non transport 3.x.x wmo and same thing happened. XD

@Gamh: Good God..karazhan... XDD, totally blows my little cube out of the water...or shifts it out of the dimension., as Noted to Garthog, I used a normal wmo and yeah same deal as your results with Karazhan

[youtube:ifr4222t]http://www.youtube.com/watch?v=WZqTKd8x6-A[/youtube:ifr4222t]

@davidfaca: If there's a will, eh.....someone will find a way. lol.

------------EDIT : Solved------------

I just copied and pasted the MCVP chunk from a working transport wmo file to my wmo files that were generated using Gamh's tool. and it worked like a charm, tested it on mutliple wmo's, including the normal wotlk wmo's i've tested before.  I grabbed the MCVP chunk from the TRANSPORTSHIP.wmo(Alliance ship)

The MCVP chunk is located at the end just after where MFOG's section/chunk ends(last for bytes are FF 00 00 FF).

I guess more tests are needed and by other people but if the chunk between most transport wmo's are pretty much the same, I guess Gamh could put in a checkbox on his converter if it's going to be used as a transport vehicle to insert this chunk at the end.   I'll play around with it some more to see if it makes hiccups while having this chunk on wmo's that I don't plan to be used as a transport object.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Gamh

  • Contributors
  • Loreweaver
  • *****
  • Posts: 81
    • View Profile
Re: [SOLVED] [QUESTION] Custom WMO for Transport is buggy, F
« Reply #7 on: August 14, 2013, 01:28:01 pm »
Hey, great job ! I'll take a look at it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »