![]() | ||
Views: 24,483,253 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
04-27-25 01:28 PM |
Guest: |
0 users reading [Tutorial] How to Replace Mario's Model with a Custom Model | 1 bot |
Main - General SM64DS hacking - [Tutorial] How to Replace Mario's Model with a Custom Model | Hide post layouts | New reply |
Fiachra |
| ||
Local moderator Level: 65 Posts: 905/1065 EXP: 2335540 Next: 88 Since: 12-15-12 From: Ireland Last post: 2527 days ago Last view: 476 days ago |
Yes, it's possible with ASM hacking, I've done it in my hack. You need to:
1. Use a texture to colour your model rather than vertex colours. 2. When importing, include additional textures that can be swapped to change their colour. 3. Find where the BMD loading method 0x02016FD4 is called for your object. Immediately afterwards r1 will contain the address of the loaded BMD model. 4. Place a hook at this location. 5. Parse the BMD to find the material which uses the texture used for colouring. 6. Modify the texture and palette ID's used by that material eg. depending on the object's parameters stored at +0x08, +0x8C, +0x90 for parameters 1, 2 and 3 respectively. Here's some sample code which may be used to change texture ID's based on an object's parameter: unsigned int ObjectAddress = 0xFFFFFFFF; unsigned int BMDAddress = 0xFFFFFFFF; // Replace XXXXXXXX with the address just after the call to 0x02016FD4 and YY with the overlay in which that address is contained void hook_XXXXXXXX_ov_YY() { asm ( "ldr r2, =ObjectAddress \t\n" "str r4, [r2] \t\n" // In my case r4 held the object's address but this will differ "ldr r2, =BMDAddress \t\n" "str r1, [r2] \t\n" ); byte param01 = *((volatile byte*)(ObjectAddress + 0x08)); bool isRed = ((param01 & 0x0F) == 0x01); int textureID, paletteID; textureID = paletteID = (isRed) ? 1 : 0; int nMaterials = *((volatile int*)(BMDAddress + 0x24)); unsigned int offMaterials = *((volatile unsigned int*)(BMDAddress + 0x28)); unsigned int adrMaterial = offMaterials; for (int i = 0; i < nMaterials; i++) { *((volatile int*)(adrMaterial + 0x04)) = textureID; *((volatile int*)(adrMaterial + 0x08)) = paletteID; adrMaterial += 48; } } |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 33/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
okay I think I got the first step, but I don't exactly understand the others. I'm a bit rusty, as I haven't worked on my hack for a couple of weeks. ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
8PurpleThief |
| ||
![]() Micro-Goomba RIP Level: 8 ![]() Posts: 7/11 EXP: 2129 Next: 58 Since: 12-30-15 From: your mom Last post: 3346 days ago Last view: 3259 days ago |
i'm no SM64DS hAxOr, but this is a neat tutorial for other HaXoRs.
____________________ Man, the mods SURE are strict around here. (that doesn't mean i despise them, i just think they should just ban people for REAL reasons) (also, they banned one of my machiminist buddies, seanklaskyn64) DON'T KILL ME BUTTER |
Fiachra |
| ||
Local moderator Level: 65 Posts: 909/1065 EXP: 2335540 Next: 88 Since: 12-15-12 From: Ireland Last post: 2527 days ago Last view: 476 days ago |
Assuming that you're using DAE, to include extra images you need to list them under <library_images>, reference them as a texture within an <effect> and then create <material>s that reference that <effect>:
...
For the rest you'll need to become familiar with assembly hacking. No$gba debug version is the best tool to use.<library_images> <image id="img_1" name="img_1"> <init_from>img_1.png</init_from> </image> <image id="img_2" name="img_2"> <init_from>img_2.png</init_from> </image> <image id="img_3" name="img_3"> <init_from>img_3.png</init_from> </image> </library_images> ... <library_effects> <effect id="mat_1-effect"> <profile_COMMON> <newparam sid="img_1-surface"> <surface type="2D"> <init_from>img_1</init_from> </surface> </newparam> <newparam sid="img_1-sampler"> <sampler2D> <source>img_1-surface</source> </sampler2D> </newparam> <technique sid="common"> <phong> <diffuse> <texture texture="img_1-sampler" texcoord="UVMap"/> </diffuse> </phong> </technique> </profile_COMMON> </effect> ... </library_effects> ... <library_materials> <material id="mat_1" name="mat_1"> <instance_effect url="#mat_1-effect"/> </material> </library_materials> ... |
pacmainia&luigi |
|
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 38/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Did what you said. Is this supposed to happen?
![]() ![]() (above post deleted because misclicked and hit "delete button) ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
Fiachra |
| ||
Local moderator Level: 65 Posts: 930/1065 EXP: 2335540 Next: 88 Since: 12-15-12 From: Ireland Last post: 2527 days ago Last view: 476 days ago |
Did you follow: "Export your model to DAE, ensuring to check the option "Include Material Textures"" properly? |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 39/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Posted by Fiachra Yeah, I think I did... But I'll try again tomorrow. ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
Fiachra |
| ||
Local moderator Level: 65 Posts: 931/1065 EXP: 2335540 Next: 88 Since: 12-15-12 From: Ireland Last post: 2527 days ago Last view: 476 days ago |
If it's still not working, check that the file names are correct in the <library_images> element. |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 41/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
I tried what you said again, and included "Include Material Textures", but the editor gave me the following error message:
![]() ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
Fiachra |
| ||
Local moderator Level: 65 Posts: 932/1065 EXP: 2335540 Next: 88 Since: 12-15-12 From: Ireland Last post: 2527 days ago Last view: 476 days ago |
You didn't do it correctly; if the "images" folder is within the same folder as the DAE model then the path should be "images/monte_tex_r_VFLIP.png". |
EQUILIBRIUM |
| ||
Newcomer Normal user Level: 3 Posts: 1/1 EXP: 56 Next: 72 Since: 08-29-16 Last post: 3163 days ago Last view: 3163 days ago |
Hello, I am french and i verry not good in english X/ , please your traduction this tutoriel in french : ) |
Arisotura |
| ||
![]() Star Mario in this room you have a pile of apple pies Level: 166 ![]() Posts: 6378/9076 EXP: 59161205 Next: 1026481 Since: 07-03-12 From: in a box ![]() Last post: 10 days ago Last view: 17 hours ago |
Sparsite |
| ||
take your dumb self out of here. thank you. Level: 34 ![]() Posts: 107/270 EXP: 253453 Next: 198 Since: 05-20-16 Last post: 3074 days ago Last view: 2934 days ago |
Posted by EQUILIBRIUM Also, why are you asking him as if he knows french? (maybe he does, I dont know, but most don't). As staple said, google translate. ____________________ ASMR: *quietly whispers* move r0 r7 push r4 to r14 load register r4 into r0 POP |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 101/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Posted by Fiachra Okay. I did everything you said except for the asm step. it looks fine in the editor, but in game it looks like all the textures are black, like that level issue I had earlier. Is it supposed to be like that? ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 126/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Posted by Fiachra is there, like, a tutorial somewhere that teaches how to use it? ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
Sparsite |
| ||
take your dumb self out of here. thank you. Level: 34 ![]() Posts: 214/270 EXP: 253453 Next: 198 Since: 05-20-16 Last post: 3074 days ago Last view: 2934 days ago |
Posted by pacmainia&luigi All documentation comes within the program itself for quick and eays to access references. ____________________ ASMR: *quietly whispers* move r0 r7 push r4 to r14 load register r4 into r0 POP |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 147/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Posted by Fiachra Anywhere I can learn it? Like a tutorial or something? ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
mibts |
| ||
![]() Panser =Josh65536 (Programmer) Level: 39 ![]() Posts: 188/331 EXP: 392890 Next: 11881 Since: 08-31-13 Last post: 2314 days ago Last view: 291 days ago |
Here is a link to the ASM patch template, which allows making hacks with C or C++. It has an example and a tutorial. ____________________ Current hack: Excerpt from Super Mario 256 |
pacmainia&luigi |
| ||
![]() Red Paratroopa Hacker Level: 29 ![]() Posts: 148/178 EXP: 139846 Next: 8039 Since: 10-29-15 From: The Grandfather Paradox Time Loop Last post: 2183 days ago Last view: 1823 days ago |
Posted by Fiachra Okay.. I'm assuming this is the step that requires no$gba. how do i find the address? ____________________ Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka......... |
Main - General SM64DS hacking - [Tutorial] How to Replace Mario's Model with a Custom Model | Hide post layouts | New reply |
Page rendered in 0.027 seconds. (2048KB of memory used) MySQL - queries: 28, rows: 234/234, time: 0.009 seconds. ![]() © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |