Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adds replacement CJ clothing models #3967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
botder merged 21 commits into multitheftauto:master from W3lac3:feature/replace-cj-clothe-model
Feb 18, 2025

Conversation

@W3lac3
Copy link
Contributor

@W3lac3 W3lac3 commented Jan 18, 2025

This PR will allow you to replace clothing models in CJ using the engineLoadDFF and engineReplaceModel functions. The clothing models should be made in the same way as in the original game, with 3 clumps, ripped, normal and fat,

List of model ids:

afro.dff -> 30000
afrobeard.dff -> 30001
afrotash.dff -> 30002
balaclava.dff -> 30003
bandana.dff -> 30004
bandknots.dff -> 30005
bandmask.dff -> 30006
barefeet.dff -> 30007
baseball.dff -> 30008
bask1.dff -> 30009
baskball.dff -> 30010
bbjack.dff -> 30011
beret.dff -> 30012
biker.dff -> 30013
bikerhelmet.dff -> 30014
boater.dff -> 30015
bowler.dff -> 30016
boxingcap.dff -> 30017
boxingshoe.dff -> 30018
boxingshort.dff -> 30019
cap.dff -> 30020
capandband.dff -> 30021
capback.dff -> 30022
capknit.dff -> 30023
capover.dff -> 30024
capovereye.dff -> 30025
cappolice.dff -> 30026
caprimup.dff -> 30027
capside.dff -> 30028
captruck.dff -> 30029
chinos.dff -> 30030
chinosb.dff -> 30031
chonger.dff -> 30032
chucks.dff -> 30033
coach.dff -> 30034
conv.dff -> 30035
cornrows.dff -> 30036
country.dff -> 30037
countrytr.dff -> 30038
cowboy.dff -> 30039
cs_afro.dff -> 30040
cs_afrobeard.dff -> 30041
cs_afrotash.dff -> 30042
cs_bandana.dff -> 30043
cs_bandknots.dff -> 30044
cs_bandmask.dff -> 30045
cs_bikerhelmet.dff -> 30046
cs_cornrows.dff -> 30047
cs_elvishair.dff -> 30048
cs_flatears.dff -> 30049
cs_flattop.dff -> 30050
cs_gimpmask.dff -> 30051
cs_groovecut.dff -> 30052
cs_hands.dff -> 30053
cs_head.dff -> 30054
cs_highafro.dff -> 30055
cs_jheri.dff -> 30056
cs_mohawk.dff -> 30057
cs_slope.dff -> 30058
cs_tramline.dff -> 30059
cs_wedge.dff -> 30060
cs_zorro.dff -> 30061
denim.dff -> 30062
elvishair.dff -> 30063
eyepatch.dff -> 30064
feet.dff -> 30065
field.dff -> 30066
flatears.dff -> 30067
flattop.dff -> 30068
flipflop.dff -> 30069
garagetop.dff -> 30070
garagetr.dff -> 30071
gimpfeet.dff -> 30072
gimphands.dff -> 30073
gimpleg.dff -> 30074
gimpmask.dff -> 30075
gimptorso.dff -> 30076
glasses01.dff -> 30077
glasses03.dff -> 30078
glasses04.dff -> 30079
glassesx.dff -> 30080
groovecut.dff -> 30081
grouchos.dff -> 30082
hands.dff -> 30083
hatmanc.dff -> 30084
hattiger.dff -> 30085
hawaii.dff -> 30086
head.dff -> 30087
helmet.dff -> 30088
highafro.dff -> 30089
hitop.dff -> 30090
hockeymask.dff -> 30091
hoodjack.dff -> 30092
hoodya.dff -> 30093
hoodyb.dff -> 30094
jeans.dff -> 30095
jheri.dff -> 30096
leather.dff -> 30097
leathertr.dff -> 30098
legs.dff -> 30099
legspants.dff -> 30100
medictr.dff -> 30101
mohawk.dff -> 30102
moto.dff -> 30103
neck.dff -> 30104
neck2.dff -> 30105
neck2_bb.dff -> 30106
neck2_field.dff -> 30107
neck2_hoodya.dff -> 30108
neck2_pimp.dff -> 30109
neck2_shirt.dff -> 30110
neck_bb.dff -> 30111
neck_field.dff -> 30112
neck_hoodya.dff -> 30113
neck_pimp.dff -> 30114
neck_shirt.dff -> 30115
neck_tracky.dff -> 30116
painter.dff -> 30117
pimp.dff -> 30118
pimpshoe.dff -> 30119
pimptr.dff -> 30120
policeshirt.dff -> 30121
policetr.dff -> 30122
shirta.dff -> 30123
shirtb.dff -> 30124
shoe.dff -> 30125
shorts.dff -> 30126
skullycap.dff -> 30127
sleevt.dff -> 30128
slope.dff -> 30129
sneaker.dff -> 30130
suit1.dff -> 30131
suit1tr.dff -> 30132
suit2.dff -> 30133
sweat.dff -> 30134
timber.dff -> 30135
torso.dff -> 30136
tracktr.dff -> 30137
trackytop1.dff -> 30138
tramline.dff -> 30139
trilby.dff -> 30140
tshirt.dff -> 30141
tshirt2.dff -> 30142
valet.dff -> 30143
vest.dff -> 30144
watch.dff -> 30145
watch_hoody.dff -> 30146
wcoat.dff -> 30147
wedge.dff -> 30148
worktr.dff -> 30149
worktrboot.dff -> 30150
zorromask.dff -> 30151

Proxy-99, TheNormalnij, Nico8340, denjifb, Weaita, Fernando-A-Rocha, Wannacry-ops, Armisael2k, DCMdavilla, and androksi reacted with thumbs up emoji AlexTMjugador, denjifb, Weaita, Wannacry-ops, Armisael2k, Fernando-A-Rocha, MegadreamsBE, and androksi reacted with heart emoji androksi, Wannacry-ops, TheNormalnij, Nico8340, denjifb, Weaita, Fernando-A-Rocha, Armisael2k, and Kooberium reacted with rocket emoji
@tederis tederis added the enhancement New feature or request label Jan 19, 2025
Copy link
Member

TheNormalnij commented Jan 19, 2025
edited
Loading

It looks like it doesn't work unless your model is linked with ingame texture. engineImportTXD doesn't help in this situation.
This feature doesn't work with most mods.
Can you provide a test resource, please?
Crash resource: clothes_test_crash.zip

@W3lac3 W3lac3 marked this pull request as draft January 20, 2025 00:30
Copy link
Contributor Author

W3lac3 commented Jan 20, 2025
edited
Loading

It looks like it doesn't work unless your model is linked with ingame texture. engineImportTXD doesn't help in this situation. This feature doesn't work with most mods. Can you provide a test resource, please? Crash resource: clothes_test_crash.zip

From the tests I've done, I've noticed that if the clothe is bigger than the original clothe in the game, it crashes. I was testing with a model of mine, this model is light and wasn't giving me this problem, so I couldn't notice it. At the moment I still have no idea how to solve it, so I've left the PR as a draft until I find a way to solve it.

@W3lac3 W3lac3 marked this pull request as ready for review January 25, 2025 13:37
Copy link
Contributor Author

W3lac3 commented Jan 25, 2025

The crash when replacing CJ's clothing model has been resolved. Here's an example of a working script:
replace_clothes.zip

AlexTMjugador, denjifb, Fernando-A-Rocha, and Wannacry-ops reacted with hooray emoji denjifb, Fernando-A-Rocha, and Wannacry-ops reacted with heart emoji

Copy link
Member

botder commented Feb 9, 2025

I've noticed that the game crashes if CJ is using the clothes that a script is trying to replace. It also crashes if you stop the resource that replaced the clothes.

Copy link
Contributor Author

W3lac3 commented Feb 9, 2025

I've noticed that the game crashes if CJ is using the clothes that a script is trying to replace. It also crashes if you stop the resource that replaced the clothes.

Which model are you using? Are you using the script I provided?

Copy link
Member

botder commented Feb 9, 2025

I've replaced policeshirt and policetr

Copy link
Contributor Author

W3lac3 commented Feb 9, 2025

I've replaced policeshirt and policetr

The models must follow the CJ pattern, with Ripped, Fat and Normal clumps. And the texture should also follow the game's pattern. About the crash when you turn off the resource, I think I know what it is, I'll check now.

Copy link
Member

@botder botder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, it doesn't crash anymore

W3lac3 added 3 commits February 9, 2025 20:02
- Change uint16 to std::uint16_t>
- Change the type of the variable g_clothesDirectory to auto
@W3lac3 W3lac3 requested a review from botder February 12, 2025 19:01
Copy link
Member

@botder botder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[placeholder]

@botder botder merged commit 6b82365 into multitheftauto:master Feb 18, 2025
6 checks passed
@botder botder added this to the 1.6.1 milestone Feb 18, 2025
MTABot pushed a commit that referenced this pull request Feb 18, 2025
Copy link
Contributor

Congratulations @W3lac3 Do you need help documenting this on the wiki?

Copy link
Contributor Author

W3lac3 commented Feb 18, 2025

Congratulations @W3lac3 Do you need help documenting this on the wiki?

If you could do the documentation, I'd appreciate it. I've been a bit busy.

Copy link
Contributor

Fernando-A-Rocha commented Feb 18, 2025
edited
Loading

Congratulations @W3lac3 Do you need help documenting this on the wiki?

If you could do the documentation, I'd appreciate it. I've been a bit busy.

Which pages should be altered / created?

Copy link
Contributor Author

W3lac3 commented Feb 19, 2025

Which pages should be altered / created?

The pages that need to be changed are: clothes components and engineLoadDFF (On this page there should be something showing that you can replace CJ's clothes, something like engineImportTXD wiki.)

Copy link
Contributor

Which pages should be altered / created?

The pages that need to be changed are: clothes components and engineLoadDFF (On this page there should be something showing that you can replace CJ's clothes, something like engineImportTXD wiki.)

Done. Edited https://wiki.multitheftauto.com/wiki/Clothing_Component_IDs and added note to https://wiki.multitheftauto.com/wiki/EngineReplaceModel

FYI this was added in r22987

W3lac3, Armisael2k, Meine1, LiraGamer, and Wannacry-ops reacted with heart emoji

Copy link

LiraGamer commented Mar 4, 2025
edited
Loading

Which pages should be altered / created?

The pages that need to be changed are: clothes components and engineLoadDFF (On this page there should be something showing that you can replace CJ's clothes, something like engineImportTXD wiki.)

Done. Edited https://wiki.multitheftauto.com/wiki/Clothing_Component_IDs and added note to https://wiki.multitheftauto.com/wiki/EngineReplaceModel

FYI this was added in r22987

you need change exemple has used
local dff = engineLoadTXD("custom_afrobeard.dff")

correct is
local dff = engineLoadDFF("custom_afrobeard.dff")
no ?

exemple used in : https://wiki.multitheftauto.com/wiki/Clothing_Component_IDs

Copy link
Contributor

@LiraGamer Yes, you are right! I edited the page. thanks

Copy link

LiraGamer commented Mar 19, 2025
edited
Loading

image
im testing new fatures, im download cj female to teste.

to correct hair alpha change .txd to dxt5 or dxt3 the crash it's right
image

its is correct ?

@TheNormalnij @W3lac3 @botder

code used
`local dff = engineLoadDFF("afro.dff");
engineReplaceModel(dff, 30000);

local txd = engineLoadTXD("afro.txd")
engineImportTXD( txd, 30201 )`

Copy link
Contributor Author

W3lac3 commented Mar 19, 2025

code used `local dff = engineLoadDFF("afro.dff"); engineReplaceModel(dff, 30000);

local txd = engineLoadTXD("afro.txd") engineImportTXD( txd, 30201 )`

I'm not sure why, but every time I edit txd using Magic TXD crashes, regardless of the compression I use. So try using TXD Workshop, because I used it while I was creating this system and everything worked normally. I also recommend asking questions about this function on the MTA discord.

LiraGamer reacted with thumbs down emoji

Copy link
Contributor

code used `local dff = engineLoadDFF("afro.dff"); engineReplaceModel(dff, 30000);

local txd = engineLoadTXD("afro.txd") engineImportTXD( txd, 30201 )`

no crash while importing this, but if the texture is compressed (DXT1, 3, 5 or whatever) it will just look broken, so RGBA all the way... sadly that means bigger filesizes

image

denjifb and Kinimel reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Pirulax Pirulax Pirulax left review comments

@botder botder botder approved these changes

+1 more reviewer

@TheNormalnij TheNormalnij TheNormalnij left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

1.7

Development

Successfully merging this pull request may close these issues.

The ability to replace CJ clothing and body part models

AltStyle によって変換されたページ (->オリジナル) /