Kuribo64
Views: 22,940,694 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
10-15-24 09:06 AM
Guest:

0 users reading Importing/Creating Planets/Objects Tutorial v2 [New!] [Updated!] [Shiny!] | 1 bot

Main - Archived forums - SMG documentations and tutorials - Importing/Creating Planets/Objects Tutorial v2 [New!] [Updated!] [Shiny!] Hide post layouts | New reply

Pages: 1 2 3 4
NWPlayer123
Posted on 06-08-13 11:28 PM (rev. 4 of 05-23-14 05:41 PM) Link | #24413

NWPlayer123's Importing Guide v2


Now with more rewrites!



Starting Notes


This isn't solely for planets, this can be applied to any object you want, for whatever effect you want. There's a ton of definitions in ProductMapObjDataTable that let you do quite a bit of cool stuff if you know how to get it to work.



Creating the model


Starting Notes


Even if you don't do the modeling in Sketchup (Sketchup Pro 8 for best compatibility, it's the one I'll be referring to when setting it up), you should still follow the setup in this to know your scale is right.

Setting Up Sketchup Pro


Before we start, you should really install my Plugin Pack into C:/Program Files/Google/Google Sketchup 8/Plugins (might be different if you have 64 bit or a different installer, the main thing is the plugins folder in sketchup's data in Program Files).

When starting it up for the first time, there should be an option for a template (if you have already disabled it or something go to Help > Welcome to Sketchup), set it to Simple Template - Meters.

Once that's done, hit "Start using Sketchup" and wait for it to load for the first time. Your first step would be to import Mario's model so you have a correct scale. Start by going to File > Import, setting it to 3DS files, and clicking the "Options" button on the right side of the window. I would recommend merging coplanar faces, makes it a little lighter on the program, but the important thing is that the units are in YARDS. Then download Mario and Luigi's models and import them using one of them using those settings. That will be the scale that the in-game Mario or Luigi will be relative to your planet when you import it.

Once that's done, get to modeling and/or texturing! One of the most useful plugins that I use on a regular basis when working on a model is Plugins > Cleanup[sub]3[/sub]. It basically makes your life a hell of a lot easier when trying to optimize it in-game. The settings take some understanding to get used to but it's a lifesaver.



Exporting from Sketchup Pro to OBJ


Once you've finished the model, it's time to export it to import into the game. To do so, delete the Mario reference model, unless you want a T-Post Mario in your planet, and go to File > Export > 3D Model. Set the export format to OBJ and hit the "Options" button. Doesn't matter if Export only current selection is on, that's for helping you select what to export, but the main thing is that you Triangulate All Faces, because otherwise half of them will be missing when you import it. It doesn't matter whether you allow it to Export 2-Sided Faces, that's just allowing you to have back faces for polygons (when modeling you probably noticed how one side of a polygon is a greyish-blue and the other is white, if this isn't selected it will only export the front side of them, and any textures on the back won't be transferred). I don't think the importer cares if there are any lines but I would just disable it. The other big things are to make sure that exporting texture maps and flipping YZ coordinates are on, because otherwise you'll get an error when importing because it has no textures to apply to the model, or if it does import, it'll be sideways and you'll have to rotate it in whitehole or anarchy when making the level. Units I would just leave to Model Units. Once that's done, select where to export and export!

NOTE: If you're going to use this model for both collision and the model, make two versions because if two sided faces are on when exporting the collision file then you won't be able to walk on it, you'll just slide around.



Creating the BDL File


Starting Notes


This is the section that gives a lot of people trouble, apparently typing in simple commands is difficult for some people, or they get an error because they did something wrong. Make sure you know what paths, drives, and scripts are.

Setting Up Dependencies


As mentioned before, you need to know what scripts are, on a basic level. Most of the tools we have for SMG Hacking are scripts that run via the Command Prompt. However, these scripts need something to run them, and sometimes another library to make it easier. As such, you'll need python 3.x and PyQt4 for OBJ2BDL and OBJ2KCL. You can find python here, the version as of writing this is python 3.4.0, though I'm running 3.2.3. You can find the PyQt4 library here under Binary Packages. Make sure it matches your version of python and your operating system type (32-bit or 64-bit).

Importing the Model


Once you have installed python and pyQt4, it's time to finally import it. The download for OBJ2BDL (I like to call it BDLCreate) is here (an exe is here but it still requires using the command prompt and is UNTESTED). Download it, and copy the OBJ from where you exported it to the folder where the python scripts are. Now comes the supposedly difficult part with the command prompt. You can find it by going into your start menu, typing in "cmd", and hitting enter. It's a black window with white text.

So, step 1 is to navigate to the folder in the command prompt. I will assume you are already familiar with paths and drives, if you're using multiple drives and the files are not on your C drive then you'll have to do "D:" or whatever the other drive is and hit enter to change the drive it's in. Now what you need to do is type "cd drive:/pathtodrive" and hit enter to move to the folder that the script is in. For instance, I would type "cd C:\Users\npboo_000\Desktop\SMG2WorkFiles\Tools\BDLCreate-0.4" since that's where it is for me. Now it's a matter of typing in the right command to import it. Said command, for me at least, would be "C:/python32/python.exe obj2bdl.py model.obj export.bdl". What this is doing is running python.exe and telling it to execute the obj2bdl.py script. The script has additional parameters, namely the import file and export file (export file is optional). If everything is right it should take a bit, and a BDL file should be created. Hooray! The hard part is over...kinda.



Creating the Collision


Starting Notes


To start off, as noted before, if you're using a model that you exported with 2-sided faces, DON'T. Make a seperate model without it, and simplify it as much as is needed. There's a much bigger limit on the amount of polygons of collision you should have, don't make the game work harder then it needs to. Second, if you want to assign floor codes (there's a list of them in the program), use colors in sketchup to texture polygons to group them, and give them a descriptive name so you can find them later when importing. Basically each color/texture/group of polygons can be assigned a floor/wall/other code when importing.

Importing the Collision


Thankfully, importing collision isn't quite as painful since blank made a nice handy GUI to import them with. The download link for the collision creator (I call it KCLCreate) is here (and if you really want it, the script source code is here and a 32-bit version of the EXE is here). Once you download it, just double click collision_creator.exe and wait for it to load. It should be self explanitory, go to File > Open and open the OBJ, it should pop up with a list of the textures/colors you exported the model with (there should also be one with default group or something, that's the untextured polygons, you can usually leave them alone as the program will default to importing them as normal solid polygons). If you want to play around with the codes and settings, be my guest, that's how you make the honey for Bee Mario to climb on and the walls for Boo Mario to go through, among other things, but otherwise, just go to File > Save or Save As, and export.



Importing into the game


Opening the Game Files


So, now's where you need SMG2's files, the ones we need to edit to get the game to recognize that there are new planets are either "PlanetMapDataTable" or "ProductMapObjDataTable", both of which are in ObjectData. You need to extract them using ArcExtract. To use it, the easiest thing to do is use my handy .bat file to extract it automatically. You just right click any arc file, Open with > Choose Default Program, and make sure you let it use the program with all arc files, manually select the bat file in the download, it shouldn't extract it on the first run, but just double click the arc file, and it'll create a folder, and inside it is another folder and inside THAT is the file's contents. The reason I create a double folder is so you can copypasta ArcPack into it and pack the new data correctly (IE all the files in a folder), makes it easier when you're editing it multiple times. Okay, back on topic. Inside said folders, you should have PlanetMapDataTable.bcsv or ProductMapObjDataTable.bcsv. Now comes the fun part.

Starting Notes


Just wanna say, there's pros and cons to using each file, if you use PlanetMapDataTable, that's considered the "right" way to import planets simply because it has all the customization options to make planets, and the name. If you want to know what all the parameters do (when we open up the BCSV for it), you can try looking at this thread. ProductMapObjDataTable has a lot more definitions (and definitions in general) for creating objects. Here's the full list if you want to see all the options. To open any BCSV, you're going to need Marionumber1's BCSV Editor.

Importing using PlanetMapDataTable


To start off, open the BCSV editor and open the BCSV in it. Then hit "Add" to add a new entry at the bottom of the list. Scroll to it, and start by changing "Placeholder" to the name of the planet (no .arc or file extension, look at the other entries for an example), and notice that above it is a list of fields with the name of the hash in hex, and then what the string is for the entry. All you want to do is go to the "Unknown" fields and delete the "Placeholder" text in it so it's blank. Once you've done that, just save and BE SURE TO CLOSE THE PROGRAM ONCE YOU DO. If you don't, it won't work when you're trying to pack the file. As such, the final step is to pack said file. Do what I mentioned above in starting notes by copying the exes and then clicking and dragging the folder onto ARCPack.exe. It'll make an ARC file. Drag the ARC file onto yaz0enc.exe and it'll make a "PlanetName.arc 0.rarc" file. Delete the original arc and rename the rarc to what the old one was, so you end up with a yaz0 encoded "PlanetName.arc" file. That's it! Go and add the arc and your planet to your SD and go create a level!

Importing using ProductMapObjDataTable


Importing using ProductMapObjDataTable is much easier, just extract and open up the BCSV, hit the add button at the bottom so it creates another entry at the bottom of the list, in this case Entry 406, and change the data from "Placeholder" to whatever the name of your planet is.
Then click the dropdown for the field and change it to ClassName, the other one you haven't edited yet, and change the data in that from "Placeholder" to "SimpleMapObj".


Closing Notes


Something I didn't mention above, if you're using Whitehole to create and you're trying and failing to get the planet to appear in it, that's because you're using a version of the model with custom vertex colors, which for whatever reason whitehole doesn't like. You'll need to make a seperate version using v0.3, you can find the script here and the (untested) EXE here.

____________________
"I hate playing musical chats" ~ Quote of the month

MK7tester
Posted on 06-08-13 11:36 PM Link | #24414
Nice tutorial, look forward to the video.

Arisotura
Posted on 06-09-13 03:48 PM Link | #24463
A note about LowFlag, MiddleFlag & co.: the game actually ignores these flags. The corresponding models will be used if and only if they're present on the disc.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

shibboleet
Posted on 06-09-13 06:52 PM Link | #24475
if _____Low.arc is used with LowFlag, then...

BiancoWater.arc < With WaterFlag and connect the WaterArea to that.

tada, working water.

____________________
a

MK7tester
Posted on 06-09-13 06:55 PM (rev. 3 of 06-09-13 07:47 PM) Link | #24476
Pics or it didn't happen, literally. Show us it works, until then i'm not convinced.


EDIT: Yep, didn't work correctly, who would have thought?

Arisotura
Posted on 06-09-13 07:51 PM Link | #24480
Posted by Luigi
BiancoWater.arc < With WaterFlag and connect the WaterArea to that.

... connecting a WaterArea object to... a flag?! What the hell do you mean?

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

blank
Posted on 06-09-13 08:01 PM Link | #24482
I'm not sure, but I believe that to get working water you have to combine a MoveLimit.kcl with a WaterArea.

Arisotura
Posted on 06-09-13 08:05 PM Link | #24484
I looked at SMG1 Beach Bowl Galaxy's main planet and it also has a WaterSurface.kcl.

However, in the same galaxy, the planet with the waterfalls doesn't use WaterSurface.kcl or separate Water models.

Water shit is mysterious to say the least.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

shibboleet
Posted on 06-09-13 08:08 PM (rev. 2 of 06-09-13 08:38 PM) Link | #24486
I Just tested it....
lolwut.
I set the WaterFlag to 1 in PlanetMapDataTable.arc and used BiancoHillsWater as the water model from Bianco hills, and placed the water where it needed to be, scaled, and I placed the WaterArea in the same place with the same scale.

It worked. It was shit. :P

But with a bit of y scale problems.

____________________
a

MK7tester
Posted on 06-09-13 08:20 PM Link | #24487
Err.... I wouldn't say it worked too well, the thing I saw on your stream was an absolute mess. :P Even the railmovewaterobj was better.

shibboleet
Posted on 06-09-13 08:21 PM Link | #24488
It was just the Y scale ._.

____________________
a

MK7tester
Posted on 06-09-13 08:24 PM Link | #24489
It was still an absolute mess, I don't remember the X and Z scales being all too perfect either. :)

shibboleet
Posted on 06-09-13 08:24 PM Link | #24490
No, they were just fine. The reason It was a mess is because it was too high scaled.
End of story.

____________________
a

MK7tester
Posted on 06-09-13 08:26 PM Link | #24491
Still not gonna fix any problems we had before, will it?

shibboleet
Posted on 06-09-13 08:29 PM (rev. 2 of 06-09-13 08:39 PM) Link | #24492
Posted by Silver
Still not gonna fix any problems we had before, will it?

It was just to see if it was possible, so stahp.
It's a start to this though, we can improve beyond here.

____________________
a

MK7tester
Posted on 06-09-13 08:41 PM Link | #24493
That's something I can agree with you on, it was a start.

Goembario
Posted on 06-11-13 06:17 PM Link | #24709
Sooo does anyone know why I can see my model in whitehole, but doesn't show up in the game itself?? (on dolphin)
Changing stuff and adding stuff does work ingame, but it won't show the model like it does show it in whitehole.

NWPlayer123
Posted on 06-11-13 09:20 PM Link | #24738
Well I would try actually testing it in riivolution on your wii since using dolphin to test and relying on it probably isn't the best idea...

____________________
"I hate playing musical chats" ~ Quote of the month

Goembario
Posted on 06-11-13 09:32 PM Link | #24744
Well okay thanks for the reply then :P , I'm just screwed then since my wii has no drive anymore and Wiiu's vwii doesn't support revolution. (and I don't have a retail copy :/)
Well, I hope vwii will get supported in the future (though not counting on it yet), so I'll stop working on custom planets for a while :/ (and may buy the retail copy in the meantime :P)

NWPlayer123
Posted on 06-11-13 09:43 PM (rev. 2 of 06-11-13 09:44 PM) Link | #24751
Actually it does now, suprisingly. If you ever get the disc you can play it. We were just talking about it on the IRC today xD you just gotta run the exploit to install the homebrew channel first. Then it should be simple enough to run it.
Unfortunately stuff like letterbomb doesn't work though, you have to use a game exploit, somethign like smash stack.

____________________
"I hate playing musical chats" ~ Quote of the month
Pages: 1 2 3 4

Main - Archived forums - SMG documentations and tutorials - Importing/Creating Planets/Objects Tutorial v2 [New!] [Updated!] [Shiny!] Hide post layouts | New reply

Page rendered in 0.034 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 235/235, time: 0.011 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.