grzybeek / YMTEditor

YMTEditor is a free tool which allows to easily edit GTA5 .ymt files (Peds clothes)
67 stars 22 forks source link

Rename window showing wrong name. #17

Open MarcT opened 1 year ago

MarcT commented 1 year ago

You have to come with me on this one, because this requires the user to not understand what he has done wrong.

  1. Create a new YMT. It will be mp_m_freemode_01, and call it test image
  2. Save it, it will be called mp_m_freemode_01_test.ymt
  3. Rename it to mp_m_freemode_01_test_02. This is where the user is confused. They rename it from test. image To mp_m_freemode_01_test_02 and do not pay attention to the fact that they are doing something wrong. image Notice the new full YMT name correctly tells them it is mp_m_freemode_01_mp_m_freemode_01_test_02, but they ignore that....
  4. Save it again. Notice that it wants to save as mp_m_freemode_01_mp_m_freemode_01_test_02.ymt, but the user thinks, that's not right, and saves it as mp_m_freemode_01_test_02.ymt. Come with me on this please.
  5. Re-open the same mp_m_freemode_01_test_02.ymt you just saved.
  6. Go to the rename window and you will see the new YMT name as mp_m_freemode_01_test_02, but you will also see the new full YMT name as mp_m_freemode_01_test_02 as well. image It is not until you save the XML and look at the "CPedVariationInfo name" line that you see the error.

This is the issue that happened with Sanriku today. Because his "CPedVariationInfo name" was mp_f_freemode_01_mp_f_terp1, fiveM was expecting his clothing to be named mp_f_freemode_01_mp_f_freemode_01_mp_f_terp1.

This was a user error, but there is a strange edge case on the rename window.

Interestingly when you realize the issue and change the YMT name to test_02 per my example above, it now gets confused. image And when you attempt to resave the YMT it runs with this same confusion and assumes the name should be test_02.ymt You have to force it to be named mp_m_freemode_01_test_02.ymt for it to finally fix itself. Again, this is what I had to do to fix Sanriku's issue today.

MrsBongmasta406 commented 1 year ago

If you open the ymt with codewalker rpf viewer (maybe this is the same as saving as xml?) the old name will still be in the file.

You have to change that name plus the hash for the name at the very bottom of the file. Save it and the name has officially been changed to be read correctly by fivem.

If file was named mp_f_freemode_01_test originally, it will still say that inside the file even after you change it using the renaming option in ymt editor. To see exactly what the file name is without opening the file in CW or as xml, if you can, generate a new creaturemeta file and it will auto generate the name. If it’s the new name you wanted your file. You are good to go. If it’s not, open in CW rpf view to fix.

I haven’t seen a recent update to the ymt editor so I don’t think it’s been fixed yet. But do correct me if it has been. Hope this helps.

MarcT commented 1 year ago

If you open the ymt with codewalker rpf viewer (maybe this is the same as saving as xml?) the old name will still be in the file.

Yes, that is exactly the same as saving as an XML. Codewalker understands how to open the YMT for display, YMT Editor does it in a way so that you dont have to understand the XML Format R* uses.

You have to change that name plus the hash for the name at the very bottom of the file. Save it and the name has officially been changed to be read correctly by fivem.

Again you are correct. YMT Editor knows to do this so you do not have to. The issue at this point is trying to save the user from their own error.

I haven’t seen a recent update to the ymt editor so I don’t think it’s been fixed yet. But do correct me if it has been. Hope this helps.

Not yet, as it has not been closed out, but grzybeek did send me a EXE just the other day to have me test what he is doing to fix the issue. In the test EXE he sent me he added a name validation check so that the user cannot save with the mp_m_freemode_01 or mp_f_freemode_01 prefix in the rename tool.