Fixing Injected Animations

Lord Zedd
By Lord Zedd in Tutorials & Guides,
So when you inject a biped, you may wonder why they cannot use vehicles despite having the animations for it. Turns out the modes block should be sorted by stringids in order for the game to "search" for it properly. It is basically the same idea as the Simulation Definition Table.   Unfortunately to automate this during injection would be a bit tricky right now, so here is a manual tutorial in the meantime to set you up. There may be other applications to sorting that we don't know about yet besides bipeds using vehicles, so try it out anyway if you are having issues.   I don't know about other Hex Editors but Hex Workshop is used for this tutorial. Notepad++ is also used along with its TextFX plugins 1. Inject your tag   2. Open up the tag's jmad and scroll down to the Modes block. It looks like this:   3. Right click the first label control (left or right of the stringid textbox itself) and View Value As.   4. Copy the file offset at the top to a notepad or something, you'll need it.   5. Close the View As popup and click the button to the right of the chunk dropdown to display the block's info.   6. Copy the Count and Entry Size values to notepad and open up Windows Calculator   7. Press Alt+3 to switch the calculator to "Programmer" make sure Dec is checked on the left and multiply the Count by the Entry Size. Check Hex to the left to convert the result to a hex value and copy that down. This is your length. Afterward switch back to Dec and enter the Entry Size value and convert that to hex.   8. Close Assembly and open your map in a hex editor. Jump to the file offset from before and from there select the length you just got a second ago via Edit>Select Block (Hex Checked)   9. Copy and paste the selection to a new document and scale the columns via the center divider so the number of columns is the same as the hex converted entry size (minus 1 more because it is counting from 0). It doesn't matter if it goes off the screen. The data should align quite nicely with the correct number of columns (see below)   10. Go to File>Export and save as a Hex String .txt like this   11. Open the resulting text file in Notepad++, and it should be formatted properly with the right number of columns.   12. Hold Alt and select the first 4 bytes in each row, like this:   13. Go to the following option in the menu bar: (Sort Lines Case Insensitive) and select it. This will sort the rows by stringid   14. Select everything and go back in the hex editor and Edit>Paste Special with this setup: (Make sure that bottom option is checked)   15. After pasting select everything and verify all the bytes copied over and the length is the same, then copy the selection and paste it right over your selection in the map tab. Save and you are all set!     EDIT: Repeat this tutorial for any sub-blocks like "Weapon Class" and "Weapon Type" if you are having issues with weapons or anything else. Weapon animations would be under "combat". It turns out everything *should* be sorted , but unless you are having issues don't worry too much.
  • 4 replies